pax_global_header00006660000000000000000000000064147470266150014526gustar00rootroot0000000000000052 comment=f8532ca757cb6a2d5bb5b1599e2524ac926a548b pv-1.9.31/000077500000000000000000000000001474702661500122465ustar00rootroot00000000000000pv-1.9.31/ABOUT-NLS000066400000000000000000000001031474702661500134670ustar00rootroot00000000000000 pv-1.9.31/MANIFEST000066400000000000000000000542141474702661500134050ustar00rootroot00000000000000-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 Check file integrity with 'sha512sum -c MANIFEST && echo OK'. 12c9829a9a29eb8d978ab41c6c1772165598cceaa4cb39be4bb9a9918f87d73462655906da8445927ba977ca7ab570647c26fbb9ce1e0f8988299622e4bdb29a ./ABOUT-NLS 63e5d46a3fb57d6f909978c686b11fa9f44856f3137d4e95b37e023617a386605426a59565739c496bed3767c30c01cbfc0109283639aca136283d1b6e1a6b47 ./aclocal.m4 981ed6f10d489832b31a1214f48ac427a5f716fb40a779d67a5db050eb3b43ff2498fc99322086c461d28ae5f186f3c53df494f764e8e15426294ae5bf3b2dee ./build-aux/ar-lib 32f778cfc0c44e932cd2cf650cc786c55985801ba5dba8d7de6088101ef25b4ae568a370fa2eabd0ca045b56a10cc5c8a0c41611726be80b9454bd8adffce6f0 ./build-aux/compile a9408118c9f1b517bf6fae5510204ca462a0222dcad6fc745e5c597b17536d58fbe98e05900bc00217629fc32e6c46103e0db1395b93fc0aece5db3a0e903924 ./build-aux/config.guess fdbe63a570db95f4d48be43550ed24772e3c1dbeb58de4aff2cb700910cf9a53fd0ebc806aaa33c370b0658cbd5ec348aa763d5cc00fb9cb296b9f328b004039 ./build-aux/config.rpath 311e08805ef3e1fba04964a67c408d8e1a2fdb378f150f7c07d20e6bf31fc7b9c16341837654eebfa4b984fd0d81febe51f471cd026e179c9d400cc33263a53b ./build-aux/config.sub 13c3d0ea0d8b8a27fdc09fdc7f71f98bb2ffccff38b6321b749b2e5c154e858767ef1d7b112c7c95db95e820c5e2bb837a8aaa076bc4378eb16dddddaa163116 ./build-aux/depcomp e9ed1ec4b9903ccca1d2d7c224200aaa194f22e6ccbcc2a3a595f38f5e3bf04177bcfac4ae12310bb91262ad8aa3f63420d795a42fb08d95296e0836f4c6a5e9 ./build-aux/install-sh 572532e8f09876021727e9ec80836bacc0452c75660a1707232bd0edc06d328db381d528cea8a824db66d8557b585b812d40fb5c8a994c23fd6a5ae951773b87 ./build-aux/missing b84fb90cb7400412ec9126350a0a85bc6819b4be48bac192ffa2e845e1409ca6da9d4d4a3de42149cc49055f40a8fe0ec36d62b42dee15dfbdbbac173159d434 ./build-aux/test-driver 66760c2026c90b68ebf24e820f1fa9893cb6d1bce6a1018ba64745ff3d704f0717429eee73c3b0b3804dd297681acee4ddc724858a91ef925a4032f9e2b50b7b ./configure f4ce4a43fc31c17a2f053e8f3528e40f2dbe32fee4a0e29deaeb96ca9a456376fb615c9c5851f633d5468059b688f3c4916f4c6f8880049ff2b6e1fb7e85f3db ./configure.ac 6158f563c95a4b8a1f9e8a2dc66498cecef93ee28f61f73a842e2e8c74bf1c7e8910aede38ad33ff540468f030f4c28aa25a09771f658a753f69f1afc2b82131 ./docs/ACKNOWLEDGEMENTS.md 3c76029e1dd554700c6882e7b03cb1efd353664fa3d85d3fa84add5b94f4d55ab1877a985bd70c627c0c07f420a088841c14b970f4470b0bcbcfa2270f6b6f4a ./docs/benchmark.sh f1de2c6f166edb7c5c13ec1961fa657cc72cdcdc39a8f90491c5b33949241a813ff076edd53b23a58e437f17c15f383b22705d05aa689313343aae5bc686327c ./docs/build-package.sh d361e5e8201481c6346ee6a886592c51265112be550d5224f1a7a6e116255c2f1ab8788df579d9b8372ed7bfd19bac4b6e70e00b472642966ab5b319b99a2686 ./docs/COPYING 6b532119d24bb0712c7d3c82b8284906b3067f4ee9c1e531eaaf36776520ea36c6b87030b3b0c202b9a3684dba980ba7f75eb4223e103b8df11f1e91fb2286ae ./docs/DEVELOPERS.md 930686b5a819e1c977de988f272818ca7788f375186f0435b20cf1d66359502ebfe9e430610de0bd9d599315a3ae56876b6681c3fcb420235e1a2d464632c5d4 ./docs/INSTALL 32c46684669c9712f21e75a3a4751cad9a4c9797c022d961e8a30488b3440453a145f8fe8b327b302323b4242f8e885bd900736961d0c52d369bcbcba7311732 ./docs/NEWS.md d5ff6106d657457dc4b4ba0be88a2bca9fa783e938be5c90bf667d3092198e62a879c98cf0b0d2e4d46a0e821a4ca8f01c29a2621e1ac6189294d5503e930f86 ./docs/pv.1 3793eaf83f7773c4c3805374c3c8cf06d2d1c79fbd00f3ffc22d213a625532c5d33fb46a33a3d24b9251faadf409037087a0ec091c6777efe7805c9cfc9aaf8f ./docs/pv.1.md c842e6976a1838f046b196c14f42937584c4874ac0bd75a42852a25752d0f494b0db1c9943f594f4b11a83d4f23380abe7b90122701b4a1e261e79a1cf6433e5 ./docs/release.sh c238fc54805d19ca622494e9b5acf9ddc4690fe29175ac69c08474277e09e853a1a0a5d8e52de55ac34b77c3063ad1b98e7e5e8bc0becadca842ffaede54c7ae ./docs/test-on-vm-lab.sh 4be0b062ee2a728a6580c4f9a018bf03d177f8c88058471d27c708defd15a54685f60169657b4cc0a20ac7902b7478fa16d50d2ea328fa0f645243694646c7f7 ./Makefile.am 9a9bd76f64af5744ad1408571d0a523dbd69c128924975927f530e28267063f879ce4710358339628ef495f425859405e9208ffd446402c6b11f07a52cdd979b ./Makefile.in f5fee55360a667c47f53b19da1f4001d5ff41239a028eec65da9744f6c05e24d8b15b684fd30d7956070deef52a88103f1cf93563b5bea29b032a0de8f6982e7 ./po/boldquot.sed 571d9f2bff652843ae9c6b6c5f5cb62faecead2a15f59b06dcceb96a6b80f720d531241bf8e96fc2e3e5a0dca23a9d4a4cd689f82e9005de02a664554badbc2f ./po/cs.gmo f0ef8450edf5235010dd4574cf019754fc3602715bdba9aa0dbcc5899a6b9c167cb001d35073cb676c959e88d74f2ae1db80c4839760fce9906a0605b323c9cb ./po/cs.po 369b5eae0031e700b3ac4558f3b574136a01c53f0e6bb97f243f665501ef41bcb3fa9d597816b3004ae9f84c7bac3390c7d2560f92352ad305fc8d61b9ce768f ./po/de.gmo fd01b1be5081b68f7d94688d7ac9facfa78cd4b448394e60e2d6ec457358b55cba388055e35557c51f956562114c4804cb3882c417c3362fb1f12775b39674b0 ./po/de.po 32c2e9e2213be41de2449069918eb3f6662e391c315fff99e94bdc760e976c5bd663060d216ab147c15d6744f8cf33334a7bf261d27895e55f4b02604abc2ae0 ./po/en@boldquot.header 733092a6d34a047382ee364ae363988df18ac16ee05e9259d023cd0fa63d2b8dd07466e2655064f288c8dd842cb0ea4d47ecd8ee234645dd6171e9b163fbc0cd ./po/en@quot.header 3a40b0225a1ed569e1cc62f198345d0621e81d7265bf574061ab73fee6a17535f206a5cb4c21ee65a32e83931ea6c993d159a58500e3879dfab843c476b5d90a ./po/es.gmo e348665829a4e057c99df510e6c2a7edf943115c027802325a3a9d7c965e6d6a6ec4044c0963015f1198c53c448751978c871aaafd08d0c360f438cb6efdf65b ./po/es.po 5b5aaf30a96c799491695e33ea2408462cb7c2e64f23dc7f56349fa0b37e80a489c7068d125fef8eb7e19e6c862c2f37d2ac90c4a35e7366ae0e2e775ab64616 ./po/fr.gmo eb1a3a92db5f4f3acce8dae9c1e99ab3749568dbafd981d68cb8b77292f8713e6db40f1a050d7b1b56424f5de2409c4b69aee1d8132472bd802a6126de475077 ./po/fr.po bb641b5726e5b09897c1e2ceb3802f8063f70e0a6def0d0c745b490d5466d341fb916ea8c53ccb71981670228fd1a8b667e8fec3146faf5a65db9b04e2fa0bb0 ./po/insert-header.sin eadc135d934aff19b4da70348b40029022d0a446671b3f6e8d06ce04e3b2dad3a1ba80782b2789bed17acdd43c5f8f038b0e83536290317fb7b05168706a8a48 ./po/LINGUAS 2eeaea3c0b78691d620b3288a32f99db6f6f232debb6de4e32e7245c475566bdae48143e0af83de2fda2e8541fbdc6e564453de98268c316817290ee292d9e3c ./po/Makefile.in.in c80b2f9b6f92942c5fc06f119de6f223c5ef5a1687a816921e5b3dce340b239cf2d3bcd27da29c80683d5c7c43e56c92018a78687f77429662e391a2c54420ea ./po/Makevars 6702a30f03b558c1f82e2c2cb866335d3924805d0ee2d44b3d6c6663568c87acef5a1ab96eca923b4084842dc06dbb5c95274ad0f7d253e9c0861dc478769527 ./po/pl.gmo 9ba431ef41b71dfd659a2e1d14f03e9b9456deb708f2771db7c881ed59510ed9130ea9c072ab4f36dd0190ed223003505d5bde37b303f724c751099b6c928ff6 ./po/pl.po de74e338e384c895ad4058d43e2a56ace2782284c67d9862d94f645dec94279d35f4f82a5812902d383282bcf6000e73d462b860dd5ac8006bc04a77921424f3 ./po/POTFILES.in a050d106880613afd0a71772e4aaf9b43fbb84d1c1c6f0ae14a0efa023e1d82f22fe61d6c344b00f46154ba25e8dcfda71fae577455404b8dd43aead9dede9c4 ./po/pt.gmo f58deed5321f6f659ac8a82500f7a914634f9cc5757245c65e0c665fd7e5594df5822fd07a51be9dda0f82cd8f35830d3cf7b9b64eb6c7cab17b199bc5b43722 ./po/pt.po 20af738bd36fdee8e0044242f8cb403d8d9a297f516a3e44cb035f22f1e7634f9b9316bbf836209d83221b731759f852cc4ec5041d6aab1bd9c04aa50a5599e7 ./po/pv.pot 884ab050ea90af5f42301ef44c5700b28c2e87f393ccb07a0774fd2fd0628471871f1fa4c0b9ac0d526208c95d6340ad0fb39877dc5f0273b63eb54358656e37 ./po/quot.sed 393d5274da83718f3c97fe27612ec8868a27858ee74795fae24a68429fca16c138c051b61d775814a47b558a159ec1fd3291e2f8918f2d78b29b429f029cbe36 ./po/remove-potcdate.sin d6a734e7e56f0c30e6cde8d25ac9e8dfcb20d21d45f8b6bf59c232c034f7ef6b976d42dbc4498a57a27c12c8014a6cf04651d2c9fe9839918808a7806781b47e ./po/ru.gmo 1807372260d5b064b9dc00f482d83a5c47d703779286f03c04aae127b56905b546f1cd1ac953869fc504b87ba11aaab5aa266a24059de7ad2b7ea997c1c504f3 ./po/Rules-quot e8a51866c5be807c2746c2e49975448064e2149daaf4cd19e9d65f90366694ae8cc200b2dbfba565685a63a0de4e5cba21843d2528641085278e8172830b78ea ./po/ru.po 20663b3f7a6c082bfa040bf33beb3e22307395933199a3af0db024cb82d25052eb13ae62e9b5549f11e563ada44d99a56adacb8531319bcf9032f73c7a2d1740 ./po/stamp-po 8df7960932dc7172c5fbda545710623d6463bf7c97eb21554d6d5fb1cfffb0d5c079637826f9fa25997ae1e2c991409c72b77ae06947dcc5ba71cdabdc991ec1 ./po/tr.gmo 5d6343d96a816b694cda4cccd884801d86b1c5ea458a1e0f0f5a7335f06db251e57d8540349802afac05d6dfc872248b67d9cfbdfc9071878eb49e3b5715aa4f ./po/tr.po 4f9a402a2bc5355e9e08748cefbe9863c3fe7a6a126768525c2e3a5b2be8b18952df474620dd92698483fbe00426410295dec2c9ec25c7689b2ffc0714156e14 ./README.md 5d9e9dd03ffc82a0f839a7f615e5810b98cce0a83eb0c164239d3d2399e35ee43fcfdccfadfc56a45627410bfe1fc18c20ce7efbe55209311b74fcea126e157f ./src/include/config-aux.h 8f65b0c482dd307f966911f3ef1d3067ba5d6cc4252da711f6c2101b3ce5d872ac3f34ed7d465162a77e600fbbd89b6db0d61dc355d3741ea265233d3da23513 ./src/include/config.h.in e3091f2d8bba3d506d9155d7cd1b8c32b71b512112185ac80a294766d99735fbf0c16194f32501e19a2056dd0d59c55b833b1e52d7a2907caa5cd312a9a4daca ./src/include/options.h d203ad7e54b3a2d4b1b6475d8c51ca753ba475e9da0ae48ce10f92efe890093fb9a46dea2290b370bcd174bcf223411a3215ed4a90753c50c5cc11280043bae4 ./src/include/pv.h a0b5b3c35999448411b8986a137b6de1c813c6b51d312e29f6b277b9b3c138d270f9f3765aa67da9a5c77467527b8c621d636c6911ca5261c15bfa6fdaa07b63 ./src/include/pv-internal.h 26cd2e5e0be6f40366d10be4a56507811d59e2aef49f0f28c09e7d466b9f307378fbeea4c0ae5aee8f689e52776bee536bb4e5b9aa6b903c75528f9d0e9fd921 ./src/main/debug.c 9b0696973be11628bf78084ea1de563f997cea0e8d34ed3167e58cee91b1643bfc02337d0b60d62066f32db3108f4d39e33ce159d714d3bc371822b5dc6be7eb ./src/main/help.c e261538a1187f81b5be7870dffb891ebc4e95371e509f92fbce8d1ae50b081953a96aa299baf781990ea99fd6404b653225a7dd14215b2a81f9e59eb3aff21d5 ./src/main/main.c 849e364e628492718f2e363f27cc992962a6ba654725cab31f48a6510a46bdbde2ff0354584d98dcecda9768d94cc682175c288b9c2f421ab3afc42db8ba78dc ./src/main/options.c f00d047e6ad450f3bdaef670a27e921b4db11a65ac65afd1ea286d829dd68b383701a15cf60baff785cd92d274766d0ce615113015cee82279e7ad42eeb918eb ./src/main/remote.c 8f1b18f8d5ffff4a623f1d5a6c91f781bcc71a39b3e40dc95abdeec811dde5ab566569c2e71b353107407ed140ec2dfed1fef2ab2faf9435fd31dfdccf645639 ./src/main/version.c 28ed5cf857cdce0f643deb8ef48f5c661ad323621005993b1422e17b28bdff8cffb4f85df2699c00a1afb44e735bef36f520e1b5e34bb7b6457aea8d75653aae ./src/pv/calc.c 4794eba41a215ee04256be6e2cbdcecd4fe76787ebb658e459f226bd9e9df62558bc773225843b38e0c6473fa99f0551ced67ee03634ec5e4a4824f2fca820fe ./src/pv/cursor.c 6325cadec9f4e77ce830e8d505f430fabcbebd67f5eddea002432d70dbe71c2986fbf0669bcf24c8849dff0788588b5ef23dfd6d0322e187c1c51e621b81cf03 ./src/pv/display.c 395c12fe2a412e7da5077e75d78c908d3bc4f67ee8023aca4db79cb4dfa00bd211a373293e21d10b0671c9e43002d000af32253fc94927295231ee7bb7373bee ./src/pv/elapsedtime.c 4691d6739fe40d161c80bbac71513a788bce3ea1e592ba08d04cbd1a5f24ae521961505f0012cf3039b59a3fae26b25bcfc4c5154311d01af9c7e4b349fdd9bb ./src/pv/file.c a04a0a4898a1cd327446e8d486839dbe72844f0ade24e80aaea651d41f421d0be9ee57f96e2eb30b1a00b66e2eaf13dfefafedce6f109154279e8d2777ed8859 ./src/pv/format/averagerate.c b4b55a4cf641b80dd4daa6c547f83051352ac5c8cd8db38ba5d1d4ee8764aa80ba2387316799a0c3826899a826c4cf5d768beda1ae92343eeb4b5abf56d6cb09 ./src/pv/format/barstyle.c 8f602a64736f81a537b4f2a59bae3bd7ec62bfd79e28f72debf94ef2d3b55e223639227ebd2a36edc64d6205a35b75317652691c5321b06104dc3c3e53738cc7 ./src/pv/format/bufferpercent.c b23f313a97d175ddbd60cd712db70a42559d8db53215558b677a22536af705d59fa2fb421db039ed3f35ef95dabbee2eefeaa0707045e5196479a458d9eacfc9 ./src/pv/format/bytes.c cb65d0c030b0be177a7adcf152b2ddceb5a31a40d63adb8b3b63ea7264c22c663800c94df10422c2c87bf21dd5de619a066a8e633f8882b5e0e79f857d9d7556 ./src/pv/format/eta.c 68c7eae6c3f2f2401819c0319c901471aabc20a449268545bf66f8951b9c470c7171025fc15c0a565cf3c9864f589d9bf94be603746a073fbe1939eb54f3fa88 ./src/pv/format/fineta.c a01dace7d406cfaeadf31628109c8a2bb4e4894b9a016c0b0ca216b8026ac79e911d807a1550872ee6aff2e6c6bcf76c205ffcd921033821f92e0261a1230b48 ./src/pv/format/lastwritten.c 093ff51cd9281b1f308152cfbab0036ce3ae74aa01715fe0eef107530b11f176327d1b95fb7f1a19c20c8d60d579016bdb4944881706a592a42b086c299efe2b ./src/pv/format/name.c 23676f8e4b91e5088a4ccb2c4e3614eb0abb910d40b96b6d9039a38f997e8f6a277c6c73ea2985cdbf46945081c700760ca6009e6c86b10055520bd57fae2d4c ./src/pv/format/previousline.c 28db8879c5f72407eb02079684846493d6ef5f06853f943b40df43d886daf6cdaa1786a06888c2c296c7f648d425b83e272963fa7d56d9aec05b3f811f1ce313 ./src/pv/format/progressbar.c 612cd97ee296bb8326bf8132ee07ce1afdf0b2a278d525d3243c60d42cd9b5ebefdb68e469daae3b845ab97f0ce84c7aaf87ebd95c21a4ad8da7c479d931a5eb ./src/pv/format/rate.c f0d400d9e7ba53571ae8ae7cd12b9190c66a965ef1bdf89f732222744053735279fb53efbd150892929bf50cfc761c577a0ed05b433c33061c5d7bc71f287b81 ./src/pv/format/sgr.c 6483efad27b4607b491367c09c7c70ac18335cd63b40b18e25cf34c3ae0ec611e032f2121a3df140cd3b72cf793ad6766f306f0ebc1017aca95d67446631866a ./src/pv/format/timer.c 330e82e50aeec808d40fe02102bb071db20e18e8fcfcc63e28c657651783470874ec436b9a30543e14ed390a7193df790bd39f9e28bb6e156644301f0e62be6c ./src/pv/loop.c 75614d7f8f47c9e34151bde10f597423449987dc07077cb72722068a8dc4d3cc5fe11f7b40d81639d2a34cd238a9b8d4b272cbfabc6c8b803883a71d5808b068 ./src/pv/number.c 1e3a8729aec84399c46e3c5c8b301199e413cec72f1d354f168a595878d5d5d81fc1e4aed11f900f2be502c581a119a5b2c2af54c8550c8dc16676726253dc06 ./src/pv/proctitle.c 6b433add59aac899598bd1f5691fc7a84a6c97dc9a83f3d8c947ff65328f782060992b8f0305eb4ad9fe8bb622d02853e41f230ad3f3aeac75aa3d49ae74c8b4 ./src/pv/signal.c b2ae64b421d09773ecd1af64702a47e2b9edf44435d5787aa735133fcdac140ca770d11f8b4c5aa55cde3f4c340f90c533f57c98851a629ee39e224837b3d374 ./src/pv/state.c bde13e4d43f10f8959e86434e1c027cf5b0c993cab5c15d4d69dbbe9c32d4de6e9dbc55a2daef64cef5f7817f564f7f0ff3b208ed67cfa8e4b6cd9a97ebebafc ./src/pv/string.c e5885c5c7289057c6a2bbed3137087b514daa0de441dfa21f7d43896c9970a920e357bf85d87d0796f98da8034f65f73bdbd291dace1979d3bc775a7faf3ebf4 ./src/pv/transfer.c 2cbfb309482986fefa72376c74efb422cfde552c442dc0a761cab5adace47bab4da3e188c2ee5caa63dffdf9d0fb05214a2120081808fdd0fe19ff7122e6fe76 ./src/pv/watchpid.c a83e8b586f504fce8e62809ff086e60f9fd8c272a82eb5b5a3acdbf13691c1c589219fb7ba765d8b2e52ee1ef00df174436e9a699d4a14411318b3a16855e986 ./tests/Bug_-_Display_length_at_magnitude_boundary_-_Bytes.test 315eefe6a6e1897b2a5f809f86a38d2ba8d9e6b7f19011b2be230ed49ed682511991b192215b3983d9f3ebd1767d1b7a689885e887a7f2d78a8e2b2ebe00f18b ./tests/Bug_-_Display_length_at_magnitude_boundary_-_Rate.test d3a615c18dbc064d72096dca412f85731e7a5e4251c202c92e211aeb9c374f5b9e179ae89229432236aa6ff071c79e021975d2754af1fa7fce88ce1de6e2b998 ./tests/Bug_-_Install_all_files.test 4faf6d511413f248bf4b87c59257b794c8003e086dcd3e400384228a1a23fbac80a7fce1104f6c5ac1ee353ba7e799ef24a22863bba74253b586da01ff689f6e ./tests/Display_-_--average-rate.test 8bdc97a8ee5f2ca55121a15bb38fd04319c0f3f1af2f2da39ce3555e3663fce18ecf38a8c387bb7eaaac4f0ac6e6623458eb0a0f300a1127f77278208bd8f8b3 ./tests/Display_-_--bits.test 8a33ff5e5a7a8aad7b88c3fe06c944098cdfd2311a6d56ae86ad01bfd39964a553a31b787fc323046a6cdf701c20ec215986f5401e355f2160c0723aeacacc3b ./tests/Display_-_--buffer-percent.test 03930d945d3eb8ba529586f9b2f3d30dcc82fa45f763e2223f1a0e02afcba289fd708bd4e4343c1e78afadded58d9e41c61928a52bf0302f1e4e81e1a9f8d028 ./tests/Display_-_--bytes.test 24eb688cca0380c244cdad3ae7968e72087e1c17f1d02a975ae085ab73aeda57b05cfcdc95f33389b2f98babb13859570bf5e64a3cd8a97dd319853d3597947b ./tests/Display_-_--eta_-_plausible_values.test bb0fe48ea27feeb3c8ea3e2d5fc37679ed08ce445a5374f96ada3dd93e7c3181dd99b9e931a4e1cf11e6ef43339118fa00753d6b92832af4ad7310187fa9eff6 ./tests/Display_-_--fineta_-_plausible_values.test 26703ba4117dbc0847a848c3d39b8cd94250c93b0251c3d2fc6f284ce5f45a04d94182ba29effaa10d1092a1b5783a8c5e3bd37cc66657f5019a98ad7c95587a ./tests/Display_-_--last-written.test a1b87ce25a1556aad4d12c6638f1216d5d00763d084e068c2e3702f7707cd736905f417652916225e17e657c23e94820f5ad27290a5507631a79aeccf5869206 ./tests/Display_-_--numeric_--bytes_--line-mode.test 9096a84b3c2c27e20cfdc9aaaeb81174e530fabf8bed65394cbf06e190423faf382a7d04074b2f4141a6a1639ba7dd2b3ab2e9543205e6531c3897533aa61087 ./tests/Display_-_--numeric_--bytes.test 324e5728097bb869918b64201a0898450beed04805754785c04d1ec53de8f54cf308df464a0333556ecf83e7eeb651be61eba6790ed505d9334ba2e0aa041262 ./tests/Display_-_--numeric.test 409827d16d89a963ac72743cfbdb235fe948c6e65fa4423a548d68d64dc5d5ce1f9112ce3c1abbdc179dc938b0f01481b0095ab7916e5f2b3e7a884262439681 ./tests/Display_-_--numeric_--timer.test a40f3f7cbc2d61171745e842bb0caaa219250c2b969174805e65d282c6b09b19287bf41cc4a14215f20abcc68b83f0fde21cd18254c63a9c67902d9a4849c0d4 ./tests/Display_-_--progress_-_basic_movement.test a053e0cb94c6497cb8c138c5088b0ed1fea2dd7299b8b627046f5e3e7b5b79e818e85dcda078c21d4db42647c73e178e2c920d5c14f5a6c0f2cd3eb08a6f3a47 ./tests/Display_-_--progress_-_increasing.test f4094407801e298bc3c24e85f645e158ad5ba74fc5e8b6d9f33d9ff8362a5b3c5c90623b1711543e5470cd83a10dbf087ad4481aaed8b9a266f6e6f3deb5af94 ./tests/Display_-_--quiet.test 88860dbd3e130529f894309e5c3eba54f294279fb925a8fb797413e3a5d135e78221a269379576ed3a54a7d826d3459887443652dad6effb94f42ee34819d8af ./tests/Display_-_--rate_-_displayed_value_changes.test a527e3d41fe55603de7200103bd9e03f52c0d5b91797f1df6420be1e665952cf4bacab2ec0000a64f88586e7031bd1b6393ecadbbe697f96e284bf9a853a22dd ./tests/Display_-_--timer_-_displayed_value_changes.test 1ef9e37ab91d386fc07092a804931e88caf89f9847e2c8dda7952ca01cf46d861c92967ed7022566803cbab3ae98a33dff542b82ab8d6121ddea7051284acc28 ./tests/General_-_--pidfile.test 7898834b12fd2e6b380215188ee399b8015050421ab4ca180a7b5cd40f904c081e69a96b4b4b2fee05796af4e0a1372dc95597105e6422a7c0b7e4d5589419a7 ./tests/General_-_--size_argument_handling.test 80531ec5c5fdb4a3e9fe075a1f12027c9b222e8f9d8fa497db19a032e81e72dca72a3d9aa7de5ed9349f966a2bfc1910e3d5740ccb8edb33fee9d20e746bf2e9 ./tests/Integrity_-_Basic.test 33a8e72d6f05a5ed98dd82808192e9a4ebcb62e09dfb6986acd7801968b246297b083c851745e14110e19f3c2808848adefbe61318ba1e141c02096ed36cdfcf ./tests/Integrity_-_Binary_data.test e1a21364aeeb6ad5253e9c6f28bfcb7cbf38ed5731b078aecd75007fc6bbcc9ea9392b113fc2069ba3ece41efd1e8e2c23bca1891b7d024a85172c22e8b039c5 ./tests/Integrity_-_From_bursty_source.test 40c06dc8131a3e592bfdcd0928cfa58cafadf40498c788355542ac3d92e996e82114f44daf44bfa7749503283beb0ba26ca048f49e6cd5916f8629bcc73ab98d ./tests/Integrity_-_Large_file_support.test daf150ed9c1d14bf5b93706c413b1c181a3a8a5329d393968a95d28c6aff2272a7745b09b77a9ca327c59edafe52daf3ea73daefba5ca831b227a7bf4b6ab979 ./tests/Integrity_-_On_output_pipe_close.test 72bd1355e9dc623fc8865db10baa6530e05269fa99f4a4fe70cc33e67485926e6a0ea3e3dc069775d1171e14eabb783cfb3606b8b8367750a0084e8810a79a19 ./tests/Integrity_-_When_adjusted_remotely.test dab53af5462e933490fbffcc00ed9ba858d23db5a98d9a3bb81a9535431309e1eaae51cbf6cb1917f9dad1fe98eaba3e83b7d6ad54297ab2b4019a025a5cf6ca ./tests/Memory_safety_-_Basic.test 7d042d9e408d68baae2060884ca08734b58a9b588ba27a56c838a54e0a0b64610b67476a98ca9cde639d7304b147aac74452f09dc188018f7585354be7555809 ./tests/Memory_safety_-_Process_title.test 8ad0e2ec7b19db4a79459d93bf5ba1495743e8825e8d1b26638cfa8b9d79b50e53fbf783453eac10cf848ed41801a87ca9cab1f655bd13483739bce17e65ea7f ./tests/Memory_safety_-_Remote_control_receiver.test 119cd2cc58805c4d9ecdb06031843ab37e48591fe21abdb35dfbd7e838ac32d23092ba5906eb1bf51e48ecc5d1d438b25420d6205d2cc41ed94509eea519cc84 ./tests/Memory_safety_-_Remote_control_sender.test 26bed8f544598799d8545e0b74d7a7ce9f810453149dc3db95f09e39bf498bb551da476b212102fbb4fee3fae26dbd9627a3be39835678c41be9949fdd1aefa8 ./tests/Memory_safety_-_Watchfd.test efd90569c3dd62bf5f9f4ff7c5b45b753226be1f2c59dcde529d94af90fda414246f3ee103ef0cfb8577b7404ee2a6051bf1f25456fa3d8aec92f01dc622ba24 ./tests/Modifiers_-_--direct-io.test 9ce54bd3cb369089b27ccbf227629f1325b738a0c860060e3fa4106118fea6fa0af27b3d189f06c82d0d3350a80e811331835f9e43d0306477f06b45040df22b ./tests/Modifiers_-_--force.test 1af8f3de7e59babc8c911aa5afc792f345db82c8a76896a33d89361999d79ba24e0e5aca32ef42da4a205425509940e8d2a777332b058d316107b0b4d7389ec7 ./tests/Modifiers_-_--interval.test d7cfa94d87d7cfb6be67f21640fd7c88e8849b3c0332854c7208168c56688d2e39ddf761f6d9f86c0b322a7e5c395de935c2b52453a570d1b01d023ff3dbbba4 ./tests/Modifiers_-_--line-mode.test a3d4e201be3e7a66112a0d8222268b0a4a95f4d609257161cd4c7fe5ec9a5085e09d81132389f29da70baf4f319e3a81963cde243811c824916e290e34c64229 ./tests/Modifiers_-_--size_from_file_size.test d92c63e8132b73f8cd04503d7a87e2448f60a29c410297029f828c28bf2fdbfa4e186db77f2794021267c7070f7b4164427df8c27f7372c191722b22b1668002 ./tests/Modifiers_-_--size.test 2de339d3f20834ccbb6ea27dcb626a1cffd6ca36efa97b34141e84520fb40669d2c22fcb474349b7b730b8573bad3a6792da39ff765f5c5061a108aef5b78695 ./tests/Modifiers_-_--sync.test e9e3d18f1e9f0c9a65f8c127cb0a3de58cca6e10f544317fef2c3ced8836d4275a6dcaa4bb6b1f905b2f35107afe0b192d0734a3e3ac7ad0467e919b9070d0e8 ./tests/run-valgrind.sh 1994582ec03c6f83717a3ddc18bc45ce4584e2da0c2193e6f99f7fef38628ae8c6c241699992eb7c4cb376ead51b4a51a1b931d213c1d29d102a765fbb58737f ./tests/Terminal_-_Detect_width.test 9dac25a9f41122712990580913538dce6f1f8c73d87e896549af6d31b6ffa72b742505770e74e662bfb8f68b9f7d6235bb213282666a889b305d0faca4b3128b ./tests/test-env.sh fa1fa37fb54b805ca8a0a33d73eb576518383ee4cc332e98235ca90e2d197c5e34647cef593566c9a2ed78d33d1287f7427a6dc6d7e35e76a731ba69f5260cd9 ./tests/Transfer_-_--rate-limit.test c4bdd931ad578e9e69f780511124a00d1564ed0e621d07264e4f502021a8af8df91a283d4cdfdcbb4aa97c57657e3225571830bd5f23ecafa68653582c966be0 ./tests/Transfer_-_--remote.test 3cf5d553814d24a3727c1962829702a9dd7d822e46ace6895916304a6fa2bffd58ac888f4d4e3f9043717e988f006398e28347c8e327ec169043e1da8ef57ebe ./tests/Transfer_-_--stop-at-size.test 9ed791ec136e4473704dc44df3e489ee36b70f88bafdef90511fc62f7cc6b8783fcfaef99fdbb052b17929283d33623fb3157460f8f376a95e58d8f2b684eb92 ./tests/Watchfd_-_Multiple_descriptors.test 401e2187dc79b66c87cc8d959183d68fae06b4459d0a99c6b94bb113ea4a4c1bdc7d9653456a63473e0c78b5a52e96efdb291e98fffdcc68abf0c2c735d91324 ./tests/Watchfd_-_Single_descriptor.test -----BEGIN PGP SIGNATURE----- iQHLBAEBCgA1FiEEQme0+Q8meKESFpvWHR73WBtF6aAFAmeZWzYXHGFuZHJldy53 b29kQGl2YXJjaC5jb20ACgkQHR73WBtF6aBhBAwAs0r1ayyeW5otIKXJ5M/T7O69 25f/bYrVSSAjydqcIN5edORVGpNRQAIsd/ushdNvqbBX+EsSEqrAAcvdrrVHUEeM WJXs7SxgWVQyhIRriL15VeRIov037Qtr9AP/4l6zl5IyIcnCpZpc6XsfhX9/huA3 4SYxUJWFsegh/83Y9PaqwvPUJTEfA1yDU/LQt5IBePb7hXF48KUNlelkB5MK9nXB UDH1fObWL2hmdGbwnZCdCC9l8BLz4aJUAlla7FLmEw8mpLupBxbvh2K+M/50fHTZ ICZ31mtAlN4hqKaPsGJyOvknCOeCzJy5SB10NMfUNv/gj1TWF0M/95v1a0G52N4i 24DS7enTepc+esi0D6/Glz1IR++ukjwFPuVj4JrujApB8gSlaNq2G2skYE2fqRhn Ycoe9KDDBWhkvpb/CZ2sFS2DW7wCu2fN4bhhlx+JnvksFuE/VQW1gSsfuyR2kXqp phBk6m8vLQzj2w1OXqefKJjvh2XZAXx8eivTMERk =FKDe -----END PGP SIGNATURE----- pv-1.9.31/Makefile.am000066400000000000000000000113141474702661500143020ustar00rootroot00000000000000## Process this file with automake to produce Makefile.in AUTOMAKE_OPTIONS = subdir-objects SUBDIRS = po bin_PROGRAMS = pv dist_doc_DATA = README.md docs/INSTALL docs/COPYING docs/NEWS.md docs/ACKNOWLEDGEMENTS.md docs/DEVELOPERS.md dist_man1_MANS = docs/pv.1 EXTRA_DIST = docs/pv.1.md docs/benchmark.sh docs/test-on-vm-lab.sh docs/build-package.sh docs/release.sh pv_SOURCES = \ src/main/debug.c \ src/main/help.c \ src/main/main.c \ src/main/options.c \ src/main/remote.c \ src/main/version.c \ src/pv/calc.c \ src/pv/cursor.c \ src/pv/display.c \ src/pv/elapsedtime.c \ src/pv/file.c \ src/pv/format/averagerate.c \ src/pv/format/barstyle.c \ src/pv/format/bufferpercent.c \ src/pv/format/bytes.c \ src/pv/format/eta.c \ src/pv/format/fineta.c \ src/pv/format/lastwritten.c \ src/pv/format/name.c \ src/pv/format/previousline.c \ src/pv/format/progressbar.c \ src/pv/format/rate.c \ src/pv/format/sgr.c \ src/pv/format/timer.c \ src/pv/loop.c \ src/pv/number.c \ src/pv/proctitle.c \ src/pv/signal.c \ src/pv/state.c \ src/pv/string.c \ src/pv/transfer.c \ src/pv/watchpid.c \ src/include/config-aux.h \ src/include/options.h \ src/include/pv-internal.h \ src/include/pv.h ## Allow tests to write diagnostic info to fd 9 to reach the original ## stderr even when the test driver is sending test output to a file. AM_TESTS_FD_REDIRECT = 9>&2 AM_TESTS_ENVIRONMENT = \ . $(srcdir)/tests/test-env.sh \ ; TESTS = \ tests/Bug_-_Display_length_at_magnitude_boundary_-_Bytes.test \ tests/Bug_-_Display_length_at_magnitude_boundary_-_Rate.test \ tests/Bug_-_Install_all_files.test \ tests/Display_-_--average-rate.test \ tests/Display_-_--bits.test \ tests/Display_-_--buffer-percent.test \ tests/Display_-_--bytes.test \ tests/Display_-_--eta_-_plausible_values.test \ tests/Display_-_--fineta_-_plausible_values.test \ tests/Display_-_--last-written.test \ tests/Display_-_--numeric_--bytes_--line-mode.test \ tests/Display_-_--numeric_--bytes.test \ tests/Display_-_--numeric.test \ tests/Display_-_--numeric_--timer.test \ tests/Display_-_--progress_-_basic_movement.test \ tests/Display_-_--progress_-_increasing.test \ tests/Display_-_--quiet.test \ tests/Display_-_--rate_-_displayed_value_changes.test \ tests/Display_-_--timer_-_displayed_value_changes.test \ tests/General_-_--pidfile.test \ tests/General_-_--size_argument_handling.test \ tests/Integrity_-_Basic.test \ tests/Integrity_-_Binary_data.test \ tests/Integrity_-_From_bursty_source.test \ tests/Integrity_-_Large_file_support.test \ tests/Integrity_-_On_output_pipe_close.test \ tests/Integrity_-_When_adjusted_remotely.test \ tests/Memory_safety_-_Basic.test \ tests/Memory_safety_-_Process_title.test \ tests/Memory_safety_-_Remote_control_receiver.test \ tests/Memory_safety_-_Remote_control_sender.test \ tests/Memory_safety_-_Watchfd.test \ tests/Modifiers_-_--direct-io.test \ tests/Modifiers_-_--force.test \ tests/Modifiers_-_--interval.test \ tests/Modifiers_-_--line-mode.test \ tests/Modifiers_-_--size_from_file_size.test \ tests/Modifiers_-_--size.test \ tests/Modifiers_-_--sync.test \ tests/Terminal_-_Detect_width.test \ tests/Transfer_-_--rate-limit.test \ tests/Transfer_-_--remote.test \ tests/Transfer_-_--stop-at-size.test \ tests/Watchfd_-_Multiple_descriptors.test \ tests/Watchfd_-_Single_descriptor.test EXTRA_DIST += $(TESTS) tests/run-valgrind.sh tests/test-env.sh docs/pv.1.md: $(srcdir)/docs/pv.1 test -d docs || mkdir docs pandoc --from man --to markdown < $< | sed '/\*\*\*\*/{s/\*//g;s/^/**/;s/$$/**/}' | sed '/^```/,/^```/d' | sed 's/^\\\[/[/' > $@ SUFFIXES = .c .o .e .c.e: -splint -badflag +posixlib $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) -DSPLINT=1 $< > $@ 2>&1 -flawfinder $< >> $@ 2>&1 indent: cd $(srcdir) && indent -npro -kr -i8 -cd42 -c45 -l120 src/*/*.c src/*/*/*.c indentclean: rm -f $(srcdir)/src/*/*.c~ $(srcdir)/src/*/*/*.c~ analyse: $(pv_SOURCES:.c=.e) FORCE grep -E -e '^Finished checking --' -e 'Hits = ' $+ 2>/dev/null || true FORCE: clean-local: rm -f src/*/*.e src/*/*/*.e # Convenience alias for "make check": "make test" test: check # Generate a package manifest if MAINTAINER is set. dist-hook: if test -n "$(MAINTAINER)"; then \ cd "$(top_distdir)" \ && { printf "%s\n\n" "Check file integrity with 'sha512sum -c MANIFEST && echo OK'."; \ find -type f -not -name MANIFEST -exec sha512sum '{}' ';' | sort -k 2; } \ | gpg -u "$(MAINTAINER)" --clearsign > MANIFEST; \ else true; fi # "release" target - requires MAINTAINER variable to select GPG key. release: distcheck gpg --list-secret-keys 2>&1 | grep -F 'uid' | grep -Fq "$(MAINTAINER)" gpg -u "$(MAINTAINER)" -ab $(distdir).tar.gz cp -f $(distdir).tar.gz.asc $(distdir).tar.gz.txt chmod 644 $(distdir).tar.gz $(distdir).tar.gz.asc $(distdir).tar.gz.txt pv-1.9.31/Makefile.in000066400000000000000000001722221474702661500143210ustar00rootroot00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = pv$(EXEEXT) subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ $(am__configure_deps) $(dist_doc_DATA) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" \ "$(DESTDIR)$(docdir)" PROGRAMS = $(bin_PROGRAMS) am__dirstamp = $(am__leading_dot)dirstamp am_pv_OBJECTS = src/main/debug.$(OBJEXT) src/main/help.$(OBJEXT) \ src/main/main.$(OBJEXT) src/main/options.$(OBJEXT) \ src/main/remote.$(OBJEXT) src/main/version.$(OBJEXT) \ src/pv/calc.$(OBJEXT) src/pv/cursor.$(OBJEXT) \ src/pv/display.$(OBJEXT) src/pv/elapsedtime.$(OBJEXT) \ src/pv/file.$(OBJEXT) src/pv/format/averagerate.$(OBJEXT) \ src/pv/format/barstyle.$(OBJEXT) \ src/pv/format/bufferpercent.$(OBJEXT) \ src/pv/format/bytes.$(OBJEXT) src/pv/format/eta.$(OBJEXT) \ src/pv/format/fineta.$(OBJEXT) \ src/pv/format/lastwritten.$(OBJEXT) \ src/pv/format/name.$(OBJEXT) \ src/pv/format/previousline.$(OBJEXT) \ src/pv/format/progressbar.$(OBJEXT) \ src/pv/format/rate.$(OBJEXT) src/pv/format/sgr.$(OBJEXT) \ src/pv/format/timer.$(OBJEXT) src/pv/loop.$(OBJEXT) \ src/pv/number.$(OBJEXT) src/pv/proctitle.$(OBJEXT) \ src/pv/signal.$(OBJEXT) src/pv/state.$(OBJEXT) \ src/pv/string.$(OBJEXT) src/pv/transfer.$(OBJEXT) \ src/pv/watchpid.$(OBJEXT) pv_OBJECTS = $(am_pv_OBJECTS) pv_LDADD = $(LDADD) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = src/main/$(DEPDIR)/debug.Po \ src/main/$(DEPDIR)/help.Po src/main/$(DEPDIR)/main.Po \ src/main/$(DEPDIR)/options.Po src/main/$(DEPDIR)/remote.Po \ src/main/$(DEPDIR)/version.Po src/pv/$(DEPDIR)/calc.Po \ src/pv/$(DEPDIR)/cursor.Po src/pv/$(DEPDIR)/display.Po \ src/pv/$(DEPDIR)/elapsedtime.Po src/pv/$(DEPDIR)/file.Po \ src/pv/$(DEPDIR)/loop.Po src/pv/$(DEPDIR)/number.Po \ src/pv/$(DEPDIR)/proctitle.Po src/pv/$(DEPDIR)/signal.Po \ src/pv/$(DEPDIR)/state.Po src/pv/$(DEPDIR)/string.Po \ src/pv/$(DEPDIR)/transfer.Po src/pv/$(DEPDIR)/watchpid.Po \ src/pv/format/$(DEPDIR)/averagerate.Po \ src/pv/format/$(DEPDIR)/barstyle.Po \ src/pv/format/$(DEPDIR)/bufferpercent.Po \ src/pv/format/$(DEPDIR)/bytes.Po \ src/pv/format/$(DEPDIR)/eta.Po \ src/pv/format/$(DEPDIR)/fineta.Po \ src/pv/format/$(DEPDIR)/lastwritten.Po \ src/pv/format/$(DEPDIR)/name.Po \ src/pv/format/$(DEPDIR)/previousline.Po \ src/pv/format/$(DEPDIR)/progressbar.Po \ src/pv/format/$(DEPDIR)/rate.Po src/pv/format/$(DEPDIR)/sgr.Po \ src/pv/format/$(DEPDIR)/timer.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(pv_SOURCES) DIST_SOURCES = $(pv_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 NROFF = nroff MANS = $(dist_man1_MANS) DATA = $(dist_doc_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope check recheck distdir distdir-am dist dist-all \ distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' RECHECK_LOGS = $(TEST_LOGS) TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(dist_man1_MANS) $(srcdir)/Makefile.in \ $(top_srcdir)/build-aux/compile \ $(top_srcdir)/build-aux/config.guess \ $(top_srcdir)/build-aux/config.rpath \ $(top_srcdir)/build-aux/config.sub \ $(top_srcdir)/build-aux/depcomp \ $(top_srcdir)/build-aux/install-sh \ $(top_srcdir)/build-aux/missing \ $(top_srcdir)/build-aux/test-driver \ $(top_srcdir)/src/include/config.h.in ABOUT-NLS README.md \ build-aux/ar-lib build-aux/compile build-aux/config.guess \ build-aux/config.rpath build-aux/config.sub build-aux/depcomp \ build-aux/install-sh build-aux/missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip # Exists only to be overridden by the user if desired. AM_DISTCHECK_DVI_TARGET = dvi distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ 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@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGMERGE = @MSGMERGE@ MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@ OBJEXT = @OBJEXT@ 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@ POSUB = @POSUB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = subdir-objects SUBDIRS = po dist_doc_DATA = README.md docs/INSTALL docs/COPYING docs/NEWS.md docs/ACKNOWLEDGEMENTS.md docs/DEVELOPERS.md dist_man1_MANS = docs/pv.1 EXTRA_DIST = docs/pv.1.md docs/benchmark.sh docs/test-on-vm-lab.sh \ docs/build-package.sh docs/release.sh $(TESTS) \ tests/run-valgrind.sh tests/test-env.sh pv_SOURCES = \ src/main/debug.c \ src/main/help.c \ src/main/main.c \ src/main/options.c \ src/main/remote.c \ src/main/version.c \ src/pv/calc.c \ src/pv/cursor.c \ src/pv/display.c \ src/pv/elapsedtime.c \ src/pv/file.c \ src/pv/format/averagerate.c \ src/pv/format/barstyle.c \ src/pv/format/bufferpercent.c \ src/pv/format/bytes.c \ src/pv/format/eta.c \ src/pv/format/fineta.c \ src/pv/format/lastwritten.c \ src/pv/format/name.c \ src/pv/format/previousline.c \ src/pv/format/progressbar.c \ src/pv/format/rate.c \ src/pv/format/sgr.c \ src/pv/format/timer.c \ src/pv/loop.c \ src/pv/number.c \ src/pv/proctitle.c \ src/pv/signal.c \ src/pv/state.c \ src/pv/string.c \ src/pv/transfer.c \ src/pv/watchpid.c \ src/include/config-aux.h \ src/include/options.h \ src/include/pv-internal.h \ src/include/pv.h AM_TESTS_FD_REDIRECT = 9>&2 AM_TESTS_ENVIRONMENT = \ . $(srcdir)/tests/test-env.sh \ ; TESTS = \ tests/Bug_-_Display_length_at_magnitude_boundary_-_Bytes.test \ tests/Bug_-_Display_length_at_magnitude_boundary_-_Rate.test \ tests/Bug_-_Install_all_files.test \ tests/Display_-_--average-rate.test \ tests/Display_-_--bits.test \ tests/Display_-_--buffer-percent.test \ tests/Display_-_--bytes.test \ tests/Display_-_--eta_-_plausible_values.test \ tests/Display_-_--fineta_-_plausible_values.test \ tests/Display_-_--last-written.test \ tests/Display_-_--numeric_--bytes_--line-mode.test \ tests/Display_-_--numeric_--bytes.test \ tests/Display_-_--numeric.test \ tests/Display_-_--numeric_--timer.test \ tests/Display_-_--progress_-_basic_movement.test \ tests/Display_-_--progress_-_increasing.test \ tests/Display_-_--quiet.test \ tests/Display_-_--rate_-_displayed_value_changes.test \ tests/Display_-_--timer_-_displayed_value_changes.test \ tests/General_-_--pidfile.test \ tests/General_-_--size_argument_handling.test \ tests/Integrity_-_Basic.test \ tests/Integrity_-_Binary_data.test \ tests/Integrity_-_From_bursty_source.test \ tests/Integrity_-_Large_file_support.test \ tests/Integrity_-_On_output_pipe_close.test \ tests/Integrity_-_When_adjusted_remotely.test \ tests/Memory_safety_-_Basic.test \ tests/Memory_safety_-_Process_title.test \ tests/Memory_safety_-_Remote_control_receiver.test \ tests/Memory_safety_-_Remote_control_sender.test \ tests/Memory_safety_-_Watchfd.test \ tests/Modifiers_-_--direct-io.test \ tests/Modifiers_-_--force.test \ tests/Modifiers_-_--interval.test \ tests/Modifiers_-_--line-mode.test \ tests/Modifiers_-_--size_from_file_size.test \ tests/Modifiers_-_--size.test \ tests/Modifiers_-_--sync.test \ tests/Terminal_-_Detect_width.test \ tests/Transfer_-_--rate-limit.test \ tests/Transfer_-_--remote.test \ tests/Transfer_-_--stop-at-size.test \ tests/Watchfd_-_Multiple_descriptors.test \ tests/Watchfd_-_Single_descriptor.test SUFFIXES = .c .o .e all: all-recursive .SUFFIXES: .SUFFIXES: .c .o .e .log .obj .test .test$(EXEEXT) .trs am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): src/include/config.h: src/include/stamp-h1 @test -f $@ || rm -f src/include/stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) src/include/stamp-h1 src/include/stamp-h1: $(top_srcdir)/src/include/config.h.in $(top_builddir)/config.status @rm -f src/include/stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status src/include/config.h $(top_srcdir)/src/include/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f src/include/stamp-h1 touch $@ distclean-hdr: -rm -f src/include/config.h src/include/stamp-h1 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 \ ; 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) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(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: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) src/main/$(am__dirstamp): @$(MKDIR_P) src/main @: > src/main/$(am__dirstamp) src/main/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) src/main/$(DEPDIR) @: > src/main/$(DEPDIR)/$(am__dirstamp) src/main/debug.$(OBJEXT): src/main/$(am__dirstamp) \ src/main/$(DEPDIR)/$(am__dirstamp) src/main/help.$(OBJEXT): src/main/$(am__dirstamp) \ src/main/$(DEPDIR)/$(am__dirstamp) src/main/main.$(OBJEXT): src/main/$(am__dirstamp) \ src/main/$(DEPDIR)/$(am__dirstamp) src/main/options.$(OBJEXT): src/main/$(am__dirstamp) \ src/main/$(DEPDIR)/$(am__dirstamp) src/main/remote.$(OBJEXT): src/main/$(am__dirstamp) \ src/main/$(DEPDIR)/$(am__dirstamp) src/main/version.$(OBJEXT): src/main/$(am__dirstamp) \ src/main/$(DEPDIR)/$(am__dirstamp) src/pv/$(am__dirstamp): @$(MKDIR_P) src/pv @: > src/pv/$(am__dirstamp) src/pv/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) src/pv/$(DEPDIR) @: > src/pv/$(DEPDIR)/$(am__dirstamp) src/pv/calc.$(OBJEXT): src/pv/$(am__dirstamp) \ src/pv/$(DEPDIR)/$(am__dirstamp) src/pv/cursor.$(OBJEXT): src/pv/$(am__dirstamp) \ src/pv/$(DEPDIR)/$(am__dirstamp) src/pv/display.$(OBJEXT): src/pv/$(am__dirstamp) \ src/pv/$(DEPDIR)/$(am__dirstamp) src/pv/elapsedtime.$(OBJEXT): src/pv/$(am__dirstamp) \ src/pv/$(DEPDIR)/$(am__dirstamp) src/pv/file.$(OBJEXT): src/pv/$(am__dirstamp) \ src/pv/$(DEPDIR)/$(am__dirstamp) src/pv/format/$(am__dirstamp): @$(MKDIR_P) src/pv/format @: > src/pv/format/$(am__dirstamp) src/pv/format/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) src/pv/format/$(DEPDIR) @: > src/pv/format/$(DEPDIR)/$(am__dirstamp) src/pv/format/averagerate.$(OBJEXT): src/pv/format/$(am__dirstamp) \ src/pv/format/$(DEPDIR)/$(am__dirstamp) src/pv/format/barstyle.$(OBJEXT): src/pv/format/$(am__dirstamp) \ src/pv/format/$(DEPDIR)/$(am__dirstamp) src/pv/format/bufferpercent.$(OBJEXT): src/pv/format/$(am__dirstamp) \ src/pv/format/$(DEPDIR)/$(am__dirstamp) src/pv/format/bytes.$(OBJEXT): src/pv/format/$(am__dirstamp) \ src/pv/format/$(DEPDIR)/$(am__dirstamp) src/pv/format/eta.$(OBJEXT): src/pv/format/$(am__dirstamp) \ src/pv/format/$(DEPDIR)/$(am__dirstamp) src/pv/format/fineta.$(OBJEXT): src/pv/format/$(am__dirstamp) \ src/pv/format/$(DEPDIR)/$(am__dirstamp) src/pv/format/lastwritten.$(OBJEXT): src/pv/format/$(am__dirstamp) \ src/pv/format/$(DEPDIR)/$(am__dirstamp) src/pv/format/name.$(OBJEXT): src/pv/format/$(am__dirstamp) \ src/pv/format/$(DEPDIR)/$(am__dirstamp) src/pv/format/previousline.$(OBJEXT): src/pv/format/$(am__dirstamp) \ src/pv/format/$(DEPDIR)/$(am__dirstamp) src/pv/format/progressbar.$(OBJEXT): src/pv/format/$(am__dirstamp) \ src/pv/format/$(DEPDIR)/$(am__dirstamp) src/pv/format/rate.$(OBJEXT): src/pv/format/$(am__dirstamp) \ src/pv/format/$(DEPDIR)/$(am__dirstamp) src/pv/format/sgr.$(OBJEXT): src/pv/format/$(am__dirstamp) \ src/pv/format/$(DEPDIR)/$(am__dirstamp) src/pv/format/timer.$(OBJEXT): src/pv/format/$(am__dirstamp) \ src/pv/format/$(DEPDIR)/$(am__dirstamp) src/pv/loop.$(OBJEXT): src/pv/$(am__dirstamp) \ src/pv/$(DEPDIR)/$(am__dirstamp) src/pv/number.$(OBJEXT): src/pv/$(am__dirstamp) \ src/pv/$(DEPDIR)/$(am__dirstamp) src/pv/proctitle.$(OBJEXT): src/pv/$(am__dirstamp) \ src/pv/$(DEPDIR)/$(am__dirstamp) src/pv/signal.$(OBJEXT): src/pv/$(am__dirstamp) \ src/pv/$(DEPDIR)/$(am__dirstamp) src/pv/state.$(OBJEXT): src/pv/$(am__dirstamp) \ src/pv/$(DEPDIR)/$(am__dirstamp) src/pv/string.$(OBJEXT): src/pv/$(am__dirstamp) \ src/pv/$(DEPDIR)/$(am__dirstamp) src/pv/transfer.$(OBJEXT): src/pv/$(am__dirstamp) \ src/pv/$(DEPDIR)/$(am__dirstamp) src/pv/watchpid.$(OBJEXT): src/pv/$(am__dirstamp) \ src/pv/$(DEPDIR)/$(am__dirstamp) pv$(EXEEXT): $(pv_OBJECTS) $(pv_DEPENDENCIES) $(EXTRA_pv_DEPENDENCIES) @rm -f pv$(EXEEXT) $(AM_V_CCLD)$(LINK) $(pv_OBJECTS) $(pv_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f src/main/*.$(OBJEXT) -rm -f src/pv/*.$(OBJEXT) -rm -f src/pv/format/*.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@src/main/$(DEPDIR)/debug.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/main/$(DEPDIR)/help.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/main/$(DEPDIR)/main.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/main/$(DEPDIR)/options.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/main/$(DEPDIR)/remote.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/main/$(DEPDIR)/version.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/pv/$(DEPDIR)/calc.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/pv/$(DEPDIR)/cursor.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/pv/$(DEPDIR)/display.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/pv/$(DEPDIR)/elapsedtime.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/pv/$(DEPDIR)/file.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/pv/$(DEPDIR)/loop.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/pv/$(DEPDIR)/number.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/pv/$(DEPDIR)/proctitle.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/pv/$(DEPDIR)/signal.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/pv/$(DEPDIR)/state.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/pv/$(DEPDIR)/string.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/pv/$(DEPDIR)/transfer.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/pv/$(DEPDIR)/watchpid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/pv/format/$(DEPDIR)/averagerate.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/pv/format/$(DEPDIR)/barstyle.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/pv/format/$(DEPDIR)/bufferpercent.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/pv/format/$(DEPDIR)/bytes.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/pv/format/$(DEPDIR)/eta.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/pv/format/$(DEPDIR)/fineta.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/pv/format/$(DEPDIR)/lastwritten.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/pv/format/$(DEPDIR)/name.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/pv/format/$(DEPDIR)/previousline.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/pv/format/$(DEPDIR)/progressbar.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/pv/format/$(DEPDIR)/rate.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/pv/format/$(DEPDIR)/sgr.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@src/pv/format/$(DEPDIR)/timer.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` install-man1: $(dist_man1_MANS) @$(NORMAL_INSTALL) @list1='$(dist_man1_MANS)'; \ list2=''; \ 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='$(dist_man1_MANS)'; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ } | 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-dist_docDATA: $(dist_doc_DATA) @$(NORMAL_INSTALL) @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(docdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(docdir)" || 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)$(docdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \ done uninstall-dist_docDATA: @$(NORMAL_UNINSTALL) @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(docdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ elif test -n "$$redo_logs"; then \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ if test -n "$(PACKAGE_BUGREPORT)"; then \ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ trs_list=`for i in $$bases; do echo $$i.trs; done`; \ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? .test.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-zstd: distdir tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ *.tar.zst*) \ zstd -dc $(distdir).tar.zst | $(am__untar) ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build/sub \ && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-recursive all-am: Makefile $(PROGRAMS) $(MANS) $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(docdir)"; 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: -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f src/main/$(DEPDIR)/$(am__dirstamp) -rm -f src/main/$(am__dirstamp) -rm -f src/pv/$(DEPDIR)/$(am__dirstamp) -rm -f src/pv/$(am__dirstamp) -rm -f src/pv/format/$(DEPDIR)/$(am__dirstamp) -rm -f src/pv/format/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-binPROGRAMS clean-generic clean-local mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f src/main/$(DEPDIR)/debug.Po -rm -f src/main/$(DEPDIR)/help.Po -rm -f src/main/$(DEPDIR)/main.Po -rm -f src/main/$(DEPDIR)/options.Po -rm -f src/main/$(DEPDIR)/remote.Po -rm -f src/main/$(DEPDIR)/version.Po -rm -f src/pv/$(DEPDIR)/calc.Po -rm -f src/pv/$(DEPDIR)/cursor.Po -rm -f src/pv/$(DEPDIR)/display.Po -rm -f src/pv/$(DEPDIR)/elapsedtime.Po -rm -f src/pv/$(DEPDIR)/file.Po -rm -f src/pv/$(DEPDIR)/loop.Po -rm -f src/pv/$(DEPDIR)/number.Po -rm -f src/pv/$(DEPDIR)/proctitle.Po -rm -f src/pv/$(DEPDIR)/signal.Po -rm -f src/pv/$(DEPDIR)/state.Po -rm -f src/pv/$(DEPDIR)/string.Po -rm -f src/pv/$(DEPDIR)/transfer.Po -rm -f src/pv/$(DEPDIR)/watchpid.Po -rm -f src/pv/format/$(DEPDIR)/averagerate.Po -rm -f src/pv/format/$(DEPDIR)/barstyle.Po -rm -f src/pv/format/$(DEPDIR)/bufferpercent.Po -rm -f src/pv/format/$(DEPDIR)/bytes.Po -rm -f src/pv/format/$(DEPDIR)/eta.Po -rm -f src/pv/format/$(DEPDIR)/fineta.Po -rm -f src/pv/format/$(DEPDIR)/lastwritten.Po -rm -f src/pv/format/$(DEPDIR)/name.Po -rm -f src/pv/format/$(DEPDIR)/previousline.Po -rm -f src/pv/format/$(DEPDIR)/progressbar.Po -rm -f src/pv/format/$(DEPDIR)/rate.Po -rm -f src/pv/format/$(DEPDIR)/sgr.Po -rm -f src/pv/format/$(DEPDIR)/timer.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dist_docDATA install-man install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-man1 install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f src/main/$(DEPDIR)/debug.Po -rm -f src/main/$(DEPDIR)/help.Po -rm -f src/main/$(DEPDIR)/main.Po -rm -f src/main/$(DEPDIR)/options.Po -rm -f src/main/$(DEPDIR)/remote.Po -rm -f src/main/$(DEPDIR)/version.Po -rm -f src/pv/$(DEPDIR)/calc.Po -rm -f src/pv/$(DEPDIR)/cursor.Po -rm -f src/pv/$(DEPDIR)/display.Po -rm -f src/pv/$(DEPDIR)/elapsedtime.Po -rm -f src/pv/$(DEPDIR)/file.Po -rm -f src/pv/$(DEPDIR)/loop.Po -rm -f src/pv/$(DEPDIR)/number.Po -rm -f src/pv/$(DEPDIR)/proctitle.Po -rm -f src/pv/$(DEPDIR)/signal.Po -rm -f src/pv/$(DEPDIR)/state.Po -rm -f src/pv/$(DEPDIR)/string.Po -rm -f src/pv/$(DEPDIR)/transfer.Po -rm -f src/pv/$(DEPDIR)/watchpid.Po -rm -f src/pv/format/$(DEPDIR)/averagerate.Po -rm -f src/pv/format/$(DEPDIR)/barstyle.Po -rm -f src/pv/format/$(DEPDIR)/bufferpercent.Po -rm -f src/pv/format/$(DEPDIR)/bytes.Po -rm -f src/pv/format/$(DEPDIR)/eta.Po -rm -f src/pv/format/$(DEPDIR)/fineta.Po -rm -f src/pv/format/$(DEPDIR)/lastwritten.Po -rm -f src/pv/format/$(DEPDIR)/name.Po -rm -f src/pv/format/$(DEPDIR)/previousline.Po -rm -f src/pv/format/$(DEPDIR)/progressbar.Po -rm -f src/pv/format/$(DEPDIR)/rate.Po -rm -f src/pv/format/$(DEPDIR)/sgr.Po -rm -f src/pv/format/$(DEPDIR)/timer.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-dist_docDATA \ uninstall-man uninstall-man: uninstall-man1 .MAKE: $(am__recursive_targets) check-am install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--depfiles am--refresh check check-TESTS check-am clean \ clean-binPROGRAMS clean-cscope clean-generic clean-local \ cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ dist-gzip dist-hook dist-lzip dist-shar dist-tarZ dist-xz \ dist-zip dist-zstd distcheck distclean distclean-compile \ distclean-generic distclean-hdr distclean-tags distcleancheck \ distdir distuninstallcheck dvi dvi-am html html-am info \ info-am install install-am install-binPROGRAMS install-data \ install-data-am install-dist_docDATA 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-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am recheck tags tags-am \ uninstall uninstall-am uninstall-binPROGRAMS \ uninstall-dist_docDATA uninstall-man uninstall-man1 .PRECIOUS: Makefile docs/pv.1.md: $(srcdir)/docs/pv.1 test -d docs || mkdir docs pandoc --from man --to markdown < $< | sed '/\*\*\*\*/{s/\*//g;s/^/**/;s/$$/**/}' | sed '/^```/,/^```/d' | sed 's/^\\\[/[/' > $@ .c.e: -splint -badflag +posixlib $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) -DSPLINT=1 $< > $@ 2>&1 -flawfinder $< >> $@ 2>&1 indent: cd $(srcdir) && indent -npro -kr -i8 -cd42 -c45 -l120 src/*/*.c src/*/*/*.c indentclean: rm -f $(srcdir)/src/*/*.c~ $(srcdir)/src/*/*/*.c~ analyse: $(pv_SOURCES:.c=.e) FORCE grep -E -e '^Finished checking --' -e 'Hits = ' $+ 2>/dev/null || true FORCE: clean-local: rm -f src/*/*.e src/*/*/*.e # Convenience alias for "make check": "make test" test: check # Generate a package manifest if MAINTAINER is set. dist-hook: if test -n "$(MAINTAINER)"; then \ cd "$(top_distdir)" \ && { printf "%s\n\n" "Check file integrity with 'sha512sum -c MANIFEST && echo OK'."; \ find -type f -not -name MANIFEST -exec sha512sum '{}' ';' | sort -k 2; } \ | gpg -u "$(MAINTAINER)" --clearsign > MANIFEST; \ else true; fi # "release" target - requires MAINTAINER variable to select GPG key. release: distcheck gpg --list-secret-keys 2>&1 | grep -F 'uid' | grep -Fq "$(MAINTAINER)" gpg -u "$(MAINTAINER)" -ab $(distdir).tar.gz cp -f $(distdir).tar.gz.asc $(distdir).tar.gz.txt chmod 644 $(distdir).tar.gz $(distdir).tar.gz.asc $(distdir).tar.gz.txt # 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: pv-1.9.31/README.md000066400000000000000000000057151474702661500135350ustar00rootroot00000000000000# Introduction This is the README for **pv** ("Pipe Viewer"), a terminal-based tool for monitoring the progress of data through a pipeline. It can be inserted into any normal pipeline between two processes to give a visual indication of how quickly data is passing through, how long it has taken, how near to completion it is, and an estimate of how long it will be until completion. # Documentation A manual page is included in this distribution ("`man pv`"). Before installation, it is in "[docs/pv.1](./docs/pv.1.md)". Changes are listed in "[docs/NEWS.md](./docs/NEWS.md)". Developers and translators, please see "[docs/DEVELOPERS.md](./docs/DEVELOPERS.md)". Translators can use the Weblate instance hosted by Codeberg: [https://translate.codeberg.org/engage/pv/](https://translate.codeberg.org/engage/pv/) [![Translation status](https://translate.codeberg.org/widget/pv/multi-auto.svg)](https://translate.codeberg.org/engage/pv/) If you don't see your language listed, raise an issue on the issue tracker (or just email the maintainer) asking for it to be added. # Installation See "[docs/INSTALL](./docs/INSTALL)" for more about the _configure_ script. The typical process for a system-wide install is: sh ./configure --prefix=/usr make sudo make install This requires the build toolchain ("`sudo apt install build-essential`" on Debian or Ubuntu systems). If this is not a packaged release, the _configure_ script is not included. It is generated with the GNU build system tools (_autoconf_, _aclocal_, _autopoint_, _automake_); _gettext_ is also needed. On Debian or Ubuntu, run "`sudo apt install automake autopoint gettext`". Once those tools are in place, call "`autoreconf -is`" to generate the _configure_ script, and run it as described above. # Copyright, bug reporting, and acknowledgements See "[docs/ACKNOWLEDGEMENTS.md](./docs/ACKNOWLEDGEMENTS.md)" for a list of contributors. Copyright (C) 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2025 Andrew Wood. License GPLv3+: GNU GPL version 3 or later . 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, version 3, in "[docs/COPYING](./docs/COPYING)". If not, see . Please report any bugs to **pv@ivarch.com**, or use the issue tracker linked from the **pv** home page. The **pv** home page is at: > [https://www.ivarch.com/programs/pv.shtml](https://www.ivarch.com/programs/pv.shtml) The latest version can always be found here. --- pv-1.9.31/aclocal.m4000066400000000000000000005070631474702661500141210ustar00rootroot00000000000000# generated automatically by aclocal 1.16.5 -*- Autoconf -*- # Copyright (C) 1996-2021 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],, [m4_warning([this file was generated for autoconf 2.71. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # gettext.m4 serial 71 (gettext-0.20.2) dnl Copyright (C) 1995-2014, 2016, 2018-2020 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 be used in projects which are not available under dnl the GNU General Public License or the GNU Lesser 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 Lesser General Public License, and the rest of the GNU dnl gettext 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 must be one of 'external', 'use-libtool'. dnl INTLSYMBOL should be 'external' for packages other than GNU gettext, and dnl 'use-libtool' for the packages 'gettext-runtime' and 'gettext-tools'. 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). 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], [use-libtool], , [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT ])])])]) ifelse(ifelse([$1], [], [old])[]ifelse([$1], [no-libtool], [old]), [old], [errprint([ERROR: Use of AM_GNU_GETTEXT without [external] argument is no longer supported. ])]) ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], , [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT ])])])]) define([gt_included_intl], ifelse([$1], [external], [no], [yes])) 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 not documented, we avoid it. ifelse(gt_included_intl, yes, , [ AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) ]) dnl Sometimes, on Mac OS X, libintl requires linking with CoreFoundation. gt_INTL_MACOSX dnl Set USE_NLS. AC_REQUIRE([AM_NLS]) ifelse(gt_included_intl, yes, [ BUILD_INCLUDED_LIBINTL=no USE_INCLUDED_LIBINTL=no ]) LIBINTL= LTLIBINTL= POSUB= dnl Add a version number to the cache macros. case " $gt_needs " in *" need-formatstring-macros "*) gt_api_version=3 ;; *" need-ngettext "*) gt_api_version=2 ;; *) gt_api_version=1 ;; esac gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc" gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl" dnl If we use NLS figure out what method if test "$USE_NLS" = "yes"; then gt_use_preinstalled_gnugettext=no ifelse(gt_included_intl, yes, [ AC_MSG_CHECKING([whether included gettext is requested]) AC_ARG_WITH([included-gettext], [ --with-included-gettext use the GNU gettext library included here], nls_cv_force_use_gnu_gettext=$withval, nls_cv_force_use_gnu_gettext=no) AC_MSG_RESULT([$nls_cv_force_use_gnu_gettext]) nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" if test "$nls_cv_force_use_gnu_gettext" != "yes"; then ]) dnl User does not insist on using GNU NLS library. Figure out what dnl to use. If GNU gettext is available we use this. Else we have dnl to fall back to GNU NLS library. if test $gt_api_version -ge 3; then gt_revision_test_code=' #ifndef __GNU_GETTEXT_SUPPORTED_REVISION #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) #endif changequote(,)dnl typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; changequote([,])dnl ' else gt_revision_test_code= fi if test $gt_api_version -ge 2; then gt_expression_test_code=' + * ngettext ("", "", 0)' else gt_expression_test_code= fi AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc], [AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[ #include #ifndef __GNU_GETTEXT_SUPPORTED_REVISION extern int _nl_msg_cat_cntr; extern int *_nl_domain_bindings; #define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_domain_bindings) #else #define __GNU_GETTEXT_SYMBOL_EXPRESSION 0 #endif $gt_revision_test_code ]], [[ bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION ]])], [eval "$gt_func_gnugettext_libc=yes"], [eval "$gt_func_gnugettext_libc=no"])]) if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then dnl Sometimes libintl requires libiconv, so first search for libiconv. ifelse(gt_included_intl, yes, , [ AM_ICONV_LINK ]) dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv]) dnl because that would add "-liconv" to LIBINTL and LTLIBINTL dnl even if libiconv doesn't exist. AC_LIB_LINKFLAGS_BODY([intl]) AC_CACHE_CHECK([for GNU gettext in libintl], [$gt_func_gnugettext_libintl], [gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $INCINTL" gt_save_LIBS="$LIBS" LIBS="$LIBS $LIBINTL" dnl Now see whether libintl exists and does not depend on libiconv. AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[ #include #ifndef __GNU_GETTEXT_SUPPORTED_REVISION extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); #define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias ("")) #else #define __GNU_GETTEXT_SYMBOL_EXPRESSION 0 #endif $gt_revision_test_code ]], [[ bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION ]])], [eval "$gt_func_gnugettext_libintl=yes"], [eval "$gt_func_gnugettext_libintl=no"]) dnl Now see whether libintl exists and depends on libiconv. if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then LIBS="$LIBS $LIBICONV" AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[ #include #ifndef __GNU_GETTEXT_SUPPORTED_REVISION extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); #define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias ("")) #else #define __GNU_GETTEXT_SYMBOL_EXPRESSION 0 #endif $gt_revision_test_code ]], [[ bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION ]])], [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.la $LIBICONV $LIBTHREAD" LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.la $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 In GNU gettext we have to set BUILD_INCLUDED_LIBINTL to 'yes' dnl because some of the testsuite requires it. BUILD_INCLUDED_LIBINTL=yes 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 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], []) dnl Usage: AM_GNU_GETTEXT_REQUIRE_VERSION([gettext-version]) AC_DEFUN([AM_GNU_GETTEXT_REQUIRE_VERSION], []) # host-cpu-c-abi.m4 serial 13 dnl Copyright (C) 2002-2020 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 and Sam Steingold. dnl Sets the HOST_CPU variable to the canonical name of the CPU. dnl Sets the HOST_CPU_C_ABI variable to the canonical name of the CPU with its dnl C language ABI (application binary interface). dnl Also defines __${HOST_CPU}__ and __${HOST_CPU_C_ABI}__ as C macros in dnl config.h. dnl dnl This canonical name can be used to select a particular assembly language dnl source file that will interoperate with C code on the given host. dnl dnl For example: dnl * 'i386' and 'sparc' are different canonical names, because code for i386 dnl will not run on SPARC CPUs and vice versa. They have different dnl instruction sets. dnl * 'sparc' and 'sparc64' are different canonical names, because code for dnl 'sparc' and code for 'sparc64' cannot be linked together: 'sparc' code dnl contains 32-bit instructions, whereas 'sparc64' code contains 64-bit dnl instructions. A process on a SPARC CPU can be in 32-bit mode or in 64-bit dnl mode, but not both. dnl * 'mips' and 'mipsn32' are different canonical names, because they use dnl different argument passing and return conventions for C functions, and dnl although the instruction set of 'mips' is a large subset of the dnl instruction set of 'mipsn32'. dnl * 'mipsn32' and 'mips64' are different canonical names, because they use dnl different sizes for the C types like 'int' and 'void *', and although dnl the instruction sets of 'mipsn32' and 'mips64' are the same. dnl * The same canonical name is used for different endiannesses. You can dnl determine the endianness through preprocessor symbols: dnl - 'arm': test __ARMEL__. dnl - 'mips', 'mipsn32', 'mips64': test _MIPSEB vs. _MIPSEL. dnl - 'powerpc64': test _BIG_ENDIAN vs. _LITTLE_ENDIAN. dnl * The same name 'i386' is used for CPUs of type i386, i486, i586 dnl (Pentium), AMD K7, Pentium II, Pentium IV, etc., because dnl - Instructions that do not exist on all of these CPUs (cmpxchg, dnl MMX, SSE, SSE2, 3DNow! etc.) are not frequently used. If your dnl assembly language source files use such instructions, you will dnl need to make the distinction. dnl - Speed of execution of the common instruction set is reasonable across dnl the entire family of CPUs. If you have assembly language source files dnl that are optimized for particular CPU types (like GNU gmp has), you dnl will need to make the distinction. dnl See . AC_DEFUN([gl_HOST_CPU_C_ABI], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([gl_C_ASM]) AC_CACHE_CHECK([host CPU and C ABI], [gl_cv_host_cpu_c_abi], [case "$host_cpu" in changequote(,)dnl i[34567]86 ) changequote([,])dnl gl_cv_host_cpu_c_abi=i386 ;; x86_64 ) # On x86_64 systems, the C compiler may be generating code in one of # these ABIs: # - 64-bit instruction set, 64-bit pointers, 64-bit 'long': x86_64. # - 64-bit instruction set, 64-bit pointers, 32-bit 'long': x86_64 # with native Windows (mingw, MSVC). # - 64-bit instruction set, 32-bit pointers, 32-bit 'long': x86_64-x32. # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': i386. AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if (defined __x86_64__ || defined __amd64__ \ || defined _M_X64 || defined _M_AMD64) int ok; #else error fail #endif ]])], [AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if defined __ILP32__ || defined _ILP32 int ok; #else error fail #endif ]])], [gl_cv_host_cpu_c_abi=x86_64-x32], [gl_cv_host_cpu_c_abi=x86_64])], [gl_cv_host_cpu_c_abi=i386]) ;; changequote(,)dnl alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] ) changequote([,])dnl gl_cv_host_cpu_c_abi=alpha ;; arm* | aarch64 ) # Assume arm with EABI. # On arm64 systems, the C compiler may be generating code in one of # these ABIs: # - aarch64 instruction set, 64-bit pointers, 64-bit 'long': arm64. # - aarch64 instruction set, 32-bit pointers, 32-bit 'long': arm64-ilp32. # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': arm or armhf. AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#ifdef __aarch64__ int ok; #else error fail #endif ]])], [AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if defined __ILP32__ || defined _ILP32 int ok; #else error fail #endif ]])], [gl_cv_host_cpu_c_abi=arm64-ilp32], [gl_cv_host_cpu_c_abi=arm64])], [# Don't distinguish little-endian and big-endian arm, since they # don't require different machine code for simple operations and # since the user can distinguish them through the preprocessor # defines __ARMEL__ vs. __ARMEB__. # But distinguish arm which passes floating-point arguments and # return values in integer registers (r0, r1, ...) - this is # gcc -mfloat-abi=soft or gcc -mfloat-abi=softfp - from arm which # passes them in float registers (s0, s1, ...) and double registers # (d0, d1, ...) - this is gcc -mfloat-abi=hard. GCC 4.6 or newer # sets the preprocessor defines __ARM_PCS (for the first case) and # __ARM_PCS_VFP (for the second case), but older GCC does not. echo 'double ddd; void func (double dd) { ddd = dd; }' > conftest.c # Look for a reference to the register d0 in the .s file. AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS $gl_c_asm_opt conftest.c) >/dev/null 2>&1 if LC_ALL=C grep 'd0,' conftest.$gl_asmext >/dev/null; then gl_cv_host_cpu_c_abi=armhf else gl_cv_host_cpu_c_abi=arm fi rm -f conftest* ]) ;; hppa1.0 | hppa1.1 | hppa2.0* | hppa64 ) # On hppa, the C compiler may be generating 32-bit code or 64-bit # code. In the latter case, it defines _LP64 and __LP64__. AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#ifdef __LP64__ int ok; #else error fail #endif ]])], [gl_cv_host_cpu_c_abi=hppa64], [gl_cv_host_cpu_c_abi=hppa]) ;; ia64* ) # On ia64 on HP-UX, the C compiler may be generating 64-bit code or # 32-bit code. In the latter case, it defines _ILP32. AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#ifdef _ILP32 int ok; #else error fail #endif ]])], [gl_cv_host_cpu_c_abi=ia64-ilp32], [gl_cv_host_cpu_c_abi=ia64]) ;; mips* ) # We should also check for (_MIPS_SZPTR == 64), but gcc keeps this # at 32. AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64) int ok; #else error fail #endif ]])], [gl_cv_host_cpu_c_abi=mips64], [# In the n32 ABI, _ABIN32 is defined, _ABIO32 is not defined (but # may later get defined by ), and _MIPS_SIM == _ABIN32. # In the 32 ABI, _ABIO32 is defined, _ABIN32 is not defined (but # may later get defined by ), and _MIPS_SIM == _ABIO32. AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if (_MIPS_SIM == _ABIN32) int ok; #else error fail #endif ]])], [gl_cv_host_cpu_c_abi=mipsn32], [gl_cv_host_cpu_c_abi=mips])]) ;; powerpc* ) # Different ABIs are in use on AIX vs. Mac OS X vs. Linux,*BSD. # No need to distinguish them here; the caller may distinguish # them based on the OS. # On powerpc64 systems, the C compiler may still be generating # 32-bit code. And on powerpc-ibm-aix systems, the C compiler may # be generating 64-bit code. AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if defined __powerpc64__ || defined _ARCH_PPC64 int ok; #else error fail #endif ]])], [# On powerpc64, there are two ABIs on Linux: The AIX compatible # one and the ELFv2 one. The latter defines _CALL_ELF=2. AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if defined _CALL_ELF && _CALL_ELF == 2 int ok; #else error fail #endif ]])], [gl_cv_host_cpu_c_abi=powerpc64-elfv2], [gl_cv_host_cpu_c_abi=powerpc64]) ], [gl_cv_host_cpu_c_abi=powerpc]) ;; rs6000 ) gl_cv_host_cpu_c_abi=powerpc ;; riscv32 | riscv64 ) # There are 2 architectures (with variants): rv32* and rv64*. AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if __riscv_xlen == 64 int ok; #else error fail #endif ]])], [cpu=riscv64], [cpu=riscv32]) # There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d. # Size of 'long' and 'void *': AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if defined __LP64__ int ok; #else error fail #endif ]])], [main_abi=lp64], [main_abi=ilp32]) # Float ABIs: # __riscv_float_abi_double: # 'float' and 'double' are passed in floating-point registers. # __riscv_float_abi_single: # 'float' are passed in floating-point registers. # __riscv_float_abi_soft: # No values are passed in floating-point registers. AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if defined __riscv_float_abi_double int ok; #else error fail #endif ]])], [float_abi=d], [AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if defined __riscv_float_abi_single int ok; #else error fail #endif ]])], [float_abi=f], [float_abi='']) ]) gl_cv_host_cpu_c_abi="${cpu}-${main_abi}${float_abi}" ;; s390* ) # On s390x, the C compiler may be generating 64-bit (= s390x) code # or 31-bit (= s390) code. AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if defined __LP64__ || defined __s390x__ int ok; #else error fail #endif ]])], [gl_cv_host_cpu_c_abi=s390x], [gl_cv_host_cpu_c_abi=s390]) ;; sparc | sparc64 ) # UltraSPARCs running Linux have `uname -m` = "sparc64", but the # C compiler still generates 32-bit code. AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#if defined __sparcv9 || defined __arch64__ int ok; #else error fail #endif ]])], [gl_cv_host_cpu_c_abi=sparc64], [gl_cv_host_cpu_c_abi=sparc]) ;; *) gl_cv_host_cpu_c_abi="$host_cpu" ;; esac ]) dnl In most cases, $HOST_CPU and $HOST_CPU_C_ABI are the same. HOST_CPU=`echo "$gl_cv_host_cpu_c_abi" | sed -e 's/-.*//'` HOST_CPU_C_ABI="$gl_cv_host_cpu_c_abi" AC_SUBST([HOST_CPU]) AC_SUBST([HOST_CPU_C_ABI]) # This was # AC_DEFINE_UNQUOTED([__${HOST_CPU}__]) # AC_DEFINE_UNQUOTED([__${HOST_CPU_C_ABI}__]) # earlier, but KAI C++ 3.2d doesn't like this. sed -e 's/-/_/g' >> confdefs.h < #include ]], [[iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);]])], [am_cv_func_iconv=yes]) if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[ #include #include ]], [[iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);]])], [am_cv_lib_iconv=yes] [am_cv_func_iconv=yes]) LIBS="$am_save_LIBS" fi ]) if test "$am_cv_func_iconv" = yes; then AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [ dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11, dnl Solaris 10. am_save_LIBS="$LIBS" if test $am_cv_lib_iconv = yes; then LIBS="$LIBS $LIBICONV" fi am_cv_func_iconv_works=no for ac_iconv_const in '' 'const'; do AC_RUN_IFELSE( [AC_LANG_PROGRAM( [[ #include #include #ifndef ICONV_CONST # define ICONV_CONST $ac_iconv_const #endif ]], [[int result = 0; /* Test against AIX 5.1 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); if (cd_utf8_to_88591 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */ char buf[10]; ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_utf8_to_88591, &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 1; iconv_close (cd_utf8_to_88591); } } /* Test against Solaris 10 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); if (cd_ascii_to_88591 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\263"; char buf[10]; ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_ascii_to_88591, &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 2; iconv_close (cd_ascii_to_88591); } } /* Test against AIX 6.1..7.1 bug: Buffer overrun. */ { iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\304"; static char buf[2] = { (char)0xDE, (char)0xAD }; ICONV_CONST char *inptr = input; size_t inbytesleft = 1; char *outptr = buf; size_t outbytesleft = 1; size_t res = iconv (cd_88591_to_utf8, &inptr, &inbytesleft, &outptr, &outbytesleft); if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) result |= 4; iconv_close (cd_88591_to_utf8); } } #if 0 /* This bug could be worked around by the caller. */ /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ { iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; char buf[50]; ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_88591_to_utf8, &inptr, &inbytesleft, &outptr, &outbytesleft); if ((int)res > 0) result |= 8; iconv_close (cd_88591_to_utf8); } } #endif /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is provided. */ { /* Try standardized names. */ iconv_t cd1 = iconv_open ("UTF-8", "EUC-JP"); /* Try IRIX, OSF/1 names. */ iconv_t cd2 = iconv_open ("UTF-8", "eucJP"); /* Try AIX names. */ iconv_t cd3 = iconv_open ("UTF-8", "IBM-eucJP"); /* Try HP-UX names. */ iconv_t cd4 = iconv_open ("utf8", "eucJP"); if (cd1 == (iconv_t)(-1) && cd2 == (iconv_t)(-1) && cd3 == (iconv_t)(-1) && cd4 == (iconv_t)(-1)) result |= 16; if (cd1 != (iconv_t)(-1)) iconv_close (cd1); if (cd2 != (iconv_t)(-1)) iconv_close (cd2); if (cd3 != (iconv_t)(-1)) iconv_close (cd3); if (cd4 != (iconv_t)(-1)) iconv_close (cd4); } return result; ]])], [am_cv_func_iconv_works=yes], , [case "$host_os" in aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; *) am_cv_func_iconv_works="guessing yes" ;; esac]) test "$am_cv_func_iconv_works" = no || break done LIBS="$am_save_LIBS" ]) case "$am_cv_func_iconv_works" in *no) am_func_iconv=no am_cv_lib_iconv=no ;; *) am_func_iconv=yes ;; esac else am_func_iconv=no am_cv_lib_iconv=no fi if test "$am_func_iconv" = yes; then AC_DEFINE([HAVE_ICONV], [1], [Define if you have the iconv() function and it works.]) fi if test "$am_cv_lib_iconv" = yes; then AC_MSG_CHECKING([how to link with libiconv]) AC_MSG_RESULT([$LIBICONV]) else dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV dnl either. CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi AC_SUBST([LIBICONV]) AC_SUBST([LTLIBICONV]) ]) dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to dnl avoid warnings like dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required". dnl This is tricky because of the way 'aclocal' is implemented: dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN. dnl Otherwise aclocal's initial scan pass would miss the macro definition. dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions. dnl Otherwise aclocal would emit many "Use of uninitialized value $1" dnl warnings. m4_define([gl_iconv_AC_DEFUN], m4_version_prereq([2.64], [[AC_DEFUN_ONCE( [$1], [$2])]], [m4_ifdef([gl_00GNULIB], [[AC_DEFUN_ONCE( [$1], [$2])]], [[AC_DEFUN( [$1], [$2])]])])) gl_iconv_AC_DEFUN([AM_ICONV], [ AM_ICONV_LINK if test "$am_cv_func_iconv" = yes; then AC_MSG_CHECKING([for iconv declaration]) AC_CACHE_VAL([am_cv_proto_iconv], [ AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[ #include #include extern #ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif ]], [[]])], [am_cv_proto_iconv_arg1=""], [am_cv_proto_iconv_arg1="const"]) am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` AC_MSG_RESULT([ $am_cv_proto_iconv]) else dnl When compiling GNU libiconv on a system that does not have iconv yet, dnl pick the POSIX compliant declaration without 'const'. am_cv_proto_iconv_arg1="" fi AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1], [Define as const if the declaration of iconv() needs const.]) dnl Also substitute ICONV_CONST in the gnulib generated . m4_ifdef([gl_ICONV_H_DEFAULTS], [AC_REQUIRE([gl_ICONV_H_DEFAULTS]) if test -n "$am_cv_proto_iconv_arg1"; then ICONV_CONST="const" fi ]) ]) # intlmacosx.m4 serial 8 (gettext-0.20.2) dnl Copyright (C) 2004-2014, 2016, 2019-2020 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 be used in projects which are not available under dnl the GNU General Public License or the GNU Lesser 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 Lesser General Public License, and the rest of the GNU dnl gettext package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Checks for special options needed on Mac OS X. dnl Defines INTL_MACOSX_LIBS. AC_DEFUN([gt_INTL_MACOSX], [ dnl Check for API introduced in Mac OS X 10.4. AC_CACHE_CHECK([for CFPreferencesCopyAppValue], [gt_cv_func_CFPreferencesCopyAppValue], [gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[CFPreferencesCopyAppValue(NULL, NULL)]])], [gt_cv_func_CFPreferencesCopyAppValue=yes], [gt_cv_func_CFPreferencesCopyAppValue=no]) LIBS="$gt_save_LIBS"]) if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1], [Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in the CoreFoundation framework.]) fi dnl Don't check for the API introduced in Mac OS X 10.5, CFLocaleCopyCurrent, dnl because in macOS 10.13.4 it has the following behaviour: dnl When two or more languages are specified in the dnl "System Preferences > Language & Region > Preferred Languages" panel, dnl it returns en_CC where CC is the territory (even when English is not among dnl the preferred languages!). What we want instead is what dnl CFLocaleCopyCurrent returned in earlier macOS releases and what dnl CFPreferencesCopyAppValue still returns, namely ll_CC where ll is the dnl first among the preferred languages and CC is the territory. AC_CACHE_CHECK([for CFLocaleCopyPreferredLanguages], [gt_cv_func_CFLocaleCopyPreferredLanguages], [gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include ]], [[CFLocaleCopyPreferredLanguages();]])], [gt_cv_func_CFLocaleCopyPreferredLanguages=yes], [gt_cv_func_CFLocaleCopyPreferredLanguages=no]) LIBS="$gt_save_LIBS"]) if test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then AC_DEFINE([HAVE_CFLOCALECOPYPREFERREDLANGUAGES], [1], [Define to 1 if you have the Mac OS X function CFLocaleCopyPreferredLanguages in the CoreFoundation framework.]) fi INTL_MACOSX_LIBS= if test $gt_cv_func_CFPreferencesCopyAppValue = yes \ || test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" fi AC_SUBST([INTL_MACOSX_LIBS]) ]) # lib-ld.m4 serial 9 dnl Copyright (C) 1996-2003, 2009-2020 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Subroutines of libtool.m4, dnl with replacements s/_*LT_PATH/AC_LIB_PROG/ and s/lt_/acl_/ to avoid dnl collision with libtool.m4. dnl From libtool-2.4. Sets the variable with_gnu_ld to yes or no. AC_DEFUN([AC_LIB_PROG_LD_GNU], [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld], [# I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 /dev/null 2>&1 \ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ || PATH_SEPARATOR=';' } fi if test -n "$LD"; then AC_MSG_CHECKING([for ld]) elif test "$GCC" = yes; then AC_MSG_CHECKING([for ld used by $CC]) elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi if test -n "$LD"; then # Let the user override the test with a path. : else AC_CACHE_VAL([acl_cv_path_LD], [ acl_cv_path_LD= # Final result of this test ac_prog=ld # Program to search in $PATH if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw acl_output=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) acl_output=`($CC -print-prog-name=ld) 2>&5` ;; esac case $acl_output in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld acl_output=`echo "$acl_output" | sed 's%\\\\%/%g'` while echo "$acl_output" | grep "$re_direlt" > /dev/null 2>&1; do acl_output=`echo $acl_output | sed "s%$re_direlt%/%"` done # Got the pathname. No search in PATH is needed. acl_cv_path_LD="$acl_output" ac_prog= ;; "") # If it fails, then pretend we aren't using GCC. ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac fi if test -n "$ac_prog"; then # Search for $ac_prog in $PATH. acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$acl_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$acl_cv_path_LD" -v 2>&1 conftest.sh . ./conftest.sh rm -f ./conftest.sh acl_cv_rpath=done ]) wl="$acl_cv_wl" acl_libext="$acl_cv_libext" acl_shlibext="$acl_cv_shlibext" acl_libname_spec="$acl_cv_libname_spec" acl_library_names_spec="$acl_cv_library_names_spec" acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" acl_hardcode_direct="$acl_cv_hardcode_direct" acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" dnl Determine whether the user wants rpath handling at all. AC_ARG_ENABLE([rpath], [ --disable-rpath do not hardcode runtime library paths], :, enable_rpath=yes) ]) dnl AC_LIB_FROMPACKAGE(name, package) dnl declares that libname comes from the given package. The configure file dnl will then not have a --with-libname-prefix option but a dnl --with-package-prefix option. Several libraries can come from the same dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar dnl macro call that searches for libname. AC_DEFUN([AC_LIB_FROMPACKAGE], [ pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) define([acl_frompackage_]NAME, [$2]) popdef([NAME]) pushdef([PACK],[$2]) pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) define([acl_libsinpackage_]PACKUP, m4_ifdef([acl_libsinpackage_]PACKUP, [m4_defn([acl_libsinpackage_]PACKUP)[, ]],)[lib$1]) popdef([PACKUP]) popdef([PACK]) ]) dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem. AC_DEFUN([AC_LIB_LINKFLAGS_BODY], [ AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])]) pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\" eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\" ]) AC_ARG_WITH(PACK[-prefix], [[ --with-]]PACK[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib --without-]]PACK[[-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\" eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\" eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" additional_libdir2="$withval/$acl_libdirstem2" additional_libdir3="$withval/$acl_libdirstem3" fi fi ]) if test "X$additional_libdir2" = "X$additional_libdir"; then additional_libdir2= fi if test "X$additional_libdir3" = "X$additional_libdir"; then additional_libdir3= 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 for additional_libdir_variable in additional_libdir additional_libdir2 additional_libdir3; do if test "X$found_dir" = "X"; then eval dir=\$$additional_libdir_variable if test -n "$dir"; then 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" && acl_is_expected_elfclass < "$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" && acl_is_expected_elfclass < "$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" && acl_is_expected_elfclass < "$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" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; 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 fi done 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" && acl_is_expected_elfclass < "$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" && acl_is_expected_elfclass < "$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" && acl_is_expected_elfclass < "$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" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; 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" \ || test "X$found_dir" = "X/usr/$acl_libdirstem3"; 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" ;; */$acl_libdirstem3 | */$acl_libdirstem3/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem3/"'*$,,'` 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*) dependency_libdir=`echo "X$dep" | sed -e 's/^X-L//'` dnl Potentially add $dependency_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$dependency_libdir" != "X/usr/$acl_libdirstem" \ && test "X$dependency_libdir" != "X/usr/$acl_libdirstem2" \ && test "X$dependency_libdir" != "X/usr/$acl_libdirstem3"; then haveit= if test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem" \ || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem2" \ || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem3"; 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$dependency_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$dependency_libdir"; then dnl Really add $dependency_libdir to $LIBNAME. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$dependency_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$dependency_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$dependency_libdir"; then dnl Really add $dependency_libdir to $LTLIBNAME. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$dependency_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([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" \ && test "X$dir" != "X/usr/$acl_libdirstem3"; 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" \ && test "X$dir" != "X/usr/$acl_libdirstem3"; 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]) ]) # lib-prefix.m4 serial 17 dnl Copyright (C) 2001-2005, 2008-2020 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_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_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 function acl_is_expected_elfclass, that tests whether standard input dn; has a 32-bit or 64-bit ELF header, depending on the host CPU ABI, dnl - 3 variables acl_libdirstem, acl_libdirstem2, acl_libdirstem3, containing dnl the basename of the libdir to try in turn, either "lib" or "lib64" or dnl "lib/64" or "lib32" or "lib/sparcv9" or "lib/amd64" or similar. AC_DEFUN([AC_LIB_PREPARE_MULTILIB], [ dnl There is no formal standard regarding lib, lib32, and lib64. dnl On most 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. However, on dnl Arch Linux based distributions, it's the opposite: 32-bit libraries go dnl under $prefix/lib32 and 64-bit libraries go under $prefix/lib. dnl We determine the compiler's default mode by looking at the compiler's dnl library search path. If at least one of its elements ends in /lib64 or dnl points to a directory whose absolute pathname ends in /lib64, we use that dnl for 64-bit ABIs. Similarly for 32-bit ABIs. Otherwise we use the default, dnl 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]) AC_REQUIRE([gl_HOST_CPU_C_ABI_32BIT]) AC_CACHE_CHECK([for ELF binary format], [gl_cv_elf], [AC_EGREP_CPP([Extensible Linking Format], [#ifdef __ELF__ Extensible Linking Format #endif ], [gl_cv_elf=yes], [gl_cv_elf=no]) ]) if test $gl_cv_elf; then # Extract the ELF class of a file (5th byte) in decimal. # Cf. https://en.wikipedia.org/wiki/Executable_and_Linkable_Format#File_header if od -A x < /dev/null >/dev/null 2>/dev/null; then # Use POSIX od. func_elfclass () { od -A n -t d1 -j 4 -N 1 } else # Use BSD hexdump. func_elfclass () { dd bs=1 count=1 skip=4 2>/dev/null | hexdump -e '1/1 "%3d "' echo } fi changequote(,)dnl case $HOST_CPU_C_ABI_32BIT in yes) # 32-bit ABI. acl_is_expected_elfclass () { test "`func_elfclass | sed -e 's/[ ]//g'`" = 1 } ;; no) # 64-bit ABI. acl_is_expected_elfclass () { test "`func_elfclass | sed -e 's/[ ]//g'`" = 2 } ;; *) # Unknown. acl_is_expected_elfclass () { : } ;; esac changequote([,])dnl else acl_is_expected_elfclass () { : } fi dnl Allow the user to override the result by setting acl_cv_libdirstems. AC_CACHE_CHECK([for the common suffixes of directories in the library search path], [acl_cv_libdirstems], [dnl Try 'lib' first, because that's the default for libdir in GNU, see dnl . acl_libdirstem=lib acl_libdirstem2= acl_libdirstem3= 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. if test $HOST_CPU_C_ABI_32BIT = no; then acl_libdirstem2=lib/64 case "$host_cpu" in sparc*) acl_libdirstem3=lib/sparcv9 ;; i*86 | x86_64) acl_libdirstem3=lib/amd64 ;; esac fi ;; *) dnl If $CC generates code for a 32-bit ABI, the libraries are dnl surely under $prefix/lib or $prefix/lib32, not $prefix/lib64. dnl Similarly, if $CC generates code for a 64-bit ABI, the libraries dnl are surely under $prefix/lib or $prefix/lib64, not $prefix/lib32. dnl Find the compiler's search path. However, non-system compilers dnl sometimes have odd library search paths. But we can't simply invoke dnl '/usr/bin/gcc -print-search-dirs' because that would not take into dnl account the -m32/-m31 or -m64 options from the $CC or $CFLAGS. searchpath=`(LC_ALL=C $CC $CPPFLAGS $CFLAGS -print-search-dirs) 2>/dev/null \ | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` if test $HOST_CPU_C_ABI_32BIT != no; then # 32-bit or unknown ABI. if test -d /usr/lib32; then acl_libdirstem2=lib32 fi fi if test $HOST_CPU_C_ABI_32BIT != yes; then # 64-bit or unknown ABI. if test -d /usr/lib64; then acl_libdirstem3=lib64 fi fi if test -n "$searchpath"; then acl_save_IFS="${IFS= }"; IFS=":" for searchdir in $searchpath; do if test -d "$searchdir"; then case "$searchdir" in */lib32/ | */lib32 ) acl_libdirstem2=lib32 ;; */lib64/ | */lib64 ) acl_libdirstem3=lib64 ;; */../ | */.. ) # Better ignore directories of this form. They are misleading. ;; *) searchdir=`cd "$searchdir" && pwd` case "$searchdir" in */lib32 ) acl_libdirstem2=lib32 ;; */lib64 ) acl_libdirstem3=lib64 ;; esac ;; esac fi done IFS="$acl_save_IFS" if test $HOST_CPU_C_ABI_32BIT = yes; then # 32-bit ABI. acl_libdirstem3= fi if test $HOST_CPU_C_ABI_32BIT = no; then # 64-bit ABI. acl_libdirstem2= fi fi ;; esac test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" test -n "$acl_libdirstem3" || acl_libdirstem3="$acl_libdirstem" acl_cv_libdirstems="$acl_libdirstem,$acl_libdirstem2,$acl_libdirstem3" ]) dnl Decompose acl_cv_libdirstems into acl_libdirstem, acl_libdirstem2, and dnl acl_libdirstem3. changequote(,)dnl acl_libdirstem=`echo "$acl_cv_libdirstems" | sed -e 's/,.*//'` acl_libdirstem2=`echo "$acl_cv_libdirstems" | sed -e 's/^[^,]*,//' -e 's/,.*//'` acl_libdirstem3=`echo "$acl_cv_libdirstems" | sed -e 's/^[^,]*,[^,]*,//' -e 's/,.*//'` changequote([,])dnl ]) # nls.m4 serial 6 (gettext-0.20.2) dnl Copyright (C) 1995-2003, 2005-2006, 2008-2014, 2016, 2019-2020 Free dnl 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 be used in projects which are not available under dnl the GNU General Public License or the GNU Lesser 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 Lesser General Public License, and the rest of the GNU dnl gettext 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]) ]) # po.m4 serial 31 (gettext-0.20.2) dnl Copyright (C) 1995-2014, 2016, 2018-2020 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 be used in projects which are not available under dnl the GNU General Public License or the GNU Lesser 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 Lesser General Public License, and the rest of the GNU dnl gettext package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. AC_PREREQ([2.60]) dnl Checks for all prerequisites of the po subdirectory. AC_DEFUN([AM_PO_SUBDIRS], [ AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl AC_REQUIRE([AC_PROG_SED])dnl AC_REQUIRE([AM_NLS])dnl dnl Release version of the gettext macros. This is used to ensure that dnl the gettext macros and po/Makefile.in.in are in sync. AC_SUBST([GETTEXT_MACRO_VERSION], [0.20]) 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 `$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 Test whether it is GNU msgmerge >= 0.20. if LC_ALL=C $MSGMERGE --help | grep ' --for-msgfmt ' >/dev/null; then MSGMERGE_FOR_MSGFMT_OPTION='--for-msgfmt' else dnl Test whether it is GNU msgmerge >= 0.12. if LC_ALL=C $MSGMERGE --help | grep ' --no-fuzzy-matching ' >/dev/null; then MSGMERGE_FOR_MSGFMT_OPTION='--no-fuzzy-matching --no-location --quiet' else dnl With these old versions, $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) is dnl slow. But this is not a big problem, as such old gettext versions are dnl hardly in use any more. MSGMERGE_FOR_MSGFMT_OPTION='--no-location --quiet' fi fi AC_SUBST([MSGMERGE_FOR_MSGFMT_OPTION]) dnl Support for AM_XGETTEXT_OPTION. test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= AC_SUBST([XGETTEXT_EXTRA_OPTIONS]) AC_CONFIG_COMMANDS([po-directories], [[ for ac_file in $CONFIG_FILES; do # Support "outfile[:infile[:infile...]]" case "$ac_file" in *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; esac # PO directories have a Makefile.in generated from Makefile.in.in. case "$ac_file" in */Makefile.in) # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'` ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac # Treat a directory as a PO directory if and only if it has a # POTFILES.in file. This allows packages to have multiple PO # directories under different names or in different locations. if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then rm -f "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" gt_tab=`printf '\t'` cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" POMAKEFILEDEPS="POTFILES.in" # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend # on $ac_dir but don't depend on user-specified configuration # parameters. if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then # The LINGUAS file contains the set of available languages. if test -n "$OBSOLETE_ALL_LINGUAS"; then test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi ALL_LINGUAS=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # The set of available languages was given in configure.in. 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. OBSOLETE_ALL_LINGUAS="$ALL_LINGUAS" # Capture the value of LINGUAS because we need it to compute CATALOGS. LINGUAS="${LINGUAS-%UNSET%}" ]) ]) dnl Postprocesses a Makefile in a directory containing PO files. AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE], [ # When this code is run, in config.status, two variables have already been # set: # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in, # - LINGUAS is the value of the environment variable LINGUAS at configure # time. changequote(,)dnl # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'` ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac # Find a way to echo strings without interpreting backslash. if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then gt_echo='echo' else if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then gt_echo='printf %s\n' else echo_func () { cat < "$ac_file.tmp" tab=`printf '\t'` if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then # Add dependencies that cannot be formulated as a simple suffix rule. for lang in $ALL_LINGUAS; do frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` cat >> "$ac_file.tmp" < /dev/null; then # Add dependencies that cannot be formulated as a simple suffix rule. for lang in $ALL_LINGUAS; do frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'` cat >> "$ac_file.tmp" <> "$ac_file.tmp" <, 1996. AC_PREREQ([2.50]) # Search path for a program which passes the given test. dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) AC_DEFUN([AM_PATH_PROG_WITH_TEST], [ # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which # contains only /bin. Note that ksh looks also at the FPATH variable, # so we have to set that as well for the test. PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ || PATH_SEPARATOR=';' } fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "$2", so it can be a program name with args. set dummy $2; ac_word=[$]2 AC_MSG_CHECKING([for $ac_word]) AC_CACHE_VAL([ac_cv_path_$1], [case "[$]$1" in [[\\/]]* | ?:[[\\/]]*) ac_cv_path_$1="[$]$1" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in ifelse([$5], , $PATH, [$5]); do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD if [$3]; then ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" dnl If no 4th arg is given, leave the cache variable unset, dnl so AC_PATH_PROGS will keep looking. ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" ])dnl ;; esac])dnl $1="$ac_cv_path_$1" if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then AC_MSG_RESULT([$][$1]) else AC_MSG_RESULT([no]) fi AC_SUBST([$1])dnl ]) # Copyright (C) 2002-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.16.5], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.16.5])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. AS_CASE([$CONFIG_FILES], [*\'*], [eval set x "$CONFIG_FILES"], [*], [set x $CONFIG_FILES]) shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`AS_DIRNAME(["$am_mf"])` am_filepart=`AS_BASENAME(["$am_mf"])` AM_RUN_LOG([cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles]) || am_rc=$? done if test $am_rc -ne 0; then AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments for automatic dependency tracking. If GNU make was not used, consider re-running the configure script with MAKE="gmake" (or whatever is necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking).]) fi AS_UNSET([am_dirpart]) AS_UNSET([am_filepart]) AS_UNSET([am_mf]) AS_UNSET([am_rc]) rm -f conftest-deps.mk } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking is enabled. # This creates each '.Po' and '.Plo' makefile fragment that we'll need in # order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl m4_ifdef([_$0_ALREADY_INIT], [m4_fatal([$0 expanded multiple times ]m4_defn([_$0_ALREADY_INIT]))], [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) # Variables for tags utilities; see am/tags.am if test -z "$CTAGS"; then CTAGS=ctags fi AC_SUBST([CTAGS]) if test -z "$ETAGS"; then ETAGS=etags fi AC_SUBST([ETAGS]) if test -z "$CSCOPE"; then CSCOPE=cscope fi AC_SUBST([CSCOPE]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAKE_INCLUDE() # ----------------- # Check whether make has an 'include' directive that can support all # the idioms we need for our automatic dependency tracking code. AC_DEFUN([AM_MAKE_INCLUDE], [AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) AS_CASE([$?:`cat confinc.out 2>/dev/null`], ['0:this is the am__doit target'], [AS_CASE([$s], [BSD], [am__include='.include' am__quote='"'], [am__include='include' am__quote=''])]) if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* AC_MSG_RESULT([${_am_result}]) AC_SUBST([am__include])]) AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR pv-1.9.31/build-aux/000077500000000000000000000000001474702661500141405ustar00rootroot00000000000000pv-1.9.31/build-aux/ar-lib000077500000000000000000000133631474702661500152420ustar00rootroot00000000000000#! /bin/sh # Wrapper for Microsoft lib.exe me=ar-lib scriptversion=2019-07-04.01; # UTC # Copyright (C) 2010-2021 Free Software Foundation, Inc. # Written by Peter Rosin . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . # func_error message func_error () { echo "$me: $1" 1>&2 exit 1 } file_conv= # func_file_conv build_file # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN* | MSYS*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv in mingw) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin | msys) file=`cygpath -m "$file" || echo "$file"` ;; wine) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_at_file at_file operation archive # Iterate over all members in AT_FILE performing OPERATION on ARCHIVE # for each of them. # When interpreting the content of the @FILE, do NOT use func_file_conv, # since the user would need to supply preconverted file names to # binutils ar, at least for MinGW. func_at_file () { operation=$2 archive=$3 at_file_contents=`cat "$1"` eval set x "$at_file_contents" shift for member do $AR -NOLOGO $operation:"$member" "$archive" || exit $? done } case $1 in '') func_error "no command. Try '$0 --help' for more information." ;; -h | --h*) cat <. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN* | MSYS*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/* | msys/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: pv-1.9.31/build-aux/config.guess000077500000000000000000001405121474702661500164630ustar00rootroot00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2022 Free Software Foundation, Inc. # shellcheck disable=SC2006,SC2268 # see below for rationale timestamp='2022-01-09' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # https://git.savannah.gnu.org/cgit/config.git/plain/config.guess # # Please send patches to . # The "shellcheck disable" line above the timestamp inhibits complaints # about features and limitations of the classic Bourne shell that were # superseded or lifted in POSIX. However, this script identifies a wide # variety of pre-POSIX systems that do not have POSIX shells at all, and # even some reasonably current systems (Solaris 10 as case-in-point) still # have a pre-POSIX /bin/sh. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi # Just in case it came from the environment. GUESS= # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. tmp= # shellcheck disable=SC2172 trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 set_cc_for_build() { # prevent multiple calls if $tmp is already set test "$tmp" && return 0 : "${TMPDIR=/tmp}" # shellcheck disable=SC2039,SC3028 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } dummy=$tmp/dummy case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in ,,) echo "int x;" > "$dummy.c" for driver in cc gcc c89 c99 ; do if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then CC_FOR_BUILD=$driver break fi done if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac } # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if test -f /.attbin/uname ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case $UNAME_SYSTEM in Linux|GNU|GNU/*) LIBC=unknown set_cc_for_build cat <<-EOF > "$dummy.c" #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #elif defined(__GLIBC__) LIBC=gnu #else #include /* First heuristic to detect musl libc. */ #ifdef __DEFINED_va_list LIBC=musl #endif #endif EOF cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` eval "$cc_set_libc" # Second heuristic to detect musl libc. if [ "$LIBC" = unknown ] && command -v ldd >/dev/null && ldd --version 2>&1 | grep -q ^musl; then LIBC=musl fi # If the system lacks a compiler, then just pick glibc. # We could probably try harder. if [ "$LIBC" = unknown ]; then LIBC=gnu fi ;; esac # Note: order is significant - the case branches are not exclusive. case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ /sbin/sysctl -n hw.machine_arch 2>/dev/null || \ /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \ echo unknown)` case $UNAME_MACHINE_ARCH in aarch64eb) machine=aarch64_be-unknown ;; armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` machine=${arch}${endian}-unknown ;; *) machine=$UNAME_MACHINE_ARCH-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently (or will in the future) and ABI. case $UNAME_MACHINE_ARCH in earm*) os=netbsdelf ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # Determine ABI tags. case $UNAME_MACHINE_ARCH in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case $UNAME_VERSION in Debian*) release='-gnu' ;; *) release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. GUESS=$machine-${os}${release}${abi-} ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE ;; *:SecBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE ;; *:MidnightBSD:*:*) GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE ;; *:ekkoBSD:*:*) GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE ;; *:SolidBSD:*:*) GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE ;; *:OS108:*:*) GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE ;; macppc:MirBSD:*:*) GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE ;; *:MirBSD:*:*) GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE ;; *:Sortix:*:*) GUESS=$UNAME_MACHINE-unknown-sortix ;; *:Twizzler:*:*) GUESS=$UNAME_MACHINE-unknown-twizzler ;; *:Redox:*:*) GUESS=$UNAME_MACHINE-unknown-redox ;; mips:OSF1:*.*) GUESS=mips-dec-osf1 ;; alpha:OSF1:*:*) # Reset EXIT trap before exiting to avoid spurious non-zero exit code. trap '' 0 case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case $ALPHA_CPU_TYPE in "EV4 (21064)") UNAME_MACHINE=alpha ;; "EV4.5 (21064)") UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") UNAME_MACHINE=alpha ;; "EV5 (21164)") UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` GUESS=$UNAME_MACHINE-dec-osf$OSF_REL ;; Amiga*:UNIX_System_V:4.0:*) GUESS=m68k-unknown-sysv4 ;; *:[Aa]miga[Oo][Ss]:*:*) GUESS=$UNAME_MACHINE-unknown-amigaos ;; *:[Mm]orph[Oo][Ss]:*:*) GUESS=$UNAME_MACHINE-unknown-morphos ;; *:OS/390:*:*) GUESS=i370-ibm-openedition ;; *:z/VM:*:*) GUESS=s390-ibm-zvmoe ;; *:OS400:*:*) GUESS=powerpc-ibm-os400 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) GUESS=arm-acorn-riscix$UNAME_RELEASE ;; arm*:riscos:*:*|arm*:RISCOS:*:*) GUESS=arm-unknown-riscos ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) GUESS=hppa1.1-hitachi-hiuxmpp ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. case `(/bin/universe) 2>/dev/null` in att) GUESS=pyramid-pyramid-sysv3 ;; *) GUESS=pyramid-pyramid-bsd ;; esac ;; NILE*:*:*:dcosx) GUESS=pyramid-pyramid-svr4 ;; DRS?6000:unix:4.0:6*) GUESS=sparc-icl-nx6 ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) GUESS=sparc-icl-nx7 ;; esac ;; s390x:SunOS:*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL ;; sun4H:SunOS:5.*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=sparc-hal-solaris2$SUN_REL ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=sparc-sun-solaris2$SUN_REL ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) GUESS=i386-pc-auroraux$UNAME_RELEASE ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) set_cc_for_build SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH=x86_64 fi fi SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=$SUN_ARCH-pc-solaris2$SUN_REL ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=sparc-sun-solaris3$SUN_REL ;; sun4*:SunOS:*:*) case `/usr/bin/arch -k` in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'` GUESS=sparc-sun-sunos$SUN_REL ;; sun3*:SunOS:*:*) GUESS=m68k-sun-sunos$UNAME_RELEASE ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 case `/bin/arch` in sun3) GUESS=m68k-sun-sunos$UNAME_RELEASE ;; sun4) GUESS=sparc-sun-sunos$UNAME_RELEASE ;; esac ;; aushp:SunOS:*:*) GUESS=sparc-auspex-sunos$UNAME_RELEASE ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) GUESS=m68k-atari-mint$UNAME_RELEASE ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) GUESS=m68k-atari-mint$UNAME_RELEASE ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) GUESS=m68k-atari-mint$UNAME_RELEASE ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) GUESS=m68k-milan-mint$UNAME_RELEASE ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) GUESS=m68k-hades-mint$UNAME_RELEASE ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) GUESS=m68k-unknown-mint$UNAME_RELEASE ;; m68k:machten:*:*) GUESS=m68k-apple-machten$UNAME_RELEASE ;; powerpc:machten:*:*) GUESS=powerpc-apple-machten$UNAME_RELEASE ;; RISC*:Mach:*:*) GUESS=mips-dec-mach_bsd4.3 ;; RISC*:ULTRIX:*:*) GUESS=mips-dec-ultrix$UNAME_RELEASE ;; VAX*:ULTRIX*:*:*) GUESS=vax-dec-ultrix$UNAME_RELEASE ;; 2020:CLIX:*:* | 2430:CLIX:*:*) GUESS=clipper-intergraph-clix$UNAME_RELEASE ;; mips:*:*:UMIPS | mips:*:*:RISCos) set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`"$dummy" "$dummyarg"` && { echo "$SYSTEM_NAME"; exit; } GUESS=mips-mips-riscos$UNAME_RELEASE ;; Motorola:PowerMAX_OS:*:*) GUESS=powerpc-motorola-powermax ;; Motorola:*:4.3:PL8-*) GUESS=powerpc-harris-powermax ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) GUESS=powerpc-harris-powermax ;; Night_Hawk:Power_UNIX:*:*) GUESS=powerpc-harris-powerunix ;; m88k:CX/UX:7*:*) GUESS=m88k-harris-cxux7 ;; m88k:*:4*:R4*) GUESS=m88k-motorola-sysv4 ;; m88k:*:3*:R3*) GUESS=m88k-motorola-sysv3 ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110 then if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ test "$TARGET_BINARY_INTERFACE"x = x then GUESS=m88k-dg-dgux$UNAME_RELEASE else GUESS=m88k-dg-dguxbcs$UNAME_RELEASE fi else GUESS=i586-dg-dgux$UNAME_RELEASE fi ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) GUESS=m88k-dolphin-sysv3 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 GUESS=m88k-motorola-sysv3 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) GUESS=m88k-tektronix-sysv3 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) GUESS=m68k-tektronix-bsd ;; *:IRIX*:*:*) IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'` GUESS=mips-sgi-irix$IRIX_REL ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) GUESS=i386-ibm-aix ;; ia64:AIX:*:*) if test -x /usr/bin/oslevel ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` then GUESS=$SYSTEM_NAME else GUESS=rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then GUESS=rs6000-ibm-aix3.2.4 else GUESS=rs6000-ibm-aix3.2 fi ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if test -x /usr/bin/lslpp ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \ awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi GUESS=$IBM_ARCH-ibm-aix$IBM_REV ;; *:AIX:*:*) GUESS=rs6000-ibm-aix ;; ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) GUESS=romp-ibm-bsd4.4 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) GUESS=rs6000-bull-bosx ;; DPX/2?00:B.O.S.:*:*) GUESS=m68k-bull-sysv3 ;; 9000/[34]??:4.3bsd:1.*:*) GUESS=m68k-hp-bsd ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) GUESS=m68k-hp-bsd4.4 ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` case $UNAME_MACHINE in 9000/31?) HP_ARCH=m68000 ;; 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if test -x /usr/bin/getconf; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case $sc_cpu_version in 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case $sc_kernel_bits in 32) HP_ARCH=hppa2.0n ;; 64) HP_ARCH=hppa2.0w ;; '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi if test "$HP_ARCH" = ""; then set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if test "$HP_ARCH" = hppa2.0w then set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH=hppa2.0w else HP_ARCH=hppa64 fi fi GUESS=$HP_ARCH-hp-hpux$HPUX_REV ;; ia64:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` GUESS=ia64-hp-hpux$HPUX_REV ;; 3050*:HI-UX:*:*) set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } GUESS=unknown-hitachi-hiuxwe2 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) GUESS=hppa1.1-hp-bsd ;; 9000/8??:4.3bsd:*:*) GUESS=hppa1.0-hp-bsd ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) GUESS=hppa1.0-hp-mpeix ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) GUESS=hppa1.1-hp-osf ;; hp8??:OSF1:*:*) GUESS=hppa1.0-hp-osf ;; i*86:OSF1:*:*) if test -x /usr/sbin/sysversion ; then GUESS=$UNAME_MACHINE-unknown-osf1mk else GUESS=$UNAME_MACHINE-unknown-osf1 fi ;; parisc*:Lites*:*:*) GUESS=hppa1.1-hp-lites ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) GUESS=c1-convex-bsd ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) GUESS=c34-convex-bsd ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) GUESS=c38-convex-bsd ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) GUESS=c4-convex-bsd ;; CRAY*Y-MP:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=ymp-cray-unicos$CRAY_REL ;; CRAY*[A-Z]90:*:*:*) echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=t90-cray-unicos$CRAY_REL ;; CRAY*T3E:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=alphaev5-cray-unicosmk$CRAY_REL ;; CRAY*SV1:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=sv1-cray-unicos$CRAY_REL ;; *:UNICOS/mp:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=craynv-cray-unicosmp$CRAY_REL ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE ;; sparc*:BSD/OS:*:*) GUESS=sparc-unknown-bsdi$UNAME_RELEASE ;; *:BSD/OS:*:*) GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE ;; arm:FreeBSD:*:*) UNAME_PROCESSOR=`uname -p` set_cc_for_build if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi else FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf fi ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case $UNAME_PROCESSOR in amd64) UNAME_PROCESSOR=x86_64 ;; i386) UNAME_PROCESSOR=i586 ;; esac FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL ;; i*:CYGWIN*:*) GUESS=$UNAME_MACHINE-pc-cygwin ;; *:MINGW64*:*) GUESS=$UNAME_MACHINE-pc-mingw64 ;; *:MINGW*:*) GUESS=$UNAME_MACHINE-pc-mingw32 ;; *:MSYS*:*) GUESS=$UNAME_MACHINE-pc-msys ;; i*:PW*:*) GUESS=$UNAME_MACHINE-pc-pw32 ;; *:SerenityOS:*:*) GUESS=$UNAME_MACHINE-pc-serenity ;; *:Interix*:*) case $UNAME_MACHINE in x86) GUESS=i586-pc-interix$UNAME_RELEASE ;; authenticamd | genuineintel | EM64T) GUESS=x86_64-unknown-interix$UNAME_RELEASE ;; IA64) GUESS=ia64-unknown-interix$UNAME_RELEASE ;; esac ;; i*:UWIN*:*) GUESS=$UNAME_MACHINE-pc-uwin ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) GUESS=x86_64-pc-cygwin ;; prep*:SunOS:5.*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=powerpcle-unknown-solaris2$SUN_REL ;; *:GNU:*:*) # the GNU system GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'` GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'` GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL ;; *:GNU/*:*:*) # other systems with GNU libc and userland GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"` GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC ;; *:Minix:*:*) GUESS=$UNAME_MACHINE-unknown-minix ;; aarch64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; arm*:Linux:*:*) set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then GUESS=$UNAME_MACHINE-unknown-linux-$LIBC else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi else GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf fi fi ;; avr32*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; cris:Linux:*:*) GUESS=$UNAME_MACHINE-axis-linux-$LIBC ;; crisv32:Linux:*:*) GUESS=$UNAME_MACHINE-axis-linux-$LIBC ;; e2k:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; frv:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; hexagon:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; i*86:Linux:*:*) GUESS=$UNAME_MACHINE-pc-linux-$LIBC ;; ia64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; k1om:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; m32r*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; m68*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; mips:Linux:*:* | mips64:Linux:*:*) set_cc_for_build IS_GLIBC=0 test x"${LIBC}" = xgnu && IS_GLIBC=1 sed 's/^ //' << EOF > "$dummy.c" #undef CPU #undef mips #undef mipsel #undef mips64 #undef mips64el #if ${IS_GLIBC} && defined(_ABI64) LIBCABI=gnuabi64 #else #if ${IS_GLIBC} && defined(_ABIN32) LIBCABI=gnuabin32 #else LIBCABI=${LIBC} #endif #endif #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 CPU=mipsisa64r6 #else #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 CPU=mipsisa32r6 #else #if defined(__mips64) CPU=mips64 #else CPU=mips #endif #endif #endif #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) MIPS_ENDIAN=el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) MIPS_ENDIAN= #else MIPS_ENDIAN= #endif #endif EOF cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'` eval "$cc_set_vars" test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } ;; mips64el:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; openrisc*:Linux:*:*) GUESS=or1k-unknown-linux-$LIBC ;; or32:Linux:*:* | or1k*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; padre:Linux:*:*) GUESS=sparc-unknown-linux-$LIBC ;; parisc64:Linux:*:* | hppa64:Linux:*:*) GUESS=hppa64-unknown-linux-$LIBC ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;; PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;; *) GUESS=hppa-unknown-linux-$LIBC ;; esac ;; ppc64:Linux:*:*) GUESS=powerpc64-unknown-linux-$LIBC ;; ppc:Linux:*:*) GUESS=powerpc-unknown-linux-$LIBC ;; ppc64le:Linux:*:*) GUESS=powerpc64le-unknown-linux-$LIBC ;; ppcle:Linux:*:*) GUESS=powerpcle-unknown-linux-$LIBC ;; riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; s390:Linux:*:* | s390x:Linux:*:*) GUESS=$UNAME_MACHINE-ibm-linux-$LIBC ;; sh64*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; sh*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; sparc:Linux:*:* | sparc64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; tile*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; vax:Linux:*:*) GUESS=$UNAME_MACHINE-dec-linux-$LIBC ;; x86_64:Linux:*:*) set_cc_for_build LIBCABI=$LIBC if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_X32 >/dev/null then LIBCABI=${LIBC}x32 fi fi GUESS=$UNAME_MACHINE-pc-linux-$LIBCABI ;; xtensa*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. GUESS=i386-sequent-sysv4 ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. GUESS=$UNAME_MACHINE-pc-os2-emx ;; i*86:XTS-300:*:STOP) GUESS=$UNAME_MACHINE-unknown-stop ;; i*86:atheos:*:*) GUESS=$UNAME_MACHINE-unknown-atheos ;; i*86:syllable:*:*) GUESS=$UNAME_MACHINE-pc-syllable ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) GUESS=i386-unknown-lynxos$UNAME_RELEASE ;; i*86:*DOS:*:*) GUESS=$UNAME_MACHINE-pc-msdosdjgpp ;; i*86:*:4.*:*) UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL else GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL fi ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL else GUESS=$UNAME_MACHINE-pc-sysv32 fi ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. GUESS=i586-pc-msdosdjgpp ;; Intel:Mach:3*:*) GUESS=i386-pc-mach3 ;; paragon:*:*:*) GUESS=i860-intel-osf1 ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4 fi ;; mini*:CTIX:SYS*5:*) # "miniframe" GUESS=m68010-convergent-sysv ;; mc68k:UNIX:SYSTEM5:3.51m) GUESS=m68k-convergent-sysv ;; M680?0:D-NIX:5.3:*) GUESS=m68k-diab-dnix ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) GUESS=m68k-unknown-lynxos$UNAME_RELEASE ;; mc68030:UNIX_System_V:4.*:*) GUESS=m68k-atari-sysv4 ;; TSUNAMI:LynxOS:2.*:*) GUESS=sparc-unknown-lynxos$UNAME_RELEASE ;; rs6000:LynxOS:2.*:*) GUESS=rs6000-unknown-lynxos$UNAME_RELEASE ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) GUESS=powerpc-unknown-lynxos$UNAME_RELEASE ;; SM[BE]S:UNIX_SV:*:*) GUESS=mips-dde-sysv$UNAME_RELEASE ;; RM*:ReliantUNIX-*:*:*) GUESS=mips-sni-sysv4 ;; RM*:SINIX-*:*:*) GUESS=mips-sni-sysv4 ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` GUESS=$UNAME_MACHINE-sni-sysv4 else GUESS=ns32k-sni-sysv fi ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says GUESS=i586-unisys-sysv4 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm GUESS=hppa1.1-stratus-sysv4 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. GUESS=i860-stratus-sysv4 ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. GUESS=$UNAME_MACHINE-stratus-vos ;; *:VOS:*:*) # From Paul.Green@stratus.com. GUESS=hppa1.1-stratus-vos ;; mc68*:A/UX:*:*) GUESS=m68k-apple-aux$UNAME_RELEASE ;; news*:NEWS-OS:6*:*) GUESS=mips-sony-newsos6 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if test -d /usr/nec; then GUESS=mips-nec-sysv$UNAME_RELEASE else GUESS=mips-unknown-sysv$UNAME_RELEASE fi ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. GUESS=powerpc-be-beos ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. GUESS=powerpc-apple-beos ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. GUESS=i586-pc-beos ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. GUESS=i586-pc-haiku ;; x86_64:Haiku:*:*) GUESS=x86_64-unknown-haiku ;; SX-4:SUPER-UX:*:*) GUESS=sx4-nec-superux$UNAME_RELEASE ;; SX-5:SUPER-UX:*:*) GUESS=sx5-nec-superux$UNAME_RELEASE ;; SX-6:SUPER-UX:*:*) GUESS=sx6-nec-superux$UNAME_RELEASE ;; SX-7:SUPER-UX:*:*) GUESS=sx7-nec-superux$UNAME_RELEASE ;; SX-8:SUPER-UX:*:*) GUESS=sx8-nec-superux$UNAME_RELEASE ;; SX-8R:SUPER-UX:*:*) GUESS=sx8r-nec-superux$UNAME_RELEASE ;; SX-ACE:SUPER-UX:*:*) GUESS=sxace-nec-superux$UNAME_RELEASE ;; Power*:Rhapsody:*:*) GUESS=powerpc-apple-rhapsody$UNAME_RELEASE ;; *:Rhapsody:*:*) GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE ;; arm64:Darwin:*:*) GUESS=aarch64-apple-darwin$UNAME_RELEASE ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac if command -v xcode-select > /dev/null 2> /dev/null && \ ! xcode-select --print-path > /dev/null 2> /dev/null ; then # Avoid executing cc if there is no toolchain installed as # cc will be a stub that puts up a graphical alert # prompting the user to install developer tools. CC_FOR_BUILD=no_compiler_found else set_cc_for_build fi if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_PPC >/dev/null then UNAME_PROCESSOR=powerpc fi elif test "$UNAME_PROCESSOR" = i386 ; then # uname -m returns i386 or x86_64 UNAME_PROCESSOR=$UNAME_MACHINE fi GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE ;; *:QNX:*:4*) GUESS=i386-pc-qnx ;; NEO-*:NONSTOP_KERNEL:*:*) GUESS=neo-tandem-nsk$UNAME_RELEASE ;; NSE-*:NONSTOP_KERNEL:*:*) GUESS=nse-tandem-nsk$UNAME_RELEASE ;; NSR-*:NONSTOP_KERNEL:*:*) GUESS=nsr-tandem-nsk$UNAME_RELEASE ;; NSV-*:NONSTOP_KERNEL:*:*) GUESS=nsv-tandem-nsk$UNAME_RELEASE ;; NSX-*:NONSTOP_KERNEL:*:*) GUESS=nsx-tandem-nsk$UNAME_RELEASE ;; *:NonStop-UX:*:*) GUESS=mips-compaq-nonstopux ;; BS2000:POSIX*:*:*) GUESS=bs2000-siemens-sysv ;; DS/*:UNIX_System_V:*:*) GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "${cputype-}" = 386; then UNAME_MACHINE=i386 elif test "x${cputype-}" != x; then UNAME_MACHINE=$cputype fi GUESS=$UNAME_MACHINE-unknown-plan9 ;; *:TOPS-10:*:*) GUESS=pdp10-unknown-tops10 ;; *:TENEX:*:*) GUESS=pdp10-unknown-tenex ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) GUESS=pdp10-dec-tops20 ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) GUESS=pdp10-xkl-tops20 ;; *:TOPS-20:*:*) GUESS=pdp10-unknown-tops20 ;; *:ITS:*:*) GUESS=pdp10-unknown-its ;; SEI:*:*:SEIUX) GUESS=mips-sei-seiux$UNAME_RELEASE ;; *:DragonFly:*:*) DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case $UNAME_MACHINE in A*) GUESS=alpha-dec-vms ;; I*) GUESS=ia64-dec-vms ;; V*) GUESS=vax-dec-vms ;; esac ;; *:XENIX:*:SysV) GUESS=i386-pc-xenix ;; i*86:skyos:*:*) SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'` GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL ;; i*86:rdos:*:*) GUESS=$UNAME_MACHINE-pc-rdos ;; i*86:Fiwix:*:*) GUESS=$UNAME_MACHINE-pc-fiwix ;; *:AROS:*:*) GUESS=$UNAME_MACHINE-unknown-aros ;; x86_64:VMkernel:*:*) GUESS=$UNAME_MACHINE-unknown-esx ;; amd64:Isilon\ OneFS:*:*) GUESS=x86_64-unknown-onefs ;; *:Unleashed:*:*) GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE ;; esac # Do we have a guess based on uname results? if test "x$GUESS" != x; then echo "$GUESS" exit fi # No uname command or uname output not recognized. set_cc_for_build cat > "$dummy.c" < #include #endif #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) #if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) #include #if defined(_SIZE_T_) || defined(SIGLOST) #include #endif #endif #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) #if !defined (ultrix) #include #if defined (BSD) #if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); #else #if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); #else printf ("vax-dec-bsd\n"); exit (0); #endif #endif #else printf ("vax-dec-bsd\n"); exit (0); #endif #else #if defined(_SIZE_T_) || defined(SIGLOST) struct utsname un; uname (&un); printf ("vax-dec-ultrix%s\n", un.release); exit (0); #else printf ("vax-dec-ultrix\n"); exit (0); #endif #endif #endif #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) #if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) #if defined(_SIZE_T_) || defined(SIGLOST) struct utsname *un; uname (&un); printf ("mips-dec-ultrix%s\n", un.release); exit (0); #else printf ("mips-dec-ultrix\n"); exit (0); #endif #endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; } echo "$0: unable to guess system type" >&2 case $UNAME_MACHINE:$UNAME_SYSTEM in mips:Linux | mips64:Linux) # If we got here on MIPS GNU/Linux, output extra information. cat >&2 <&2 <&2 </dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = "$UNAME_MACHINE" UNAME_RELEASE = "$UNAME_RELEASE" UNAME_SYSTEM = "$UNAME_SYSTEM" UNAME_VERSION = "$UNAME_VERSION" EOF fi exit 1 # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: pv-1.9.31/build-aux/config.rpath000077500000000000000000000442161474702661500164570ustar00rootroot00000000000000#! /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-2020 Free Software Foundation, Inc. # Taken from GNU libtool, 2001 # Originally by Gordon Matzigkeit , 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # # The first argument passed to this file is the canonical host specification, # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld # should be set by the caller. # # The set of defined variables is at the end of this script. # Known limitations: # - On IRIX 6.5 with CC="cc", the run time search patch must not be longer # than 256 bytes, otherwise the compiler driver will dump core. The only # known workaround is to choose shorter directory names for the build # directory and/or the installation directory. # All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a shrext=.so host="$1" host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` # Code taken from libtool.m4's _LT_CC_BASENAME. for cc_temp in $CC""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'` # Code taken from libtool.m4's _LT_COMPILER_PIC. wl= if test "$GCC" = yes; then wl='-Wl,' else case "$host_os" in aix*) wl='-Wl,' ;; mingw* | cygwin* | pw32* | os2* | cegcc*) ;; hpux9* | hpux10* | hpux11*) wl='-Wl,' ;; irix5* | irix6* | nonstopux*) wl='-Wl,' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in ecc*) wl='-Wl,' ;; icc* | ifort*) wl='-Wl,' ;; lf95*) wl='-Wl,' ;; nagfor*) wl='-Wl,-Wl,,' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) wl='-Wl,' ;; ccc*) wl='-Wl,' ;; xl* | bgxl* | bgf* | mpixl*) wl='-Wl,' ;; como) wl='-lopt=' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ F* | *Sun*Fortran*) wl= ;; *Sun\ C*) wl='-Wl,' ;; esac ;; esac ;; newsos6) ;; *nto* | *qnx*) ;; osf3* | osf4* | osf5*) wl='-Wl,' ;; rdos*) ;; solaris*) case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) wl='-Qoption ld ' ;; *) wl='-Wl,' ;; esac ;; sunos4*) wl='-Qoption ld ' ;; sysv4 | sysv4.2uw2* | sysv4.3*) wl='-Wl,' ;; sysv4*MP*) ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) wl='-Wl,' ;; unicos*) wl='-Wl,' ;; uts4*) ;; esac fi # Code taken from libtool.m4's _LT_LINKER_SHLIBS. hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no case "$host_os" in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. # Unlike libtool, we use -rpath here, not --rpath, since the documented # option of GNU ld is called -rpath, not --rpath. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' case "$host_os" in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no fi ;; amigaos*) case "$host_cpu" in powerpc) ;; m68k) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then : else ld_shlibs=no fi ;; haiku*) ;; interix[3-9]*) hardcode_direct=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; netbsd*) ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs=no elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' else ld_shlibs=no fi ;; esac ;; sunos4*) hardcode_direct=yes ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then hardcode_libdir_flag_spec= fi else case "$host_os" in aix3*) # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac fi hardcode_direct=yes hardcode_libdir_separator=':' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac fi # Begin _LT_AC_SYS_LIBPATH_AIX. echo 'int main () { return 0; }' > conftest.c ${CC} ${LDFLAGS} conftest.c -o conftest aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` fi if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib" fi rm -f conftest.c conftest # End _LT_AC_SYS_LIBPATH_AIX. if test "$aix_use_runtimelinking" = yes; then hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' else hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" fi fi ;; amigaos*) case "$host_cpu" in powerpc) ;; m68k) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' libext=lib ;; darwin* | rhapsody*) hardcode_direct=no if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then : else ld_shlibs=no fi ;; dgux*) hardcode_libdir_flag_spec='-L$libdir' ;; freebsd2.[01]*) hardcode_direct=yes hardcode_minus_L=yes ;; freebsd* | dragonfly*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; hpux9*) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; hpux10*) if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no ;; *) hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; netbsd*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; newsos6) hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then hardcode_libdir_flag_spec='${wl}-rpath,$libdir' else case "$host_os" in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) hardcode_libdir_flag_spec='-R$libdir' ;; *) hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; osf3*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) if test "$GCC" = yes; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else # Both cc and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; solaris*) hardcode_libdir_flag_spec='-R$libdir' ;; sunos4*) hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes ;; sysv4) case $host_vendor in sni) hardcode_direct=yes # is this really true??? ;; siemens) hardcode_direct=no ;; motorola) hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac ;; sysv4.3*) ;; sysv4*MP*) if test -d /usr/nec; then ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) ;; sysv5* | sco3.2v5* | sco5v6*) hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator=':' ;; uts4*) hardcode_libdir_flag_spec='-L$libdir' ;; *) ld_shlibs=no ;; esac fi # Check dynamic linker characteristics # Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER. # Unlike libtool.m4, here we don't care about _all_ names of the library, but # only about the one the linker finds when passed -lNAME. This is the last # element of library_names_spec in libtool.m4, or possibly two of them if the # linker has special search rules. library_names_spec= # the last element of library_names_spec in libtool.m4 libname_spec='lib$name' case "$host_os" in aix3*) library_names_spec='$libname.a' ;; aix[4-9]*) library_names_spec='$libname$shrext' ;; amigaos*) case "$host_cpu" in powerpc*) library_names_spec='$libname$shrext' ;; m68k) library_names_spec='$libname.a' ;; esac ;; beos*) library_names_spec='$libname$shrext' ;; bsdi[45]*) library_names_spec='$libname$shrext' ;; cygwin* | mingw* | pw32* | cegcc*) shrext=.dll library_names_spec='$libname.dll.a $libname.lib' ;; darwin* | rhapsody*) shrext=.dylib library_names_spec='$libname$shrext' ;; dgux*) library_names_spec='$libname$shrext' ;; freebsd[23].*) library_names_spec='$libname$shrext$versuffix' ;; freebsd* | dragonfly*) library_names_spec='$libname$shrext' ;; gnu*) library_names_spec='$libname$shrext' ;; haiku*) library_names_spec='$libname$shrext' ;; hpux9* | hpux10* | hpux11*) case $host_cpu in ia64*) shrext=.so ;; hppa*64*) shrext=.sl ;; *) shrext=.sl ;; esac library_names_spec='$libname$shrext' ;; interix[3-9]*) library_names_spec='$libname$shrext' ;; irix5* | irix6* | nonstopux*) library_names_spec='$libname$shrext' case "$host_os" in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;; *) libsuff= shlibsuff= ;; esac ;; esac ;; linux*oldld* | linux*aout* | linux*coff*) ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) library_names_spec='$libname$shrext' ;; knetbsd*-gnu) library_names_spec='$libname$shrext' ;; netbsd*) library_names_spec='$libname$shrext' ;; newsos6) library_names_spec='$libname$shrext' ;; *nto* | *qnx*) library_names_spec='$libname$shrext' ;; openbsd*) library_names_spec='$libname$shrext$versuffix' ;; os2*) libname_spec='$name' shrext=.dll library_names_spec='$libname.a' ;; osf3* | osf4* | osf5*) library_names_spec='$libname$shrext' ;; rdos*) ;; solaris*) library_names_spec='$libname$shrext' ;; sunos4*) library_names_spec='$libname$shrext$versuffix' ;; sysv4 | sysv4.3*) library_names_spec='$libname$shrext' ;; sysv4*MP*) library_names_spec='$libname$shrext' ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) library_names_spec='$libname$shrext' ;; tpf*) library_names_spec='$libname$shrext' ;; uts4*) library_names_spec='$libname$shrext' ;; esac sed_quote_subst='s/\(["`$\\]\)/\\\1/g' escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` shlibext=`echo "$shrext" | sed -e 's,^\.,,'` escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # https://git.savannah.gnu.org/cgit/config.git/plain/config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. # The "shellcheck disable" line above the timestamp inhibits complaints # about features and limitations of the classic Bourne shell that were # superseded or lifted in POSIX. However, this script identifies a wide # variety of pre-POSIX systems that do not have POSIX shells at all, and # even some reasonably current systems (Solaris 10 as case-in-point) still # have a pre-POSIX /bin/sh. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; *local*) # First pass through any local machine types. echo "$1" exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Split fields of configuration type # shellcheck disable=SC2162 saved_IFS=$IFS IFS="-" read field1 field2 field3 field4 <&2 exit 1 ;; *-*-*-*) basic_machine=$field1-$field2 basic_os=$field3-$field4 ;; *-*-*) # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two # parts maybe_os=$field2-$field3 case $maybe_os in nto-qnx* | linux-* | uclinux-uclibc* \ | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ | storm-chaos* | os2-emx* | rtmk-nova*) basic_machine=$field1 basic_os=$maybe_os ;; android-linux) basic_machine=$field1-unknown basic_os=linux-android ;; *) basic_machine=$field1-$field2 basic_os=$field3 ;; esac ;; *-*) # A lone config we happen to match not fitting any pattern case $field1-$field2 in decstation-3100) basic_machine=mips-dec basic_os= ;; *-*) # Second component is usually, but not always the OS case $field2 in # Prevent following clause from handling this valid os sun*os*) basic_machine=$field1 basic_os=$field2 ;; zephyr*) basic_machine=$field1-unknown basic_os=$field2 ;; # Manufacturers dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ | unicom* | ibm* | next | hp | isi* | apollo | altos* \ | convergent* | ncr* | news | 32* | 3600* | 3100* \ | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \ | ultra | tti* | harris | dolphin | highlevel | gould \ | cbm | ns | masscomp | apple | axis | knuth | cray \ | microblaze* | sim | cisco \ | oki | wec | wrs | winbond) basic_machine=$field1-$field2 basic_os= ;; *) basic_machine=$field1 basic_os=$field2 ;; esac ;; esac ;; *) # Convert single-component short-hands not valid as part of # multi-component configurations. case $field1 in 386bsd) basic_machine=i386-pc basic_os=bsd ;; a29khif) basic_machine=a29k-amd basic_os=udi ;; adobe68k) basic_machine=m68010-adobe basic_os=scout ;; alliant) basic_machine=fx80-alliant basic_os= ;; altos | altos3068) basic_machine=m68k-altos basic_os= ;; am29k) basic_machine=a29k-none basic_os=bsd ;; amdahl) basic_machine=580-amdahl basic_os=sysv ;; amiga) basic_machine=m68k-unknown basic_os= ;; amigaos | amigados) basic_machine=m68k-unknown basic_os=amigaos ;; amigaunix | amix) basic_machine=m68k-unknown basic_os=sysv4 ;; apollo68) basic_machine=m68k-apollo basic_os=sysv ;; apollo68bsd) basic_machine=m68k-apollo basic_os=bsd ;; aros) basic_machine=i386-pc basic_os=aros ;; aux) basic_machine=m68k-apple basic_os=aux ;; balance) basic_machine=ns32k-sequent basic_os=dynix ;; blackfin) basic_machine=bfin-unknown basic_os=linux ;; cegcc) basic_machine=arm-unknown basic_os=cegcc ;; convex-c1) basic_machine=c1-convex basic_os=bsd ;; convex-c2) basic_machine=c2-convex basic_os=bsd ;; convex-c32) basic_machine=c32-convex basic_os=bsd ;; convex-c34) basic_machine=c34-convex basic_os=bsd ;; convex-c38) basic_machine=c38-convex basic_os=bsd ;; cray) basic_machine=j90-cray basic_os=unicos ;; crds | unos) basic_machine=m68k-crds basic_os= ;; da30) basic_machine=m68k-da30 basic_os= ;; decstation | pmax | pmin | dec3100 | decstatn) basic_machine=mips-dec basic_os= ;; delta88) basic_machine=m88k-motorola basic_os=sysv3 ;; dicos) basic_machine=i686-pc basic_os=dicos ;; djgpp) basic_machine=i586-pc basic_os=msdosdjgpp ;; ebmon29k) basic_machine=a29k-amd basic_os=ebmon ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson basic_os=ose ;; gmicro) basic_machine=tron-gmicro basic_os=sysv ;; go32) basic_machine=i386-pc basic_os=go32 ;; h8300hms) basic_machine=h8300-hitachi basic_os=hms ;; h8300xray) basic_machine=h8300-hitachi basic_os=xray ;; h8500hms) basic_machine=h8500-hitachi basic_os=hms ;; harris) basic_machine=m88k-harris basic_os=sysv3 ;; hp300 | hp300hpux) basic_machine=m68k-hp basic_os=hpux ;; hp300bsd) basic_machine=m68k-hp basic_os=bsd ;; hppaosf) basic_machine=hppa1.1-hp basic_os=osf ;; hppro) basic_machine=hppa1.1-hp basic_os=proelf ;; i386mach) basic_machine=i386-mach basic_os=mach ;; isi68 | isi) basic_machine=m68k-isi basic_os=sysv ;; m68knommu) basic_machine=m68k-unknown basic_os=linux ;; magnum | m3230) basic_machine=mips-mips basic_os=sysv ;; merlin) basic_machine=ns32k-utek basic_os=sysv ;; mingw64) basic_machine=x86_64-pc basic_os=mingw64 ;; mingw32) basic_machine=i686-pc basic_os=mingw32 ;; mingw32ce) basic_machine=arm-unknown basic_os=mingw32ce ;; monitor) basic_machine=m68k-rom68k basic_os=coff ;; morphos) basic_machine=powerpc-unknown basic_os=morphos ;; moxiebox) basic_machine=moxie-unknown basic_os=moxiebox ;; msdos) basic_machine=i386-pc basic_os=msdos ;; msys) basic_machine=i686-pc basic_os=msys ;; mvs) basic_machine=i370-ibm basic_os=mvs ;; nacl) basic_machine=le32-unknown basic_os=nacl ;; ncr3000) basic_machine=i486-ncr basic_os=sysv4 ;; netbsd386) basic_machine=i386-pc basic_os=netbsd ;; netwinder) basic_machine=armv4l-rebel basic_os=linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony basic_os=newsos ;; news1000) basic_machine=m68030-sony basic_os=newsos ;; necv70) basic_machine=v70-nec basic_os=sysv ;; nh3000) basic_machine=m68k-harris basic_os=cxux ;; nh[45]000) basic_machine=m88k-harris basic_os=cxux ;; nindy960) basic_machine=i960-intel basic_os=nindy ;; mon960) basic_machine=i960-intel basic_os=mon960 ;; nonstopux) basic_machine=mips-compaq basic_os=nonstopux ;; os400) basic_machine=powerpc-ibm basic_os=os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson basic_os=ose ;; os68k) basic_machine=m68k-none basic_os=os68k ;; paragon) basic_machine=i860-intel basic_os=osf ;; parisc) basic_machine=hppa-unknown basic_os=linux ;; psp) basic_machine=mipsallegrexel-sony basic_os=psp ;; pw32) basic_machine=i586-unknown basic_os=pw32 ;; rdos | rdos64) basic_machine=x86_64-pc basic_os=rdos ;; rdos32) basic_machine=i386-pc basic_os=rdos ;; rom68k) basic_machine=m68k-rom68k basic_os=coff ;; sa29200) basic_machine=a29k-amd basic_os=udi ;; sei) basic_machine=mips-sei basic_os=seiux ;; sequent) basic_machine=i386-sequent basic_os= ;; sps7) basic_machine=m68k-bull basic_os=sysv2 ;; st2000) basic_machine=m68k-tandem basic_os= ;; stratus) basic_machine=i860-stratus basic_os=sysv4 ;; sun2) basic_machine=m68000-sun basic_os= ;; sun2os3) basic_machine=m68000-sun basic_os=sunos3 ;; sun2os4) basic_machine=m68000-sun basic_os=sunos4 ;; sun3) basic_machine=m68k-sun basic_os= ;; sun3os3) basic_machine=m68k-sun basic_os=sunos3 ;; sun3os4) basic_machine=m68k-sun basic_os=sunos4 ;; sun4) basic_machine=sparc-sun basic_os= ;; sun4os3) basic_machine=sparc-sun basic_os=sunos3 ;; sun4os4) basic_machine=sparc-sun basic_os=sunos4 ;; sun4sol2) basic_machine=sparc-sun basic_os=solaris2 ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun basic_os= ;; sv1) basic_machine=sv1-cray basic_os=unicos ;; symmetry) basic_machine=i386-sequent basic_os=dynix ;; t3e) basic_machine=alphaev5-cray basic_os=unicos ;; t90) basic_machine=t90-cray basic_os=unicos ;; toad1) basic_machine=pdp10-xkl basic_os=tops20 ;; tpf) basic_machine=s390x-ibm basic_os=tpf ;; udi29k) basic_machine=a29k-amd basic_os=udi ;; ultra3) basic_machine=a29k-nyu basic_os=sym1 ;; v810 | necv810) basic_machine=v810-nec basic_os=none ;; vaxv) basic_machine=vax-dec basic_os=sysv ;; vms) basic_machine=vax-dec basic_os=vms ;; vsta) basic_machine=i386-pc basic_os=vsta ;; vxworks960) basic_machine=i960-wrs basic_os=vxworks ;; vxworks68) basic_machine=m68k-wrs basic_os=vxworks ;; vxworks29k) basic_machine=a29k-wrs basic_os=vxworks ;; xbox) basic_machine=i686-pc basic_os=mingw32 ;; ymp) basic_machine=ymp-cray basic_os=unicos ;; *) basic_machine=$1 basic_os= ;; esac ;; esac # Decode 1-component or ad-hoc basic machines case $basic_machine in # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) cpu=hppa1.1 vendor=winbond ;; op50n) cpu=hppa1.1 vendor=oki ;; op60c) cpu=hppa1.1 vendor=oki ;; ibm*) cpu=i370 vendor=ibm ;; orion105) cpu=clipper vendor=highlevel ;; mac | mpw | mac-mpw) cpu=m68k vendor=apple ;; pmac | pmac-mpw) cpu=powerpc vendor=apple ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) cpu=m68000 vendor=att ;; 3b*) cpu=we32k vendor=att ;; bluegene*) cpu=powerpc vendor=ibm basic_os=cnk ;; decsystem10* | dec10*) cpu=pdp10 vendor=dec basic_os=tops10 ;; decsystem20* | dec20*) cpu=pdp10 vendor=dec basic_os=tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) cpu=m68k vendor=motorola ;; dpx2*) cpu=m68k vendor=bull basic_os=sysv3 ;; encore | umax | mmax) cpu=ns32k vendor=encore ;; elxsi) cpu=elxsi vendor=elxsi basic_os=${basic_os:-bsd} ;; fx2800) cpu=i860 vendor=alliant ;; genix) cpu=ns32k vendor=ns ;; h3050r* | hiux*) cpu=hppa1.1 vendor=hitachi basic_os=hiuxwe2 ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) cpu=m68000 vendor=hp ;; hp9k3[2-9][0-9]) cpu=m68k vendor=hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) cpu=hppa1.1 vendor=hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp cpu=hppa1.1 vendor=hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp cpu=hppa1.1 vendor=hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) cpu=hppa1.1 vendor=hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; i*86v32) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=sysv32 ;; i*86v4*) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=sysv4 ;; i*86v) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=sysv ;; i*86sol2) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=solaris2 ;; j90 | j90-cray) cpu=j90 vendor=cray basic_os=${basic_os:-unicos} ;; iris | iris4d) cpu=mips vendor=sgi case $basic_os in irix*) ;; *) basic_os=irix4 ;; esac ;; miniframe) cpu=m68000 vendor=convergent ;; *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) cpu=m68k vendor=atari basic_os=mint ;; news-3600 | risc-news) cpu=mips vendor=sony basic_os=newsos ;; next | m*-next) cpu=m68k vendor=next case $basic_os in openstep*) ;; nextstep*) ;; ns2*) basic_os=nextstep2 ;; *) basic_os=nextstep3 ;; esac ;; np1) cpu=np1 vendor=gould ;; op50n-* | op60c-*) cpu=hppa1.1 vendor=oki basic_os=proelf ;; pa-hitachi) cpu=hppa1.1 vendor=hitachi basic_os=hiuxwe2 ;; pbd) cpu=sparc vendor=tti ;; pbb) cpu=m68k vendor=tti ;; pc532) cpu=ns32k vendor=pc532 ;; pn) cpu=pn vendor=gould ;; power) cpu=power vendor=ibm ;; ps2) cpu=i386 vendor=ibm ;; rm[46]00) cpu=mips vendor=siemens ;; rtpc | rtpc-*) cpu=romp vendor=ibm ;; sde) cpu=mipsisa32 vendor=sde basic_os=${basic_os:-elf} ;; simso-wrs) cpu=sparclite vendor=wrs basic_os=vxworks ;; tower | tower-32) cpu=m68k vendor=ncr ;; vpp*|vx|vx-*) cpu=f301 vendor=fujitsu ;; w65) cpu=w65 vendor=wdc ;; w89k-*) cpu=hppa1.1 vendor=winbond basic_os=proelf ;; none) cpu=none vendor=none ;; leon|leon[3-9]) cpu=sparc vendor=$basic_machine ;; leon-*|leon[3-9]-*) cpu=sparc vendor=`echo "$basic_machine" | sed 's/-.*//'` ;; *-*) # shellcheck disable=SC2162 saved_IFS=$IFS IFS="-" read cpu vendor <&2 exit 1 ;; esac ;; esac # Here we canonicalize certain aliases for manufacturers. case $vendor in digital*) vendor=dec ;; commodore*) vendor=cbm ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if test x$basic_os != x then # First recognize some ad-hoc cases, or perhaps split kernel-os, or else just # set os. case $basic_os in gnu/linux*) kernel=linux os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'` ;; os2-emx) kernel=os2 os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'` ;; nto-qnx*) kernel=nto os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'` ;; *-*) # shellcheck disable=SC2162 saved_IFS=$IFS IFS="-" read kernel os <&2 exit 1 ;; esac # As a final step for OS-related things, validate the OS-kernel combination # (given a valid OS), if there is a kernel. case $kernel-$os in linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \ | linux-musl* | linux-relibc* | linux-uclibc* ) ;; uclinux-uclibc* ) ;; -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* ) # These are just libc implementations, not actual OSes, and thus # require a kernel. echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2 exit 1 ;; kfreebsd*-gnu* | kopensolaris*-gnu*) ;; vxworks-simlinux | vxworks-simwindows | vxworks-spe) ;; nto-qnx*) ;; os2-emx) ;; *-eabi* | *-gnueabi*) ;; -*) # Blank kernel with real OS is always fine. ;; *-*) echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2 exit 1 ;; esac # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. case $vendor in unknown) case $cpu-$os in *-riscix*) vendor=acorn ;; *-sunos*) vendor=sun ;; *-cnk* | *-aix*) vendor=ibm ;; *-beos*) vendor=be ;; *-hpux*) vendor=hp ;; *-mpeix*) vendor=hp ;; *-hiux*) vendor=hitachi ;; *-unos*) vendor=crds ;; *-dgux*) vendor=dg ;; *-luna*) vendor=omron ;; *-genix*) vendor=ns ;; *-clix*) vendor=intergraph ;; *-mvs* | *-opened*) vendor=ibm ;; *-os400*) vendor=ibm ;; s390-* | s390x-*) vendor=ibm ;; *-ptx*) vendor=sequent ;; *-tpf*) vendor=ibm ;; *-vxsim* | *-vxworks* | *-windiss*) vendor=wrs ;; *-aux*) vendor=apple ;; *-hms*) vendor=hitachi ;; *-mpw* | *-macos*) vendor=apple ;; *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*) vendor=atari ;; *-vos*) vendor=stratus ;; esac ;; esac echo "$cpu-$vendor-${kernel:+$kernel-}$os" exit # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: pv-1.9.31/build-aux/depcomp000077500000000000000000000560201474702661500155200ustar00rootroot00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2018-03-07.03; # UTC # Copyright (C) 1999-2021 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interferences from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: pv-1.9.31/build-aux/install-sh000077500000000000000000000357761474702661500161660ustar00rootroot00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2020-11-14.01; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. tab=' ' nl=' ' IFS=" $tab$nl" # Set DOITPROG to "echo" to test this script. doit=${DOITPROG-} doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_mkdir= # Desired mode of installed file. mode=0755 # Create dirs (including intermediate dirs) using mode 755. # This is like GNU 'install' as of coreutils 8.32 (2020). mkdir_umask=22 backupsuffix= chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -p pass -p to $cpprog. -s $stripprog installed files. -S SUFFIX attempt to back up existing files, with suffix SUFFIX. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG By default, rm is invoked with -f; when overridden with RMPROG, it's up to you to specify -f if you want it. If -S is not specified, no backups are attempted. Email bug reports to bug-automake@gnu.org. Automake home page: https://www.gnu.org/software/automake/ " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -p) cpprog="$cpprog -p";; -s) stripcmd=$stripprog;; -S) backupsuffix="$2" shift;; -t) is_target_a_directory=always dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done # We allow the use of options -d and -T together, by making -d # take the precedence; this is for compatibility with GNU install. if test -n "$dir_arg"; then if test -n "$dst_arg"; then echo "$0: target directory not allowed when installing a directory." >&2 exit 1 fi fi if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then if test $# -gt 1 || test "$is_target_a_directory" = always; then if test ! -d "$dst_arg"; then echo "$0: $dst_arg: Is not a directory." >&2 exit 1 fi fi fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? # Don't chown directories that already exist. if test $dstdir_status = 0; then chowncmd="" fi else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dstbase=`basename "$src"` case $dst in */) dst=$dst$dstbase;; *) dst=$dst/$dstbase;; esac dstdir_status=0 else dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi case $dstdir in */) dstdirslash=$dstdir;; *) dstdirslash=$dstdir/;; esac obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false # The $RANDOM variable is not portable (e.g., dash). Use it # here however when possible just to lower collision chance. tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap ' ret=$? rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null exit $ret ' 0 # Because "mkdir -p" follows existing symlinks and we likely work # directly in world-writeable /tmp, make sure that the '$tmpdir' # directory is successfully created first before we actually test # 'mkdir -p'. if (umask $mkdir_umask && $mkdirprog $mkdir_mode "$tmpdir" && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. test_tmpdir="$tmpdir/a" ls_ld_tmpdir=`ls -ld "$test_tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null fi trap '' 0;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac oIFS=$IFS IFS=/ set -f set fnord $dstdir shift set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=${dstdirslash}_inst.$$_ rmtmp=${dstdirslash}_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && { test -z "$stripcmd" || { # Create $dsttmp read-write so that cp doesn't create it read-only, # which would cause strip to fail. if test -z "$doit"; then : >"$dsttmp" # No need to fork-exec 'touch'. else $doit touch "$dsttmp" fi } } && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # If $backupsuffix is set, and the file being installed # already exists, attempt a backup. Don't worry if it fails, # e.g., if mv doesn't support -f. if test -n "$backupsuffix" && test -f "$dst"; then $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null fi # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: pv-1.9.31/build-aux/missing000077500000000000000000000153361474702661500155470ustar00rootroot00000000000000#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1996-2021 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=https://www.perl.org/ flex_URL=https://github.com/westes/flex gnu_software_URL=https://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: pv-1.9.31/build-aux/test-driver000077500000000000000000000114171474702661500163420ustar00rootroot00000000000000#! /bin/sh # test-driver - basic testsuite driver script. scriptversion=2018-03-07.03; # UTC # Copyright (C) 2011-2021 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . # Make unconditional expansion of undefined variables an error. This # helps a lot in preventing typo-related bugs. set -u usage_error () { echo "$0: $*" >&2 print_usage >&2 exit 2 } print_usage () { cat <"$log_file" "$@" >>"$log_file" 2>&1 estatus=$? if test $enable_hard_errors = no && test $estatus -eq 99; then tweaked_estatus=1 else tweaked_estatus=$estatus fi case $tweaked_estatus:$expect_failure in 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; 0:*) col=$grn res=PASS recheck=no gcopy=no;; 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; *:*) col=$red res=FAIL recheck=yes gcopy=yes;; esac # Report the test outcome and exit status in the logs, so that one can # know whether the test passed or failed simply by looking at the '.log' # file, without the need of also peaking into the corresponding '.trs' # file (automake bug#11814). echo "$res $test_name (exit status: $estatus)" >>"$log_file" # Report outcome to console. echo "${col}${res}${std}: $test_name" # Register the test result, and other relevant metadata. echo ":test-result: $res" > $trs_file echo ":global-test-result: $res" >> $trs_file echo ":recheck: $recheck" >> $trs_file echo ":copy-in-global-log: $gcopy" >> $trs_file # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: pv-1.9.31/configure000077500000000000000000011653311474702661500141670ustar00rootroot00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.71 for pv 1.9.31. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, # Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi # Reset variables that may have inherited troublesome values from # the environment. # IFS needs to be set, to space, tab, and newline, in precisely that order. # (If _AS_PATH_WALK were called with IFS unset, it would have the # side effect of setting IFS to empty, thus disabling word splitting.) # Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl IFS=" "" $as_nl" PS1='$ ' PS2='> ' PS4='+ ' # Ensure predictable behavior from utilities with locale-dependent output. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # We cannot yet rely on "unset" to work, but we need these variables # to be unset--not just set to an empty or harmless value--now, to # avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct # also avoids known problems related to "unset" and subshell syntax # in other old shells (e.g. bash 2.01 and pdksh 5.2.14). for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH do eval test \${$as_var+y} \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done # Ensure that fds 0, 1, and 2 are open. if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="as_nop=: if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else \$as_nop case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ) then : else \$as_nop exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 blah=\$(echo \$(echo blah)) test x\"\$blah\" = xblah || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null then : as_have_required=yes else $as_nop as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null then : else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$as_shell as_have_required=yes if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null then : break 2 fi fi done;; esac as_found=false done IFS=$as_save_IFS if $as_found then : else $as_nop if { test -f "$SHELL" || test -f "$SHELL.exe"; } && as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$SHELL as_have_required=yes fi fi if test "x$CONFIG_SHELL" != x then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno then : printf "%s\n" "$0: This script requires a shell more modern than all" printf "%s\n" "$0: the shells that I found on your system." if test ${ZSH_VERSION+y} ; then printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." else printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and pv@ivarch.com $0: about your system, including any error possibly output $0: before this message. Then install a modern shell, or $0: manually run the script under such a shell if you do $0: have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_nop # --------- # Do nothing but, unlike ":", preserve the value of $?. as_fn_nop () { return $? } as_nop=as_fn_nop # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null then : eval 'as_fn_append () { eval $1+=\$2 }' else $as_nop as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null then : eval 'as_fn_arith () { as_val=$(( $* )) }' else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_nop # --------- # Do nothing but, unlike ":", preserve the value of $?. as_fn_nop () { return $? } as_nop=as_fn_nop # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } # Determine whether it's possible to make 'echo' print without a newline. # These variables are no longer used directly by Autoconf, but are AC_SUBSTed # for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac # For backward compatibility with old third-party macros, we provide # the shell variables $as_echo and $as_echo_n. New code should use # AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. as_echo='printf %s\n' as_echo_n='printf %s' rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" 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='pv' PACKAGE_TARNAME='pv' PACKAGE_VERSION='1.9.31' PACKAGE_STRING='pv 1.9.31' PACKAGE_BUGREPORT='pv@ivarch.com' PACKAGE_URL='https://www.ivarch.com/programs/pv.shtml' ac_unique_file="src/include/config.h.in" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_STDIO_H # include #endif #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_header_c_list= gt_needs= ac_c_werror_flag= ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS POSUB LTLIBINTL LIBINTL INTLLIBS LTLIBICONV LIBICONV INTL_MACOSX_LIBS EGREP GREP CPP host_os host_vendor host_cpu host build_os build_vendor build_cpu build XGETTEXT_EXTRA_OPTIONS MSGMERGE_FOR_MSGFMT_OPTION MSGMERGE XGETTEXT_015 XGETTEXT GMSGFMT_015 GMSGFMT MSGFMT GETTEXT_MACRO_VERSION USE_NLS SED am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V CSCOPE ETAGS CTAGS am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir runstatedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL am__quote' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_dependency_tracking enable_largefile enable_nls with_gnu_ld enable_rpath with_libiconv_prefix with_libintl_prefix enable_debugging enable_profiling enable_splice enable_ipc with_ncurses enable_static ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -runstatedir | --runstatedir | --runstatedi | --runstated \ | --runstate | --runstat | --runsta | --runst | --runs \ | --run | --ru | --r) ac_prev=runstatedir ;; -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ | --run=* | --ru=* | --r=*) runstatedir=$ac_optarg ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures pv 1.9.31 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/pv] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of pv 1.9.31:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --disable-largefile omit support for large files --disable-nls do not use Native Language Support --disable-rpath do not hardcode runtime library paths --enable-debugging compile with debugging support --enable-profiling compile with profiling support --disable-splice do not use splice system call --disable-ipc turn off IPC messaging --enable-static enable static linking Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib --without-libiconv-prefix don't search for libiconv in includedir and libdir --with-libintl-prefix[=DIR] search for libintl in DIR/include and DIR/lib --without-libintl-prefix don't search for libintl in includedir and libdir --without-ncurses disable the use of ncurses for terminal info 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 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 . pv home page: . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for configure.gnu first; this name is used for a wrapper for # Metaconfig's "Configure" on case-insensitive file systems. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF pv configure 1.9.31 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext then : ac_retval=0 else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$3=yes" else $as_nop eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else $as_nop eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else $as_nop eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err } then : ac_retval=0 else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext } then : ac_retval=0 else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_try_run LINENO # ---------------------- # Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that # executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; } then : ac_retval=0 else $as_nop printf "%s\n" "$as_me: program exited with status $ac_status" >&5 printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. */ #include #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main (void) { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$3=yes" else $as_nop eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES # ---------------------------------------------------- # Tries to find if the field MEMBER exists in type AGGR, after including # INCLUDES, setting cache variable VAR accordingly. ac_fn_c_check_member () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 printf %s "checking for $2.$3... " >&6; } if eval test \${$4+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main (void) { static $2 ac_aggr; if (ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$4=yes" else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main (void) { static $2 ac_aggr; if (sizeof ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$4=yes" else $as_nop eval "$4=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$4 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_member # ac_fn_check_decl LINENO SYMBOL VAR INCLUDES EXTRA-OPTIONS FLAG-VAR # ------------------------------------------------------------------ # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR # accordingly. Pass EXTRA-OPTIONS to the compiler, using FLAG-VAR. ac_fn_check_decl () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack as_decl_name=`echo $2|sed 's/ *(.*//'` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 printf %s "checking whether $as_decl_name is declared... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else $as_nop as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` eval ac_save_FLAGS=\$$6 as_fn_append $6 " $5" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { #ifndef $as_decl_name #ifdef __cplusplus (void) $as_decl_use; #else (void) $as_decl_name; #endif #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$3=yes" else $as_nop eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext eval $6=\$ac_save_FLAGS fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_check_decl # ac_fn_c_find_intX_t LINENO BITS VAR # ----------------------------------- # Finds a signed integer type with width BITS, setting cache variable VAR # accordingly. ac_fn_c_find_intX_t () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5 printf %s "checking for int$2_t... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else $as_nop eval "$3=no" # Order is important - never check a type that is potentially smaller # than half of the expected target width. for ac_type in int$2_t 'int' 'long int' \ 'long long int' 'short int' 'signed char'; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default enum { N = $2 / 2 - 1 }; int main (void) { static int test_array [1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default enum { N = $2 / 2 - 1 }; int main (void) { static int test_array [1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1) < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else $as_nop case $ac_type in #( int$2_t) : eval "$3=yes" ;; #( *) : eval "$3=\$ac_type" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext if eval test \"x\$"$3"\" = x"no" then : else $as_nop break fi done fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_find_intX_t ac_configure_args_raw= for ac_arg do case $ac_arg in *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append ac_configure_args_raw " '$ac_arg'" done case $ac_configure_args_raw in *$as_nl*) ac_safe_unquote= ;; *) ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. ac_unsafe_a="$ac_unsafe_z#~" ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; esac cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by pv $as_me 1.9.31, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac printf "%s\n" "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Sanitize IFS. IFS=" "" $as_nl" # Save into config.log some information that might help in debugging. { echo printf "%s\n" "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo printf "%s\n" "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then printf "%s\n" "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then printf "%s\n" "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && printf "%s\n" "$as_me: caught signal $ac_signal" printf "%s\n" "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h printf "%s\n" "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then ac_site_files="$CONFIG_SITE" elif test "x$prefix" != xNONE; then ac_site_files="$prefix/share/config.site $prefix/etc/config.site" else ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi for ac_site_file in $ac_site_files do case $ac_site_file in #( */*) : ;; #( *) : ac_site_file=./$ac_site_file ;; esac if test -f "$ac_site_file" && test -r "$ac_site_file"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 printf "%s\n" "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 printf "%s\n" "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Test code for whether the C compiler supports C89 (global declarations) ac_c_conftest_c89_globals=' /* Does the compiler advertise C89 conformance? Do not test the value of __STDC__, because some compilers set it to 0 while being otherwise adequately conformant. */ #if !defined __STDC__ # error "Compiler does not advertise C89 conformance" #endif #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ struct buf { int x; }; struct buf * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not \xHH hex character constants. These do not provoke an error unfortunately, instead are silently treated as an "x". The following induces an error, until -std is added to get proper ANSI mode. Curiously \x00 != x always comes out true, for an array size at least. It is necessary to write \x00 == 0 to get something that is true only with -std. */ int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) '\''x'\'' int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), int, int);' # Test code for whether the C compiler supports C89 (body of main). ac_c_conftest_c89_main=' ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); ' # Test code for whether the C compiler supports C99 (global declarations) ac_c_conftest_c99_globals=' // Does the compiler advertise C99 conformance? #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L # error "Compiler does not advertise C99 conformance" #endif #include extern int puts (const char *); extern int printf (const char *, ...); extern int dprintf (int, const char *, ...); extern void *malloc (size_t); // Check varargs macros. These examples are taken from C99 6.10.3.5. // dprintf is used instead of fprintf to avoid needing to declare // FILE and stderr. #define debug(...) dprintf (2, __VA_ARGS__) #define showlist(...) puts (#__VA_ARGS__) #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) static void test_varargs_macros (void) { int x = 1234; int y = 5678; debug ("Flag"); debug ("X = %d\n", x); showlist (The first, second, and third items.); report (x>y, "x is %d but y is %d", x, y); } // Check long long types. #define BIG64 18446744073709551615ull #define BIG32 4294967295ul #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) #if !BIG_OK #error "your preprocessor is broken" #endif #if BIG_OK #else #error "your preprocessor is broken" #endif static long long int bignum = -9223372036854775807LL; static unsigned long long int ubignum = BIG64; struct incomplete_array { int datasize; double data[]; }; struct named_init { int number; const wchar_t *name; double average; }; typedef const char *ccp; static inline int test_restrict (ccp restrict text) { // See if C++-style comments work. // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) continue; return 0; } // Check varargs and va_copy. static bool test_varargs (const char *format, ...) { va_list args; va_start (args, format); va_list args_copy; va_copy (args_copy, args); const char *str = ""; int number = 0; float fnumber = 0; while (*format) { switch (*format++) { case '\''s'\'': // string str = va_arg (args_copy, const char *); break; case '\''d'\'': // int number = va_arg (args_copy, int); break; case '\''f'\'': // float fnumber = va_arg (args_copy, double); break; default: break; } } va_end (args_copy); va_end (args); return *str && number && fnumber; } ' # Test code for whether the C compiler supports C99 (body of main). ac_c_conftest_c99_main=' // Check bool. _Bool success = false; success |= (argc != 0); // Check restrict. if (test_restrict ("String literal") == 0) success = true; char *restrict newvar = "Another string"; // Check varargs. success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); test_varargs_macros (); // Check flexible array members. struct incomplete_array *ia = malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; // Check named initializers. struct named_init ni = { .number = 34, .name = L"Test wide string", .average = 543.34343, }; ni.number = 58; int dynamic_array[ni.number]; dynamic_array[0] = argv[0][0]; dynamic_array[ni.number - 1] = 543; // work around unused variable warnings ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' || dynamic_array[ni.number - 1] != 543); ' # Test code for whether the C compiler supports C11 (global declarations) ac_c_conftest_c11_globals=' // Does the compiler advertise C11 conformance? #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L # error "Compiler does not advertise C11 conformance" #endif // Check _Alignas. char _Alignas (double) aligned_as_double; char _Alignas (0) no_special_alignment; extern char aligned_as_int; char _Alignas (0) _Alignas (int) aligned_as_int; // Check _Alignof. enum { int_alignment = _Alignof (int), int_array_alignment = _Alignof (int[100]), char_alignment = _Alignof (char) }; _Static_assert (0 < -_Alignof (int), "_Alignof is signed"); // Check _Noreturn. int _Noreturn does_not_return (void) { for (;;) continue; } // Check _Static_assert. struct test_static_assert { int x; _Static_assert (sizeof (int) <= sizeof (long int), "_Static_assert does not work in struct"); long int y; }; // Check UTF-8 literals. #define u8 syntax error! char const utf8_literal[] = u8"happens to be ASCII" "another string"; // Check duplicate typedefs. typedef long *long_ptr; typedef long int *long_ptr; typedef long_ptr long_ptr; // Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. struct anonymous { union { struct { int i; int j; }; struct { int k; long int l; } w; }; int m; } v1; ' # Test code for whether the C compiler supports C11 (body of main). ac_c_conftest_c11_main=' _Static_assert ((offsetof (struct anonymous, i) == offsetof (struct anonymous, w.k)), "Anonymous union alignment botch"); v1.i = 2; v1.w.k = 5; ok |= v1.i != 5; ' # Test code for whether the C compiler supports C11 (complete). ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} ${ac_c_conftest_c99_globals} ${ac_c_conftest_c11_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} ${ac_c_conftest_c99_main} ${ac_c_conftest_c11_main} return ok; } " # Test code for whether the C compiler supports C99 (complete). ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} ${ac_c_conftest_c99_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} ${ac_c_conftest_c99_main} return ok; } " # Test code for whether the C compiler supports C89 (complete). ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} return ok; } " as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" as_fn_append ac_header_c_list " wchar.h wchar_h HAVE_WCHAR_H" as_fn_append ac_header_c_list " minix/config.h minix_config_h HAVE_MINIX_CONFIG_H" gt_needs="$gt_needs " # Auxiliary files required by this configure script. ac_aux_files="config.guess config.sub config.rpath compile missing install-sh" # Locations in which to look for auxiliary files. ac_aux_dir_candidates="${srcdir}/build-aux" # Search for a directory containing all of the required auxiliary files, # $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. # If we don't find one directory that contains all the files we need, # we report the set of missing files from the *first* directory in # $ac_aux_dir_candidates and give up. ac_missing_aux_files="" ac_first_candidate=: printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in $ac_aux_dir_candidates do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac as_found=: printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 ac_aux_dir_found=yes ac_install_sh= for ac_aux in $ac_aux_files do # As a special case, if "install-sh" is required, that requirement # can be satisfied by any of "install-sh", "install.sh", or "shtool", # and $ac_install_sh is set appropriately for whichever one is found. if test x"$ac_aux" = x"install-sh" then if test -f "${as_dir}install-sh"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 ac_install_sh="${as_dir}install-sh -c" elif test -f "${as_dir}install.sh"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 ac_install_sh="${as_dir}install.sh -c" elif test -f "${as_dir}shtool"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 ac_install_sh="${as_dir}shtool install -c" else ac_aux_dir_found=no if $ac_first_candidate; then ac_missing_aux_files="${ac_missing_aux_files} install-sh" else break fi fi else if test -f "${as_dir}${ac_aux}"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 else ac_aux_dir_found=no if $ac_first_candidate; then ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" else break fi fi fi done if test "$ac_aux_dir_found" = yes; then ac_aux_dir="$as_dir" break fi ac_first_candidate=false as_found=false done IFS=$as_save_IFS if $as_found then : else $as_nop as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. if test -f "${ac_aux_dir}config.guess"; then ac_config_guess="$SHELL ${ac_aux_dir}config.guess" fi if test -f "${ac_aux_dir}config.sub"; then ac_config_sub="$SHELL ${ac_aux_dir}config.sub" fi if test -f "$ac_aux_dir/configure"; then ac_configure="$SHELL ${ac_aux_dir}configure" fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers src/include/config.h" am__api_version='1.16' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 printf %s "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test ${ac_cv_path_install+y} then : printf %s "(cached) " >&6 else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac # Account for fact that we put trailing slashes in our PATH walk. case $as_dir in #(( ./ | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test ${ac_cv_path_install+y}; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 printf "%s\n" "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 printf %s "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`printf "%s\n" "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 printf "%s\n" "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_STRIP+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 printf "%s\n" "$STRIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_STRIP+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 printf "%s\n" "$ac_ct_STRIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a race-free mkdir -p" >&5 printf %s "checking for a race-free mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if test ${ac_cv_path_mkdir+y} then : printf %s "(cached) " >&6 else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext" || continue case `"$as_dir$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir ('*'coreutils) '* | \ 'BusyBox '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test ${ac_cv_path_mkdir+y}; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 printf "%s\n" "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AWK+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 printf "%s\n" "$AWK" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$AWK" && break done { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval test \${ac_cv_prog_make_${ac_make}_set+y} then : printf %s "(cached) " >&6 else $as_nop cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } SET_MAKE= else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test ${enable_silent_rules+y} then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 printf %s "checking whether $am_make supports nested variables... " >&6; } if test ${am_cv_make_support_nested_variables+y} then : printf %s "(cached) " >&6 else $as_nop if printf "%s\n" 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='pv' VERSION='1.9.31' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h printf "%s\n" "#define VERSION \"$VERSION\"" >>confdefs.h # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # Variables for tags utilities; see am/tags.am if test -z "$CTAGS"; then CTAGS=ctags fi if test -z "$ETAGS"; then ETAGS=etags fi if test -z "$CSCOPE"; then CSCOPE=cscope fi # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. set dummy ${ac_tool_prefix}clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "clang", so it can be a program name with args. set dummy clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi fi test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion -version; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 printf %s "checking whether the C compiler works... " >&6; } ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else $as_nop ac_file='' fi if test -z "$ac_file" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 printf %s "checking for C compiler default output file name... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 printf "%s\n" "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 printf %s "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else $as_nop { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 printf "%s\n" "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 printf %s "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 printf "%s\n" "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 printf %s "checking for suffix of object files... " >&6; } if test ${ac_cv_objext+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 printf "%s\n" "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 printf %s "checking whether the compiler supports GNU C... " >&6; } if test ${ac_cv_c_compiler_gnu+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes else $as_nop ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } ac_compiler_gnu=$ac_cv_c_compiler_gnu if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 printf %s "checking whether $CC accepts -g... " >&6; } if test ${ac_cv_prog_cc_g+y} then : printf %s "(cached) " >&6 else $as_nop ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes else $as_nop CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else $as_nop ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 printf "%s\n" "$ac_cv_prog_cc_g" >&6; } if test $ac_test_CFLAGS; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi ac_prog_cc_stdc=no if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 printf %s "checking for $CC option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c11_program _ACEOF for ac_arg in '' -std=gnu11 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c11=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } CC="$CC $ac_cv_prog_cc_c11" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 ac_prog_cc_stdc=c11 fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 printf %s "checking for $CC option to enable C99 features... " >&6; } if test ${ac_cv_prog_cc_c99+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c99_program _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c99=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c99" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c99" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } CC="$CC $ac_cv_prog_cc_c99" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 ac_prog_cc_stdc=c99 fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 printf %s "checking for $CC option to enable C89 features... " >&6; } if test ${ac_cv_prog_cc_c89+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c89_program _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c89" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c89" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } CC="$CC $ac_cv_prog_cc_c89" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 ac_prog_cc_stdc=c89 fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 printf %s "checking whether $CC understands -c and -o together... " >&6; } if test ${am_cv_prog_cc_c_o+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 printf %s "checking whether ${MAKE-make} supports the include directive... " >&6; } cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } case $?:`cat confinc.out 2>/dev/null` in #( '0:this is the am__doit target') : case $s in #( BSD) : am__include='.include' am__quote='"' ;; #( *) : am__include='include' am__quote='' ;; esac ;; #( *) : ;; esac if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 printf "%s\n" "${_am_result}" >&6; } # Check whether --enable-dependency-tracking was given. if test ${enable_dependency_tracking+y} then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 printf %s "checking dependency style of $depcc... " >&6; } if test ${am_cv_CC_dependencies_compiler_type+y} then : printf %s "(cached) " >&6 else $as_nop if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_header= ac_cache= for ac_item in $ac_header_c_list do if test $ac_cache; then ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then printf "%s\n" "#define $ac_item 1" >> confdefs.h fi ac_header= ac_cache= elif test $ac_header; then ac_cache=$ac_item else ac_header=$ac_item fi done if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes then : printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 printf %s "checking whether it is safe to define __EXTENSIONS__... " >&6; } if test ${ac_cv_safe_to_define___extensions__+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # define __EXTENSIONS__ 1 $ac_includes_default int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_safe_to_define___extensions__=yes else $as_nop ac_cv_safe_to_define___extensions__=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 printf "%s\n" "$ac_cv_safe_to_define___extensions__" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether _XOPEN_SOURCE should be defined" >&5 printf %s "checking whether _XOPEN_SOURCE should be defined... " >&6; } if test ${ac_cv_should_define__xopen_source+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_should_define__xopen_source=no if test $ac_cv_header_wchar_h = yes then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include mbstate_t x; int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _XOPEN_SOURCE 500 #include mbstate_t x; int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_should_define__xopen_source=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_should_define__xopen_source" >&5 printf "%s\n" "$ac_cv_should_define__xopen_source" >&6; } printf "%s\n" "#define _ALL_SOURCE 1" >>confdefs.h printf "%s\n" "#define _DARWIN_C_SOURCE 1" >>confdefs.h printf "%s\n" "#define _GNU_SOURCE 1" >>confdefs.h printf "%s\n" "#define _HPUX_ALT_XOPEN_SOCKET_API 1" >>confdefs.h printf "%s\n" "#define _NETBSD_SOURCE 1" >>confdefs.h printf "%s\n" "#define _OPENBSD_SOURCE 1" >>confdefs.h printf "%s\n" "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h printf "%s\n" "#define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1" >>confdefs.h printf "%s\n" "#define __STDC_WANT_IEC_60559_BFP_EXT__ 1" >>confdefs.h printf "%s\n" "#define __STDC_WANT_IEC_60559_DFP_EXT__ 1" >>confdefs.h printf "%s\n" "#define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1" >>confdefs.h printf "%s\n" "#define __STDC_WANT_IEC_60559_TYPES_EXT__ 1" >>confdefs.h printf "%s\n" "#define __STDC_WANT_LIB_EXT2__ 1" >>confdefs.h printf "%s\n" "#define __STDC_WANT_MATH_SPEC_FUNCS__ 1" >>confdefs.h printf "%s\n" "#define _TANDEM_SOURCE 1" >>confdefs.h if test $ac_cv_header_minix_config_h = yes then : MINIX=yes printf "%s\n" "#define _MINIX 1" >>confdefs.h printf "%s\n" "#define _POSIX_SOURCE 1" >>confdefs.h printf "%s\n" "#define _POSIX_1_SOURCE 2" >>confdefs.h else $as_nop MINIX= fi if test $ac_cv_safe_to_define___extensions__ = yes then : printf "%s\n" "#define __EXTENSIONS__ 1" >>confdefs.h fi if test $ac_cv_should_define__xopen_source = yes then : printf "%s\n" "#define _XOPEN_SOURCE 500" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 printf %s "checking for an ANSI C-conforming const... " >&6; } if test ${ac_cv_c_const+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __cplusplus /* Ultrix mips cc rejects this sort of thing. */ typedef int charset[2]; const charset cs = { 0, 0 }; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* IBM XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this sort of thing. */ char tx; char *t = &tx; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* IBM XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; } bx; struct s *b = &bx; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_c_const=yes else $as_nop ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 printf "%s\n" "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then printf "%s\n" "#define const /**/" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" if test "x$ac_cv_type__Bool" = xyes then : printf "%s\n" "#define HAVE__BOOL 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 printf %s "checking for stdbool.h that conforms to C99... " >&6; } if test ${ac_cv_header_stdbool_h+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifndef __bool_true_false_are_defined #error "__bool_true_false_are_defined is not defined" #endif char a[__bool_true_false_are_defined == 1 ? 1 : -1]; /* Regardless of whether this is C++ or "_Bool" is a valid type name, "true" and "false" should be usable in #if expressions and integer constant expressions, and "bool" should be a valid type name. */ #if !true #error "'true' is not true" #endif #if true != 1 #error "'true' is not equal to 1" #endif char b[true == 1 ? 1 : -1]; char c[true]; #if false #error "'false' is not false" #endif #if false != 0 #error "'false' is not equal to 0" #endif char d[false == 0 ? 1 : -1]; enum { e = false, f = true, g = false * true, h = true * 256 }; char i[(bool) 0.5 == true ? 1 : -1]; char j[(bool) 0.0 == false ? 1 : -1]; char k[sizeof (bool) > 0 ? 1 : -1]; struct sb { bool s: 1; bool t; } s; char l[sizeof s.t > 0 ? 1 : -1]; /* The following fails for HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ bool m[h]; char n[sizeof m == h * sizeof m[0] ? 1 : -1]; char o[-1 - (bool) 0 < 0 ? 1 : -1]; /* Catch a bug in an HP-UX C compiler. See https://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html https://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html */ bool p = true; bool *pp = &p; /* C 1999 specifies that bool, true, and false are to be macros, but C++ 2011 and later overrule this. */ #if __cplusplus < 201103 #ifndef bool #error "bool is not defined" #endif #ifndef false #error "false is not defined" #endif #ifndef true #error "true is not defined" #endif #endif /* If _Bool is available, repeat with it all the tests above that used bool. */ #ifdef HAVE__BOOL struct sB { _Bool s: 1; _Bool t; } t; char q[(_Bool) 0.5 == true ? 1 : -1]; char r[(_Bool) 0.0 == false ? 1 : -1]; char u[sizeof (_Bool) > 0 ? 1 : -1]; char v[sizeof t.t > 0 ? 1 : -1]; _Bool w[h]; char x[sizeof m == h * sizeof m[0] ? 1 : -1]; char y[-1 - (_Bool) 0 < 0 ? 1 : -1]; _Bool z = true; _Bool *pz = &p; #endif int main (void) { bool ps = &s; *pp |= p; *pp |= ! p; #ifdef HAVE__BOOL _Bool pt = &t; *pz |= z; *pz |= ! z; #endif /* Refer to every declared value, so they cannot be discarded as unused. */ return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !j + !k + !l + !m + !n + !o + !p + !pp + !ps #ifdef HAVE__BOOL + !q + !r + !u + !v + !w + !x + !y + !z + !pt #endif ); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_header_stdbool_h=yes else $as_nop ac_cv_header_stdbool_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 printf "%s\n" "$ac_cv_header_stdbool_h" >&6; } if test $ac_cv_header_stdbool_h = yes; then printf "%s\n" "#define HAVE_STDBOOL_H 1" >>confdefs.h fi # Check whether --enable-largefile was given. if test ${enable_largefile+y} then : enableval=$enable_largefile; fi if test "$enable_largefile" != no; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 printf %s "checking for special C compiler options needed for large files... " >&6; } if test ${ac_cv_sys_largefile_CC+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_sys_largefile_CC=no if test "$GCC" != yes; then ac_save_CC=$CC while :; do # IRIX 6.2 and later do not support large files by default, # so use the C compiler's -n32 option if that helps. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : break fi rm -f core conftest.err conftest.$ac_objext conftest.beam CC="$CC -n32" if ac_fn_c_try_compile "$LINENO" then : ac_cv_sys_largefile_CC=' -n32'; break fi rm -f core conftest.err conftest.$ac_objext conftest.beam break done CC=$ac_save_CC rm -f conftest.$ac_ext fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 printf "%s\n" "$ac_cv_sys_largefile_CC" >&6; } if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 printf %s "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } if test ${ac_cv_sys_file_offset_bits+y} then : printf %s "(cached) " >&6 else $as_nop while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_sys_file_offset_bits=no; break fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _FILE_OFFSET_BITS 64 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_sys_file_offset_bits=64; break fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_sys_file_offset_bits=unknown break done fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 printf "%s\n" "$ac_cv_sys_file_offset_bits" >&6; } case $ac_cv_sys_file_offset_bits in #( no | unknown) ;; *) printf "%s\n" "#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits" >>confdefs.h ;; esac rm -rf conftest* if test $ac_cv_sys_file_offset_bits = unknown; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 printf %s "checking for _LARGE_FILES value needed for large files... " >&6; } if test ${ac_cv_sys_large_files+y} then : printf %s "(cached) " >&6 else $as_nop while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_sys_large_files=no; break fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _LARGE_FILES 1 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_sys_large_files=1; break fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_sys_large_files=unknown break done fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 printf "%s\n" "$ac_cv_sys_large_files" >&6; } case $ac_cv_sys_large_files in #( no | unknown) ;; *) printf "%s\n" "#define _LARGE_FILES $ac_cv_sys_large_files" >>confdefs.h ;; esac rm -rf conftest* fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 printf %s "checking for a sed that does not truncate output... " >&6; } if test ${ac_cv_path_SED+y} then : printf %s "(cached) " >&6 else $as_nop ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in sed gsed do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 printf "%s\n" "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5 printf %s "checking whether NLS is requested... " >&6; } # Check whether --enable-nls was given. if test ${enable_nls+y} then : enableval=$enable_nls; USE_NLS=$enableval else $as_nop USE_NLS=yes fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 printf "%s\n" "$USE_NLS" >&6; } GETTEXT_MACRO_VERSION=0.20 # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which # contains only /bin. Note that ksh looks also at the FPATH variable, # so we have to set that as well for the test. PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ || PATH_SEPARATOR=';' } fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_MSGFMT+y} then : printf %s "(cached) " >&6 else $as_nop case "$MSGFMT" in [\\/]* | ?:[\\/]*) ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5 printf "%s\n" "$MSGFMT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_GMSGFMT+y} then : printf %s "(cached) " >&6 else $as_nop case $GMSGFMT in [\\/]* | ?:[\\/]*) ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_GMSGFMT="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" ;; esac fi GMSGFMT=$ac_cv_path_GMSGFMT if test -n "$GMSGFMT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5 printf "%s\n" "$GMSGFMT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; *) GMSGFMT_015=$GMSGFMT ;; esac # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which # contains only /bin. Note that ksh looks also at the FPATH variable, # so we have to set that as well for the test. PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ || PATH_SEPARATOR=';' } fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_XGETTEXT+y} then : printf %s "(cached) " >&6 else $as_nop case "$XGETTEXT" in [\\/]* | ?:[\\/]*) ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5 printf "%s\n" "$XGETTEXT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi rm -f messages.po case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;; *) XGETTEXT_015=$XGETTEXT ;; esac # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which # contains only /bin. Note that ksh looks also at the FPATH variable, # so we have to set that as well for the test. PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ || PATH_SEPARATOR=';' } fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "msgmerge", so it can be a program name with args. set dummy msgmerge; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_MSGMERGE+y} then : printf %s "(cached) " >&6 else $as_nop case "$MSGMERGE" in [\\/]* | ?:[\\/]*) ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5 printf "%s\n" "$MSGMERGE" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if LC_ALL=C $MSGMERGE --help | grep ' --for-msgfmt ' >/dev/null; then MSGMERGE_FOR_MSGFMT_OPTION='--for-msgfmt' else if LC_ALL=C $MSGMERGE --help | grep ' --no-fuzzy-matching ' >/dev/null; then MSGMERGE_FOR_MSGFMT_OPTION='--no-fuzzy-matching --no-location --quiet' else MSGMERGE_FOR_MSGFMT_OPTION='--no-location --quiet' fi fi 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" # Make sure we can run config.sub. $SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 printf %s "checking build system type... " >&6; } if test ${ac_cv_build+y} then : printf %s "(cached) " >&6 else $as_nop ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 printf "%s\n" "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 printf %s "checking host system type... " >&6; } if test ${ac_cv_host+y} then : printf %s "(cached) " >&6 else $as_nop if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 printf "%s\n" "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac # Check whether --with-gnu-ld was given. if test ${with_gnu_ld+y} then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else $as_nop with_gnu_ld=no fi # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which # contains only /bin. Note that ksh looks also at the FPATH variable, # so we have to set that as well for the test. PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ || PATH_SEPARATOR=';' } fi if test -n "$LD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld" >&5 printf %s "checking for ld... " >&6; } elif test "$GCC" = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 printf %s "checking for ld used by $CC... " >&6; } elif test "$with_gnu_ld" = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 printf %s "checking for GNU ld... " >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 printf %s "checking for non-GNU ld... " >&6; } fi if test -n "$LD"; then # Let the user override the test with a path. : else if test ${acl_cv_path_LD+y} then : printf %s "(cached) " >&6 else $as_nop acl_cv_path_LD= # Final result of this test ac_prog=ld # Program to search in $PATH if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw acl_output=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) acl_output=`($CC -print-prog-name=ld) 2>&5` ;; esac case $acl_output in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld acl_output=`echo "$acl_output" | sed 's%\\\\%/%g'` while echo "$acl_output" | grep "$re_direlt" > /dev/null 2>&1; do acl_output=`echo $acl_output | sed "s%$re_direlt%/%"` done # Got the pathname. No search in PATH is needed. acl_cv_path_LD="$acl_output" ac_prog= ;; "") # If it fails, then pretend we aren't using GCC. ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac fi if test -n "$ac_prog"; then # Search for $ac_prog in $PATH. acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$acl_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$acl_cv_path_LD" -v 2>&1 conftest.$ac_ext /* end confdefs.h. */ #if defined __powerpc64__ || defined _ARCH_PPC64 int ok; #else error fail #endif _ACEOF if ac_fn_c_try_compile "$LINENO" then : # The compiler produces 64-bit code. Add option '-b64' so that the # linker groks 64-bit object files. case "$acl_cv_path_LD " in *" -b64 "*) ;; *) acl_cv_path_LD="$acl_cv_path_LD -b64" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; sparc64-*-netbsd*) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined __sparcv9 || defined __arch64__ int ok; #else error fail #endif _ACEOF if ac_fn_c_try_compile "$LINENO" then : else $as_nop # The compiler produces 32-bit code. Add option '-m elf32_sparc' # so that the linker groks 32-bit object files. case "$acl_cv_path_LD " in *" -m elf32_sparc "*) ;; *) acl_cv_path_LD="$acl_cv_path_LD -m elf32_sparc" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac fi LD="$acl_cv_path_LD" fi if test -n "$LD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 printf "%s\n" "$LD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 printf %s "checking if the linker ($LD) is GNU ld... " >&6; } if test ${acl_cv_prog_gnu_ld+y} then : printf %s "(cached) " >&6 else $as_nop # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 printf "%s\n" "$acl_cv_prog_gnu_ld" >&6; } with_gnu_ld=$acl_cv_prog_gnu_ld { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5 printf %s "checking for shared library run path origin... " >&6; } if test ${acl_cv_rpath+y} then : printf %s "(cached) " >&6 else $as_nop CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh rm -f ./conftest.sh acl_cv_rpath=done fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5 printf "%s\n" "$acl_cv_rpath" >&6; } wl="$acl_cv_wl" 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+y} then : enableval=$enable_rpath; : else $as_nop enable_rpath=yes fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking 32-bit host C ABI" >&5 printf %s "checking 32-bit host C ABI... " >&6; } if test ${gl_cv_host_cpu_c_abi_32bit+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$gl_cv_host_cpu_c_abi"; then case "$gl_cv_host_cpu_c_abi" in i386 | x86_64-x32 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32 | mips | mipsn32 | powerpc | riscv*-ilp32* | s390 | sparc) gl_cv_host_cpu_c_abi_32bit=yes ;; x86_64 | alpha | arm64 | hppa64 | ia64 | mips64 | powerpc64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 ) gl_cv_host_cpu_c_abi_32bit=no ;; *) gl_cv_host_cpu_c_abi_32bit=unknown ;; esac else case "$host_cpu" in # CPUs that only support a 32-bit ABI. arc \ | bfin \ | cris* \ | csky \ | epiphany \ | ft32 \ | h8300 \ | m68k \ | microblaze | microblazeel \ | nds32 | nds32le | nds32be \ | nios2 | nios2eb | nios2el \ | or1k* \ | or32 \ | sh | sh1234 | sh1234elb \ | tic6x \ | xtensa* ) gl_cv_host_cpu_c_abi_32bit=yes ;; # CPUs that only support a 64-bit ABI. alpha | alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] \ | mmix ) gl_cv_host_cpu_c_abi_32bit=no ;; i[34567]86 ) gl_cv_host_cpu_c_abi_32bit=yes ;; x86_64 ) # On x86_64 systems, the C compiler may be generating code in one of # these ABIs: # - 64-bit instruction set, 64-bit pointers, 64-bit 'long': x86_64. # - 64-bit instruction set, 64-bit pointers, 32-bit 'long': x86_64 # with native Windows (mingw, MSVC). # - 64-bit instruction set, 32-bit pointers, 32-bit 'long': x86_64-x32. # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': i386. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if (defined __x86_64__ || defined __amd64__ \ || defined _M_X64 || defined _M_AMD64) \ && !(defined __ILP32__ || defined _ILP32) int ok; #else error fail #endif _ACEOF if ac_fn_c_try_compile "$LINENO" then : gl_cv_host_cpu_c_abi_32bit=no else $as_nop gl_cv_host_cpu_c_abi_32bit=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; arm* | aarch64 ) # Assume arm with EABI. # On arm64 systems, the C compiler may be generating code in one of # these ABIs: # - aarch64 instruction set, 64-bit pointers, 64-bit 'long': arm64. # - aarch64 instruction set, 32-bit pointers, 32-bit 'long': arm64-ilp32. # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': arm or armhf. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined __aarch64__ && !(defined __ILP32__ || defined _ILP32) int ok; #else error fail #endif _ACEOF if ac_fn_c_try_compile "$LINENO" then : gl_cv_host_cpu_c_abi_32bit=no else $as_nop gl_cv_host_cpu_c_abi_32bit=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; hppa1.0 | hppa1.1 | hppa2.0* | hppa64 ) # On hppa, the C compiler may be generating 32-bit code or 64-bit # code. In the latter case, it defines _LP64 and __LP64__. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __LP64__ int ok; #else error fail #endif _ACEOF if ac_fn_c_try_compile "$LINENO" then : gl_cv_host_cpu_c_abi_32bit=no else $as_nop gl_cv_host_cpu_c_abi_32bit=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; ia64* ) # On ia64 on HP-UX, the C compiler may be generating 64-bit code or # 32-bit code. In the latter case, it defines _ILP32. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef _ILP32 int ok; #else error fail #endif _ACEOF if ac_fn_c_try_compile "$LINENO" then : gl_cv_host_cpu_c_abi_32bit=yes else $as_nop gl_cv_host_cpu_c_abi_32bit=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; mips* ) # We should also check for (_MIPS_SZPTR == 64), but gcc keeps this # at 32. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64) int ok; #else error fail #endif _ACEOF if ac_fn_c_try_compile "$LINENO" then : gl_cv_host_cpu_c_abi_32bit=no else $as_nop gl_cv_host_cpu_c_abi_32bit=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; powerpc* ) # Different ABIs are in use on AIX vs. Mac OS X vs. Linux,*BSD. # No need to distinguish them here; the caller may distinguish # them based on the OS. # On powerpc64 systems, the C compiler may still be generating # 32-bit code. And on powerpc-ibm-aix systems, the C compiler may # be generating 64-bit code. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined __powerpc64__ || defined _ARCH_PPC64 int ok; #else error fail #endif _ACEOF if ac_fn_c_try_compile "$LINENO" then : gl_cv_host_cpu_c_abi_32bit=no else $as_nop gl_cv_host_cpu_c_abi_32bit=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; rs6000 ) gl_cv_host_cpu_c_abi_32bit=yes ;; riscv32 | riscv64 ) # There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d. # Size of 'long' and 'void *': cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined __LP64__ int ok; #else error fail #endif _ACEOF if ac_fn_c_try_compile "$LINENO" then : gl_cv_host_cpu_c_abi_32bit=no else $as_nop gl_cv_host_cpu_c_abi_32bit=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; s390* ) # On s390x, the C compiler may be generating 64-bit (= s390x) code # or 31-bit (= s390) code. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined __LP64__ || defined __s390x__ int ok; #else error fail #endif _ACEOF if ac_fn_c_try_compile "$LINENO" then : gl_cv_host_cpu_c_abi_32bit=no else $as_nop gl_cv_host_cpu_c_abi_32bit=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; sparc | sparc64 ) # UltraSPARCs running Linux have `uname -m` = "sparc64", but the # C compiler still generates 32-bit code. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined __sparcv9 || defined __arch64__ int ok; #else error fail #endif _ACEOF if ac_fn_c_try_compile "$LINENO" then : gl_cv_host_cpu_c_abi_32bit=no else $as_nop gl_cv_host_cpu_c_abi_32bit=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; *) gl_cv_host_cpu_c_abi_32bit=unknown ;; esac fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_host_cpu_c_abi_32bit" >&5 printf "%s\n" "$gl_cv_host_cpu_c_abi_32bit" >&6; } HOST_CPU_C_ABI_32BIT="$gl_cv_host_cpu_c_abi_32bit" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 printf %s "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test ${ac_cv_prog_CPP+y} then : printf %s "(cached) " >&6 else $as_nop # Double quotes because $CC needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" cpp /lib/cpp do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO" then : else $as_nop # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO" then : # Broken: success on invalid input. continue else $as_nop # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 printf "%s\n" "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO" then : else $as_nop # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO" then : # Broken: success on invalid input. continue else $as_nop # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : else $as_nop { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 printf %s "checking for grep that handles long lines and -e... " >&6; } if test ${ac_cv_path_GREP+y} then : printf %s "(cached) " >&6 else $as_nop if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in grep ggrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 printf "%s\n" "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 printf %s "checking for egrep... " >&6; } if test ${ac_cv_path_EGREP+y} then : printf %s "(cached) " >&6 else $as_nop if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in egrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 printf "%s\n" "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ELF binary format" >&5 printf %s "checking for ELF binary format... " >&6; } if test ${gl_cv_elf+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __ELF__ Extensible Linking Format #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "Extensible Linking Format" >/dev/null 2>&1 then : gl_cv_elf=yes else $as_nop gl_cv_elf=no fi rm -rf conftest* fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_elf" >&5 printf "%s\n" "$gl_cv_elf" >&6; } if test $gl_cv_elf; then # Extract the ELF class of a file (5th byte) in decimal. # Cf. https://en.wikipedia.org/wiki/Executable_and_Linkable_Format#File_header if od -A x < /dev/null >/dev/null 2>/dev/null; then # Use POSIX od. func_elfclass () { od -A n -t d1 -j 4 -N 1 } else # Use BSD hexdump. func_elfclass () { dd bs=1 count=1 skip=4 2>/dev/null | hexdump -e '1/1 "%3d "' echo } fi case $HOST_CPU_C_ABI_32BIT in yes) # 32-bit ABI. acl_is_expected_elfclass () { test "`func_elfclass | sed -e 's/[ ]//g'`" = 1 } ;; no) # 64-bit ABI. acl_is_expected_elfclass () { test "`func_elfclass | sed -e 's/[ ]//g'`" = 2 } ;; *) # Unknown. acl_is_expected_elfclass () { : } ;; esac else acl_is_expected_elfclass () { : } fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the common suffixes of directories in the library search path" >&5 printf %s "checking for the common suffixes of directories in the library search path... " >&6; } if test ${acl_cv_libdirstems+y} then : printf %s "(cached) " >&6 else $as_nop acl_libdirstem=lib acl_libdirstem2= acl_libdirstem3= case "$host_os" in solaris*) if test $HOST_CPU_C_ABI_32BIT = no; then acl_libdirstem2=lib/64 case "$host_cpu" in sparc*) acl_libdirstem3=lib/sparcv9 ;; i*86 | x86_64) acl_libdirstem3=lib/amd64 ;; esac fi ;; *) searchpath=`(LC_ALL=C $CC $CPPFLAGS $CFLAGS -print-search-dirs) 2>/dev/null \ | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` if test $HOST_CPU_C_ABI_32BIT != no; then # 32-bit or unknown ABI. if test -d /usr/lib32; then acl_libdirstem2=lib32 fi fi if test $HOST_CPU_C_ABI_32BIT != yes; then # 64-bit or unknown ABI. if test -d /usr/lib64; then acl_libdirstem3=lib64 fi fi if test -n "$searchpath"; then acl_save_IFS="${IFS= }"; IFS=":" for searchdir in $searchpath; do if test -d "$searchdir"; then case "$searchdir" in */lib32/ | */lib32 ) acl_libdirstem2=lib32 ;; */lib64/ | */lib64 ) acl_libdirstem3=lib64 ;; */../ | */.. ) # Better ignore directories of this form. They are misleading. ;; *) searchdir=`cd "$searchdir" && pwd` case "$searchdir" in */lib32 ) acl_libdirstem2=lib32 ;; */lib64 ) acl_libdirstem3=lib64 ;; esac ;; esac fi done IFS="$acl_save_IFS" if test $HOST_CPU_C_ABI_32BIT = yes; then # 32-bit ABI. acl_libdirstem3= fi if test $HOST_CPU_C_ABI_32BIT = no; then # 64-bit ABI. acl_libdirstem2= fi fi ;; esac test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" test -n "$acl_libdirstem3" || acl_libdirstem3="$acl_libdirstem" acl_cv_libdirstems="$acl_libdirstem,$acl_libdirstem2,$acl_libdirstem3" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $acl_cv_libdirstems" >&5 printf "%s\n" "$acl_cv_libdirstems" >&6; } acl_libdirstem=`echo "$acl_cv_libdirstems" | sed -e 's/,.*//'` acl_libdirstem2=`echo "$acl_cv_libdirstems" | sed -e 's/^[^,]*,//' -e 's/,.*//'` acl_libdirstem3=`echo "$acl_cv_libdirstems" | sed -e 's/^[^,]*,[^,]*,//' -e 's/,.*//'` 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\" eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\" eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" # Check whether --with-libiconv-prefix was given. if test ${with_libiconv_prefix+y} then : withval=$with_libiconv_prefix; if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\" eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" additional_libdir2="$withval/$acl_libdirstem2" additional_libdir3="$withval/$acl_libdirstem3" fi fi fi if test "X$additional_libdir2" = "X$additional_libdir"; then additional_libdir2= fi if test "X$additional_libdir3" = "X$additional_libdir"; then additional_libdir3= 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 for additional_libdir_variable in additional_libdir additional_libdir2 additional_libdir3; do if test "X$found_dir" = "X"; then eval dir=\$$additional_libdir_variable if test -n "$dir"; then if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$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" && acl_is_expected_elfclass < "$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" && acl_is_expected_elfclass < "$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" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; 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 fi done 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" && acl_is_expected_elfclass < "$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" && acl_is_expected_elfclass < "$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" && acl_is_expected_elfclass < "$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" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; 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" \ || test "X$found_dir" = "X/usr/$acl_libdirstem3"; 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" ;; */$acl_libdirstem3 | */$acl_libdirstem3/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem3/"'*$,,'` 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*) dependency_libdir=`echo "X$dep" | sed -e 's/^X-L//'` if test "X$dependency_libdir" != "X/usr/$acl_libdirstem" \ && test "X$dependency_libdir" != "X/usr/$acl_libdirstem2" \ && test "X$dependency_libdir" != "X/usr/$acl_libdirstem3"; then haveit= if test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem" \ || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem2" \ || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem3"; 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$dependency_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$dependency_libdir"; then LIBICONV="${LIBICONV}${LIBICONV:+ }-L$dependency_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$dependency_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$dependency_libdir"; then LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$dependency_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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for CFPreferencesCopyAppValue" >&5 printf %s "checking for CFPreferencesCopyAppValue... " >&6; } if test ${gt_cv_func_CFPreferencesCopyAppValue+y} then : printf %s "(cached) " >&6 else $as_nop gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { CFPreferencesCopyAppValue(NULL, NULL) ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : gt_cv_func_CFPreferencesCopyAppValue=yes else $as_nop gt_cv_func_CFPreferencesCopyAppValue=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS="$gt_save_LIBS" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFPreferencesCopyAppValue" >&5 printf "%s\n" "$gt_cv_func_CFPreferencesCopyAppValue" >&6; } if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then printf "%s\n" "#define HAVE_CFPREFERENCESCOPYAPPVALUE 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for CFLocaleCopyPreferredLanguages" >&5 printf %s "checking for CFLocaleCopyPreferredLanguages... " >&6; } if test ${gt_cv_func_CFLocaleCopyPreferredLanguages+y} then : printf %s "(cached) " >&6 else $as_nop gt_save_LIBS="$LIBS" LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { CFLocaleCopyPreferredLanguages(); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : gt_cv_func_CFLocaleCopyPreferredLanguages=yes else $as_nop gt_cv_func_CFLocaleCopyPreferredLanguages=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS="$gt_save_LIBS" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFLocaleCopyPreferredLanguages" >&5 printf "%s\n" "$gt_cv_func_CFLocaleCopyPreferredLanguages" >&6; } if test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then printf "%s\n" "#define HAVE_CFLOCALECOPYPREFERREDLANGUAGES 1" >>confdefs.h fi INTL_MACOSX_LIBS= if test $gt_cv_func_CFPreferencesCopyAppValue = yes \ || test $gt_cv_func_CFLocaleCopyPreferredLanguages = 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libc" >&5 printf %s "checking for GNU gettext in libc... " >&6; } if eval test \${$gt_func_gnugettext_libc+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifndef __GNU_GETTEXT_SUPPORTED_REVISION extern int _nl_msg_cat_cntr; extern int *_nl_domain_bindings; #define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_domain_bindings) #else #define __GNU_GETTEXT_SYMBOL_EXPRESSION 0 #endif $gt_revision_test_code int main (void) { bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$gt_func_gnugettext_libc=yes" else $as_nop eval "$gt_func_gnugettext_libc=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$gt_func_gnugettext_libc { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 printf %s "checking for iconv... " >&6; } if test ${am_cv_func_iconv+y} then : printf %s "(cached) " >&6 else $as_nop am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main (void) { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : am_cv_func_iconv=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main (void) { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : am_cv_lib_iconv=yes am_cv_func_iconv=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS="$am_save_LIBS" fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5 printf "%s\n" "$am_cv_func_iconv" >&6; } if test "$am_cv_func_iconv" = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working iconv" >&5 printf %s "checking for working iconv... " >&6; } if test ${am_cv_func_iconv_works+y} then : printf %s "(cached) " >&6 else $as_nop am_save_LIBS="$LIBS" if test $am_cv_lib_iconv = yes; then LIBS="$LIBS $LIBICONV" fi am_cv_func_iconv_works=no for ac_iconv_const in '' 'const'; do if test "$cross_compiling" = yes then : case "$host_os" in aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; *) am_cv_func_iconv_works="guessing yes" ;; esac else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #ifndef ICONV_CONST # define ICONV_CONST $ac_iconv_const #endif int main (void) { int result = 0; /* Test against AIX 5.1 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); if (cd_utf8_to_88591 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */ char buf[10]; ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_utf8_to_88591, &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 1; iconv_close (cd_utf8_to_88591); } } /* Test against Solaris 10 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); if (cd_ascii_to_88591 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\263"; char buf[10]; ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_ascii_to_88591, &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) result |= 2; iconv_close (cd_ascii_to_88591); } } /* Test against AIX 6.1..7.1 bug: Buffer overrun. */ { iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\304"; static char buf[2] = { (char)0xDE, (char)0xAD }; ICONV_CONST char *inptr = input; size_t inbytesleft = 1; char *outptr = buf; size_t outbytesleft = 1; size_t res = iconv (cd_88591_to_utf8, &inptr, &inbytesleft, &outptr, &outbytesleft); if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) result |= 4; iconv_close (cd_88591_to_utf8); } } #if 0 /* This bug could be worked around by the caller. */ /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ { iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; char buf[50]; ICONV_CONST char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_88591_to_utf8, &inptr, &inbytesleft, &outptr, &outbytesleft); if ((int)res > 0) result |= 8; iconv_close (cd_88591_to_utf8); } } #endif /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is provided. */ { /* Try standardized names. */ iconv_t cd1 = iconv_open ("UTF-8", "EUC-JP"); /* Try IRIX, OSF/1 names. */ iconv_t cd2 = iconv_open ("UTF-8", "eucJP"); /* Try AIX names. */ iconv_t cd3 = iconv_open ("UTF-8", "IBM-eucJP"); /* Try HP-UX names. */ iconv_t cd4 = iconv_open ("utf8", "eucJP"); if (cd1 == (iconv_t)(-1) && cd2 == (iconv_t)(-1) && cd3 == (iconv_t)(-1) && cd4 == (iconv_t)(-1)) result |= 16; if (cd1 != (iconv_t)(-1)) iconv_close (cd1); if (cd2 != (iconv_t)(-1)) iconv_close (cd2); if (cd3 != (iconv_t)(-1)) iconv_close (cd3); if (cd4 != (iconv_t)(-1)) iconv_close (cd4); } return result; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO" then : am_cv_func_iconv_works=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi test "$am_cv_func_iconv_works" = no || break done LIBS="$am_save_LIBS" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv_works" >&5 printf "%s\n" "$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 printf "%s\n" "#define HAVE_ICONV 1" >>confdefs.h fi if test "$am_cv_lib_iconv" = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5 printf %s "checking how to link with libiconv... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5 printf "%s\n" "$LIBICONV" >&6; } else CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi use_additional=yes acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\" eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" # Check whether --with-libintl-prefix was given. if test ${with_libintl_prefix+y} then : withval=$with_libintl_prefix; if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\" eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" additional_libdir2="$withval/$acl_libdirstem2" additional_libdir3="$withval/$acl_libdirstem3" fi fi fi if test "X$additional_libdir2" = "X$additional_libdir"; then additional_libdir2= fi if test "X$additional_libdir3" = "X$additional_libdir"; then additional_libdir3= 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 for additional_libdir_variable in additional_libdir additional_libdir2 additional_libdir3; do if test "X$found_dir" = "X"; then eval dir=\$$additional_libdir_variable if test -n "$dir"; then if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$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" && acl_is_expected_elfclass < "$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" && acl_is_expected_elfclass < "$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" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; 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 fi done 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" && acl_is_expected_elfclass < "$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" && acl_is_expected_elfclass < "$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" && acl_is_expected_elfclass < "$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" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; 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" \ || test "X$found_dir" = "X/usr/$acl_libdirstem3"; 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" ;; */$acl_libdirstem3 | */$acl_libdirstem3/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem3/"'*$,,'` 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*) dependency_libdir=`echo "X$dep" | sed -e 's/^X-L//'` if test "X$dependency_libdir" != "X/usr/$acl_libdirstem" \ && test "X$dependency_libdir" != "X/usr/$acl_libdirstem2" \ && test "X$dependency_libdir" != "X/usr/$acl_libdirstem3"; then haveit= if test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem" \ || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem2" \ || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem3"; 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$dependency_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$dependency_libdir"; then LIBINTL="${LIBINTL}${LIBINTL:+ }-L$dependency_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$dependency_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$dependency_libdir"; then LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$dependency_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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libintl" >&5 printf %s "checking for GNU gettext in libintl... " >&6; } if eval test \${$gt_func_gnugettext_libintl+y} then : printf %s "(cached) " >&6 else $as_nop gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $INCINTL" gt_save_LIBS="$LIBS" LIBS="$LIBS $LIBINTL" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifndef __GNU_GETTEXT_SUPPORTED_REVISION extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); #define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias ("")) #else #define __GNU_GETTEXT_SYMBOL_EXPRESSION 0 #endif $gt_revision_test_code int main (void) { bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$gt_func_gnugettext_libintl=yes" else $as_nop eval "$gt_func_gnugettext_libintl=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ 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 #ifndef __GNU_GETTEXT_SUPPORTED_REVISION extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); #define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias ("")) #else #define __GNU_GETTEXT_SYMBOL_EXPRESSION 0 #endif $gt_revision_test_code int main (void) { bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION ; 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.beam \ conftest$ac_exeext conftest.$ac_ext fi CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS" fi eval ac_res=\$$gt_func_gnugettext_libintl { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$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 printf "%s\n" "#define ENABLE_NLS 1" >>confdefs.h else USE_NLS=no fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use NLS" >&5 printf %s "checking whether to use NLS... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5 printf "%s\n" "$USE_NLS" >&6; } if test "$USE_NLS" = "yes"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking where the gettext function comes from" >&5 printf %s "checking where the gettext function comes from... " >&6; } if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_source" >&5 printf "%s\n" "$gt_source" >&6; } fi if test "$USE_NLS" = "yes"; then if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libintl" >&5 printf %s "checking how to link with libintl... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBINTL" >&5 printf "%s\n" "$LIBINTL" >&6; } for element in $INCINTL; do haveit= for x in $CPPFLAGS; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" fi done fi printf "%s\n" "#define HAVE_GETTEXT 1" >>confdefs.h printf "%s\n" "#define HAVE_DCGETTEXT 1" >>confdefs.h fi POSUB=po fi INTLLIBS="$LIBINTL" if test "$USE_NLS" = "yes"; then CPPFLAGS="$CPPFLAGS -DLOCALEDIR=\\\"\$(localedir)\\\"" LIBS="$LIBS $LIBINTL" fi ac_fn_c_check_func "$LINENO" "getopt_long" "ac_cv_func_getopt_long" if test "x$ac_cv_func_getopt_long" = xyes then : printf "%s\n" "#define HAVE_GETOPT_LONG 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "vsnprintf" "ac_cv_func_vsnprintf" if test "x$ac_cv_func_vsnprintf" = xyes then : printf "%s\n" "#define HAVE_VSNPRINTF 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "strlcat" "ac_cv_func_strlcat" if test "x$ac_cv_func_strlcat" = xyes then : printf "%s\n" "#define HAVE_STRLCAT 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "strtoul" "ac_cv_func_strtoul" if test "x$ac_cv_func_strtoul" = xyes then : printf "%s\n" "#define HAVE_STRTOUL 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "memrchr" "ac_cv_func_memrchr" if test "x$ac_cv_func_memrchr" = xyes then : printf "%s\n" "#define HAVE_MEMRCHR 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "fdatasync" "ac_cv_func_fdatasync" if test "x$ac_cv_func_fdatasync" = xyes then : printf "%s\n" "#define HAVE_FDATASYNC 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "fpathconf" "ac_cv_func_fpathconf" if test "x$ac_cv_func_fpathconf" = xyes then : printf "%s\n" "#define HAVE_FPATHCONF 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "sysconf" "ac_cv_func_sysconf" if test "x$ac_cv_func_sysconf" = xyes then : printf "%s\n" "#define HAVE_SYSCONF 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "posix_memalign" "ac_cv_func_posix_memalign" if test "x$ac_cv_func_posix_memalign" = xyes then : printf "%s\n" "#define HAVE_POSIX_MEMALIGN 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "posix_fadvise" "ac_cv_func_posix_fadvise" if test "x$ac_cv_func_posix_fadvise" = xyes then : printf "%s\n" "#define HAVE_POSIX_FADVISE 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "nanosleep" "ac_cv_func_nanosleep" if test "x$ac_cv_func_nanosleep" = xyes then : printf "%s\n" "#define HAVE_NANOSLEEP 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "setitimer" "ac_cv_func_setitimer" if test "x$ac_cv_func_setitimer" = xyes then : printf "%s\n" "#define HAVE_SETITIMER 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "setproctitle" "ac_cv_func_setproctitle" if test "x$ac_cv_func_setproctitle" = xyes then : printf "%s\n" "#define HAVE_SETPROCTITLE 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "getopt.h" "ac_cv_header_getopt_h" "$ac_includes_default" if test "x$ac_cv_header_getopt_h" = xyes then : printf "%s\n" "#define HAVE_GETOPT_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "limits.h" "ac_cv_header_limits_h" "$ac_includes_default" if test "x$ac_cv_header_limits_h" = xyes then : printf "%s\n" "#define HAVE_LIMITS_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "langinfo.h" "ac_cv_header_langinfo_h" "$ac_includes_default" if test "x$ac_cv_header_langinfo_h" = xyes then : printf "%s\n" "#define HAVE_LANGINFO_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "wctype.h" "ac_cv_header_wctype_h" "$ac_includes_default" if test "x$ac_cv_header_wctype_h" = xyes then : printf "%s\n" "#define HAVE_WCTYPE_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "termios.h" "ac_cv_header_termios_h" "$ac_includes_default" if test "x$ac_cv_header_termios_h" = xyes then : printf "%s\n" "#define HAVE_TERMIOS_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "libgen.h" "ac_cv_header_libgen_h" "$ac_includes_default" if test "x$ac_cv_header_libgen_h" = xyes then : printf "%s\n" "#define HAVE_LIBGEN_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/ioctl.h" "ac_cv_header_sys_ioctl_h" "$ac_includes_default" if test "x$ac_cv_header_sys_ioctl_h" = xyes then : printf "%s\n" "#define HAVE_SYS_IOCTL_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "libintl.h" "ac_cv_header_libintl_h" "$ac_includes_default" if test "x$ac_cv_header_libintl_h" = xyes then : printf "%s\n" "#define HAVE_LIBINTL_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "locale.h" "ac_cv_header_locale_h" "$ac_includes_default" if test "x$ac_cv_header_locale_h" = xyes then : printf "%s\n" "#define HAVE_LOCALE_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/sysmacros.h" "ac_cv_header_sys_sysmacros_h" "$ac_includes_default" if test "x$ac_cv_header_sys_sysmacros_h" = xyes then : printf "%s\n" "#define HAVE_SYS_SYSMACROS_H 1" >>confdefs.h fi ac_fn_c_check_member "$LINENO" "struct stat" "st_blksize" "ac_cv_member_struct_stat_st_blksize" "$ac_includes_default" if test "x$ac_cv_member_struct_stat_st_blksize" = xyes then : printf "%s\n" "#define HAVE_STRUCT_STAT_ST_BLKSIZE 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC options needed to detect all undeclared functions" >&5 printf %s "checking for $CC options needed to detect all undeclared functions... " >&6; } if test ${ac_cv_c_undeclared_builtin_options+y} then : printf %s "(cached) " >&6 else $as_nop ac_save_CFLAGS=$CFLAGS ac_cv_c_undeclared_builtin_options='cannot detect' for ac_arg in '' -fno-builtin; do CFLAGS="$ac_save_CFLAGS $ac_arg" # This test program should *not* compile successfully. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { (void) strchr; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else $as_nop # This test program should compile successfully. # No library function is consistently available on # freestanding implementations, so test against a dummy # declaration. Include always-available headers on the # off chance that they somehow elicit warnings. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include extern void ac_decl (int, char *); int main (void) { (void) ac_decl (0, (char *) 0); (void) ac_decl; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : if test x"$ac_arg" = x then : ac_cv_c_undeclared_builtin_options='none needed' else $as_nop ac_cv_c_undeclared_builtin_options=$ac_arg fi break fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done CFLAGS=$ac_save_CFLAGS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_undeclared_builtin_options" >&5 printf "%s\n" "$ac_cv_c_undeclared_builtin_options" >&6; } case $ac_cv_c_undeclared_builtin_options in #( 'cannot detect') : { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot make $CC report undeclared builtins See \`config.log' for more details" "$LINENO" 5; } ;; #( 'none needed') : ac_c_undeclared_builtin_options='' ;; #( *) : ac_c_undeclared_builtin_options=$ac_cv_c_undeclared_builtin_options ;; esac ac_fn_check_decl "$LINENO" "SA_SIGINFO" "ac_cv_have_decl_SA_SIGINFO" "#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_SA_SIGINFO" = xyes then : ac_have_decl=1 else $as_nop ac_have_decl=0 fi printf "%s\n" "#define HAVE_DECL_SA_SIGINFO $ac_have_decl" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing sqrtl" >&5 printf %s "checking for library containing sqrtl... " >&6; } if test ${ac_cv_search_sqrtl+y} then : printf %s "(cached) " >&6 else $as_nop ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char sqrtl (); int main (void) { return sqrtl (); ; return 0; } _ACEOF for ac_lib in '' m 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_sqrtl=$ac_res fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext if test ${ac_cv_search_sqrtl+y} then : break fi done if test ${ac_cv_search_sqrtl+y} then : else $as_nop ac_cv_search_sqrtl=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sqrtl" >&5 printf "%s\n" "$ac_cv_search_sqrtl" >&6; } ac_res=$ac_cv_search_sqrtl if test "$ac_res" != no then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing fmod" >&5 printf %s "checking for library containing fmod... " >&6; } if test ${ac_cv_search_fmod+y} then : printf %s "(cached) " >&6 else $as_nop ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char fmod (); int main (void) { return fmod (); ; return 0; } _ACEOF for ac_lib in '' m 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_fmod=$ac_res fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext if test ${ac_cv_search_fmod+y} then : break fi done if test ${ac_cv_search_fmod+y} then : else $as_nop ac_cv_search_fmod=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_fmod" >&5 printf "%s\n" "$ac_cv_search_fmod" >&6; } ac_res=$ac_cv_search_fmod if test "$ac_res" != no then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi ac_fn_c_check_header_compile "$LINENO" "math.h" "ac_cv_header_math_h" "$ac_includes_default" if test "x$ac_cv_header_math_h" = xyes then : printf "%s\n" "#define HAVE_MATH_H 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "sqrtl" "ac_cv_func_sqrtl" if test "x$ac_cv_func_sqrtl" = xyes then : printf "%s\n" "#define HAVE_SQRTL 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "fmod" "ac_cv_func_fmod" if test "x$ac_cv_func_fmod" = xyes then : printf "%s\n" "#define HAVE_FMOD 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5 printf %s "checking for library containing clock_gettime... " >&6; } if test ${ac_cv_search_clock_gettime+y} then : printf %s "(cached) " >&6 else $as_nop ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char clock_gettime (); int main (void) { return clock_gettime (); ; return 0; } _ACEOF for ac_lib in '' rt 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_clock_gettime=$ac_res fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext if test ${ac_cv_search_clock_gettime+y} then : break fi done if test ${ac_cv_search_clock_gettime+y} then : else $as_nop ac_cv_search_clock_gettime=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5 printf "%s\n" "$ac_cv_search_clock_gettime" >&6; } ac_res=$ac_cv_search_clock_gettime if test "$ac_res" != no then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi for ac_func in alarm basename clock_gettime dup2 getcwd memcpy memmove memset mkdir select setlocale strchr strerror strrchr strstr do : as_ac_var=`printf "%s\n" "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 `printf "%s\n" "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else $as_nop as_fn_error $? "required function is missing" "$LINENO" 5 fi done for ac_header in fcntl.h sys/file.h sys/time.h unistd.h do : as_ac_Header=`printf "%s\n" "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 `printf "%s\n" "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else $as_nop as_fn_error $? "required header file is missing" "$LINENO" 5 fi done ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t" case $ac_cv_c_int32_t in #( no|yes) ;; #( *) printf "%s\n" "#define int32_t $ac_cv_c_int32_t" >>confdefs.h ;; esac ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" if test "x$ac_cv_type_mode_t" = xyes then : else $as_nop printf "%s\n" "#define mode_t int" >>confdefs.h 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 $as_nop printf "%s\n" "#define off_t long int" >>confdefs.h 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 $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined _WIN64 && !defined __CYGWIN__ LLP64 #endif int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_pid_type='int' else $as_nop ac_pid_type='__int64' fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext printf "%s\n" "#define pid_t $ac_pid_type" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes then : else $as_nop printf "%s\n" "#define size_t unsigned int" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default" if test "x$ac_cv_type_ssize_t" = xyes then : else $as_nop printf "%s\n" "#define ssize_t int" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 printf %s "checking for uid_t in sys/types.h... " >&6; } if test ${ac_cv_type_uid_t+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "uid_t" >/dev/null 2>&1 then : ac_cv_type_uid_t=yes else $as_nop ac_cv_type_uid_t=no fi rm -rf conftest* fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 printf "%s\n" "$ac_cv_type_uid_t" >&6; } if test $ac_cv_type_uid_t = no; then printf "%s\n" "#define uid_t int" >>confdefs.h printf "%s\n" "#define gid_t int" >>confdefs.h fi ac_fn_c_check_member "$LINENO" "struct stat" "st_rdev" "ac_cv_member_struct_stat_st_rdev" "$ac_includes_default" if test "x$ac_cv_member_struct_stat_st_rdev" = xyes then : printf "%s\n" "#define HAVE_STRUCT_STAT_ST_RDEV 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking siginfo_t provides a signal sender's PID" >&5 printf %s "checking siginfo_t provides a signal sender's PID... " >&6; } if test "$cross_compiling" = yes then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: cannot check, assuming yes" >&5 printf "%s\n" "cannot check, assuming yes" >&6; } printf "%s\n" "#define SIGINFO_PROVIDES_PID 1" >>confdefs.h else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include static pid_t signalSender = 0; #ifdef SA_SIGINFO static void receiveUSR2( __attribute__((unused)) int sig, siginfo_t * info, __attribute__((unused)) void *ucontext) { if (NULL != info) signalSender = info->si_pid; } #endif int main (void) { struct sigaction sa; memset(&sa, 0, sizeof(sa)); #ifdef SA_SIGINFO sa.sa_sigaction = receiveUSR2; (void) sigemptyset(&(sa.sa_mask)); sa.sa_flags = SA_SIGINFO; (void) sigaction(SIGUSR2, &sa, NULL); raise(SIGUSR2); #endif return signalSender < 1 ? 1 : 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } printf "%s\n" "#define SIGINFO_PROVIDES_PID 1" >>confdefs.h else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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 # Check whether --enable-debugging was given. if test ${enable_debugging+y} then : enableval=$enable_debugging; if test "$enable_debugging" = "yes"; then CFLAGS="$CFLAGS -g -Wall" printf "%s\n" "#define ENABLE_DEBUGGING 1" >>confdefs.h fi fi # Check whether --enable-profiling was given. if test ${enable_profiling+y} then : enableval=$enable_profiling; if test "$enable_profiling" = "yes"; then CFLAGS="-pg $CFLAGS" fi fi SPLICE_SUPPORT="no" # Check whether --enable-splice was given. if test ${enable_splice+y} then : enableval=$enable_splice; if test "$enable_splice" = "yes"; then SPLICE_SUPPORT="yes" fi else $as_nop SPLICE_SUPPORT="yes" fi IPC_SUPPORT="no" # Check whether --enable-ipc was given. if test ${enable_ipc+y} then : enableval=$enable_ipc; if test "$enable_ipc" = "yes"; then IPC_SUPPORT="yes" fi else $as_nop IPC_SUPPORT="yes" fi # Check whether --with-ncurses was given. if test ${with_ncurses+y} then : withval=$with_ncurses; else $as_nop with_curses=yes fi if test "x$with_ncurses" != xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing tigetnum" >&5 printf %s "checking for library containing tigetnum... " >&6; } if test ${ac_cv_search_tigetnum+y} then : printf %s "(cached) " >&6 else $as_nop ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char tigetnum (); int main (void) { return tigetnum (); ; return 0; } _ACEOF for ac_lib in '' tinfo ncurses 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_tigetnum=$ac_res fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext if test ${ac_cv_search_tigetnum+y} then : break fi done if test ${ac_cv_search_tigetnum+y} then : else $as_nop ac_cv_search_tigetnum=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_tigetnum" >&5 printf "%s\n" "$ac_cv_search_tigetnum" >&6; } ac_res=$ac_cv_search_tigetnum if test "$ac_res" != no then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" for ac_header in term.h do : ac_fn_c_check_header_compile "$LINENO" "term.h" "ac_cv_header_term_h" "$ac_includes_default" if test "x$ac_cv_header_term_h" = xyes then : printf "%s\n" "#define HAVE_TERM_H 1" >>confdefs.h printf "%s\n" "#define ENABLE_NCURSES 1" >>confdefs.h fi done fi fi # Check whether --enable-static was given. if test ${enable_static+y} then : enableval=$enable_static; if test "$enable_static" = "yes"; then CFLAGS="$CFLAGS -static" fi fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef _AIX yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "^yes$" >/dev/null 2>&1 then : LIBS="$LIBS -lc128" fi rm -rf conftest* if test "$IPC_SUPPORT" = "yes"; then for ac_header in sys/ipc.h do : ac_fn_c_check_header_compile "$LINENO" "sys/ipc.h" "ac_cv_header_sys_ipc_h" "$ac_includes_default" if test "x$ac_cv_header_sys_ipc_h" = xyes then : printf "%s\n" "#define HAVE_SYS_IPC_H 1" >>confdefs.h else $as_nop IPC_SUPPORT=no fi done for ac_header in sys/shm.h do : ac_fn_c_check_header_compile "$LINENO" "sys/shm.h" "ac_cv_header_sys_shm_h" "$ac_includes_default" if test "x$ac_cv_header_sys_shm_h" = xyes then : printf "%s\n" "#define HAVE_SYS_SHM_H 1" >>confdefs.h else $as_nop IPC_SUPPORT=no fi done ac_fn_c_check_header_compile "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" "$ac_includes_default" if test "x$ac_cv_header_sys_param_h" = xyes then : printf "%s\n" "#define HAVE_SYS_PARAM_H 1" >>confdefs.h fi if test "$IPC_SUPPORT" = "yes"; then for ac_func in shmget do : ac_fn_c_check_func "$LINENO" "shmget" "ac_cv_func_shmget" if test "x$ac_cv_func_shmget" = xyes then : printf "%s\n" "#define HAVE_SHMGET 1" >>confdefs.h else $as_nop IPC_SUPPORT=no fi done fi fi if test "$IPC_SUPPORT" = "yes"; then printf "%s\n" "#define HAVE_IPC 1" >>confdefs.h fi if test "$SPLICE_SUPPORT" = "yes"; then ac_fn_c_check_func "$LINENO" "splice" "ac_cv_func_splice" if test "x$ac_cv_func_splice" = xyes then : printf "%s\n" "#define HAVE_SPLICE 1" >>confdefs.h fi fi CPPFLAGS="$CPPFLAGS -I\$(top_srcdir)/src/include" ac_c_werror_flag=yes ac_config_files="$ac_config_files po/Makefile.in Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 printf "%s\n" "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 printf %s "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5 printf "%s\n" "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi # Reset variables that may have inherited troublesome values from # the environment. # IFS needs to be set, to space, tab, and newline, in precisely that order. # (If _AS_PATH_WALK were called with IFS unset, it would have the # side effect of setting IFS to empty, thus disabling word splitting.) # Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl IFS=" "" $as_nl" PS1='$ ' PS2='> ' PS4='+ ' # Ensure predictable behavior from utilities with locale-dependent output. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # We cannot yet rely on "unset" to work, but we need these variables # to be unset--not just set to an empty or harmless value--now, to # avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct # also avoids known problems related to "unset" and subshell syntax # in other old shells (e.g. bash 2.01 and pdksh 5.2.14). for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH do eval test \${$as_var+y} \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done # Ensure that fds 0, 1, and 2 are open. if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null then : eval 'as_fn_append () { eval $1+=\$2 }' else $as_nop as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null then : eval 'as_fn_arith () { as_val=$(( $* )) }' else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # Determine whether it's possible to make 'echo' print without a newline. # These variables are no longer used directly by Autoconf, but are AC_SUBSTed # for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac # For backward compatibility with old third-party macros, we provide # the shell variables $as_echo and $as_echo_n. New code should use # AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. as_echo='printf %s\n' as_echo_n='printf %s' rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by pv $as_me 1.9.31, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to . pv home page: ." _ACEOF ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ pv config.status 1.9.31 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" Copyright (C) 2021 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) printf "%s\n" "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) printf "%s\n" "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX printf "%s\n" "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" # Capture the value of obsolete ALL_LINGUAS because we need it to compute # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. 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 "src/include/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/include/config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "po-directories") CONFIG_COMMANDS="$CONFIG_COMMANDS po-directories" ;; "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 printf "%s\n" "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`printf "%s\n" "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 printf "%s\n" "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. case $CONFIG_FILES in #( *\'*) : eval set x "$CONFIG_FILES" ;; #( *) : set x $CONFIG_FILES ;; #( *) : ;; esac shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`printf "%s\n" "$am_mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`$as_dirname -- "$am_mf" || $as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$am_mf" : 'X\(//\)[^/]' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$am_mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` am_filepart=`$as_basename -- "$am_mf" || $as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$am_mf" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` { echo "$as_me:$LINENO: cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles" >&5 (cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } || am_rc=$? done if test $am_rc -ne 0; then { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "Something went wrong bootstrapping makefile fragments for automatic dependency tracking. If GNU make was not used, consider re-running the configure script with MAKE=\"gmake\" (or whatever is necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking). See \`config.log' for more details" "$LINENO" 5; } fi { am_dirpart=; unset am_dirpart;} { am_filepart=; unset am_filepart;} { am_mf=; unset am_mf;} { am_rc=; unset am_rc;} rm -f conftest-deps.mk } ;; "po-directories":C) for ac_file in $CONFIG_FILES; do # Support "outfile[:infile[:infile...]]" case "$ac_file" in *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; esac # PO directories have a Makefile.in generated from Makefile.in.in. case "$ac_file" in */Makefile.in) # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'` ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac # Treat a directory as a PO directory if and only if it has a # POTFILES.in file. This allows packages to have multiple PO # directories under different names or in different locations. if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then rm -f "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" gt_tab=`printf '\t'` cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" POMAKEFILEDEPS="POTFILES.in" # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend # on $ac_dir but don't depend on user-specified configuration # parameters. if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then # The LINGUAS file contains the set of available languages. if test -n "$OBSOLETE_ALL_LINGUAS"; then test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi ALL_LINGUAS=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # The set of available languages was given in configure.in. ALL_LINGUAS=$OBSOLETE_ALL_LINGUAS fi # Compute POFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) # Compute UPDATEPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) # Compute DUMMYPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) # Compute GMOFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) case "$ac_given_srcdir" in .) srcdirpre= ;; *) srcdirpre='$(srcdir)/' ;; esac POFILES= UPDATEPOFILES= DUMMYPOFILES= GMOFILES= for lang in $ALL_LINGUAS; do POFILES="$POFILES $srcdirpre$lang.po" UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" DUMMYPOFILES="$DUMMYPOFILES $lang.nop" GMOFILES="$GMOFILES $srcdirpre$lang.gmo" done # CATALOGS depends on both $ac_dir and the user's LINGUAS # environment variable. INST_LINGUAS= if test -n "$ALL_LINGUAS"; then for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "$LINGUAS"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then INST_LINGUAS="$INST_LINGUAS $presentlang" fi done fi CATALOGS= if test -n "$INST_LINGUAS"; then for lang in $INST_LINGUAS; do CATALOGS="$CATALOGS $lang.gmo" done fi test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do if test -f "$f"; then case "$f" in *.orig | *.bak | *~) ;; *) cat "$f" >> "$ac_dir/Makefile" ;; esac fi done fi ;; esac done ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi pv-1.9.31/configure.ac000066400000000000000000000123521474702661500145370ustar00rootroot00000000000000dnl Process this file with autoconf to produce a configure script. dnl dnl Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2025 Andrew Wood dnl dnl License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. AC_INIT([pv], [1.9.31], [pv@ivarch.com], [pv], [https://www.ivarch.com/programs/pv.shtml]) AC_CONFIG_SRCDIR([src/include/config.h.in]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_HEADERS([src/include/config.h]) AM_INIT_AUTOMAKE([-Wall -Werror foreign]) AC_LANG(C) AC_PROG_CC AC_PROG_INSTALL AC_USE_SYSTEM_EXTENSIONS AC_C_CONST AC_HEADER_STDBOOL AC_SYS_LARGEFILE AM_GNU_GETTEXT_VERSION([0.21]) AM_GNU_GETTEXT([external]) if test "$USE_NLS" = "yes"; then CPPFLAGS="$CPPFLAGS -DLOCALEDIR=\\\"\$(localedir)\\\"" LIBS="$LIBS $LIBINTL" fi dnl Items we can use if present, but can do without if not present. AC_CHECK_FUNCS([getopt_long]) AC_CHECK_FUNCS([vsnprintf strlcat strtoul memrchr]) AC_CHECK_FUNCS([fdatasync]) AC_CHECK_FUNCS([fpathconf sysconf posix_memalign posix_fadvise]) AC_CHECK_FUNCS([nanosleep]) AC_CHECK_FUNCS([setitimer]) AC_CHECK_FUNCS([setproctitle]) AC_CHECK_HEADERS([getopt.h]) AC_CHECK_HEADERS([limits.h]) AC_CHECK_HEADERS([langinfo.h]) AC_CHECK_HEADERS([wctype.h]) AC_CHECK_HEADERS([termios.h]) AC_CHECK_HEADERS([libgen.h]) AC_CHECK_HEADERS([sys/ioctl.h]) AC_CHECK_HEADERS([libintl.h locale.h]) AC_CHECK_HEADERS([sys/sysmacros.h]) AC_CHECK_MEMBERS([struct stat.st_blksize]) AC_CHECK_DECLS([SA_SIGINFO], [], [], [[#include ]]) AC_SEARCH_LIBS([sqrtl],[m]) AC_SEARCH_LIBS([fmod],[m]) AC_CHECK_HEADERS([math.h]) AC_CHECK_FUNCS([sqrtl]) AC_CHECK_FUNCS([fmod]) dnl Libraries that may contain key functions. AC_SEARCH_LIBS([clock_gettime],[rt]) dnl Items we can't do without. AC_CHECK_FUNCS([alarm basename clock_gettime dup2 getcwd memcpy memmove memset mkdir select setlocale strchr strerror strrchr strstr], [], [AC_MSG_ERROR([required function is missing])]) AC_CHECK_HEADERS([fcntl.h sys/file.h sys/time.h unistd.h], [], [AC_MSG_ERROR([required header file is missing])]) dnl Make sure all the types we use are defined. AC_TYPE_INT32_T AC_TYPE_MODE_T AC_TYPE_OFF_T AC_TYPE_PID_T AC_TYPE_SIZE_T AC_TYPE_SSIZE_T AC_TYPE_UID_T AC_CHECK_MEMBERS([struct stat.st_rdev]) dnl Check whether a signal handler can see the PID of the sender. AC_MSG_CHECKING([siginfo_t provides a signal sender's PID]) AC_RUN_IFELSE( [AC_LANG_PROGRAM([[ #include #include #include static pid_t signalSender = 0; #ifdef SA_SIGINFO static void receiveUSR2( __attribute__((unused)) int sig, siginfo_t * info, __attribute__((unused)) void *ucontext) { if (NULL != info) signalSender = info->si_pid; } #endif ]], [[ struct sigaction sa; memset(&sa, 0, sizeof(sa)); #ifdef SA_SIGINFO sa.sa_sigaction = receiveUSR2; (void) sigemptyset(&(sa.sa_mask)); sa.sa_flags = SA_SIGINFO; (void) sigaction(SIGUSR2, &sa, NULL); raise(SIGUSR2); #endif return signalSender < 1 ? 1 : 0; ]])], [ AC_MSG_RESULT([yes]) AC_DEFINE([SIGINFO_PROVIDES_PID], [1], [Signal handlers can determine the sending PID]) ], [ AC_MSG_RESULT([no]) ], [ AC_MSG_RESULT([cannot check, assuming yes]) AC_DEFINE([SIGINFO_PROVIDES_PID], [1], [Signal handlers can determine the sending PID]) ] ) AH_BOTTOM([#include "config-aux.h"]) AC_ARG_ENABLE([debugging], [AS_HELP_STRING([--enable-debugging], [compile with debugging support])], if test "$enable_debugging" = "yes"; then CFLAGS="$CFLAGS -g -Wall" AC_DEFINE([ENABLE_DEBUGGING], [1], [Debugging support enabled]) fi ) AC_ARG_ENABLE([profiling], [AS_HELP_STRING([--enable-profiling], [compile with profiling support])], if test "$enable_profiling" = "yes"; then CFLAGS="-pg $CFLAGS" fi ) SPLICE_SUPPORT="no" AC_ARG_ENABLE([splice], [AS_HELP_STRING([--disable-splice], [do not use splice system call])], if test "$enable_splice" = "yes"; then SPLICE_SUPPORT="yes" fi, SPLICE_SUPPORT="yes" ) IPC_SUPPORT="no" AC_ARG_ENABLE([ipc], [AS_HELP_STRING([--disable-ipc], [turn off IPC messaging])], if test "$enable_ipc" = "yes"; then IPC_SUPPORT="yes" fi, IPC_SUPPORT="yes" ) AC_ARG_WITH([ncurses], [AS_HELP_STRING([--without-ncurses], [disable the use of ncurses for terminal info])], [], [with_curses=yes]) AS_IF([test "x$with_ncurses" != xno], [ AC_SEARCH_LIBS([tigetnum],[tinfo ncurses], [ AC_CHECK_HEADERS([term.h],[ AC_DEFINE([ENABLE_NCURSES], [1], [Build with ncurses support]) ]) ], []) ], []) AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static], [enable static linking])], [ if test "$enable_static" = "yes"; then CFLAGS="$CFLAGS -static" fi ]) dnl AIX needs -lc128 AC_EGREP_CPP([^yes$], [#ifdef _AIX yes #endif ], [LIBS="$LIBS -lc128"]) if test "$IPC_SUPPORT" = "yes"; then AC_CHECK_HEADERS([sys/ipc.h], [], [IPC_SUPPORT=no]) AC_CHECK_HEADERS([sys/shm.h], [], [IPC_SUPPORT=no]) AC_CHECK_HEADERS([sys/param.h]) if test "$IPC_SUPPORT" = "yes"; then AC_CHECK_FUNCS([shmget], [], [IPC_SUPPORT=no]) fi fi if test "$IPC_SUPPORT" = "yes"; then AC_DEFINE([HAVE_IPC], [1], [IPC support enabled]) fi if test "$SPLICE_SUPPORT" = "yes"; then AC_CHECK_FUNCS([splice]) fi CPPFLAGS="$CPPFLAGS -I\$(top_srcdir)/src/include" dnl This must go after all the compiler based tests above. AC_LANG_WERROR AC_CONFIG_FILES([ po/Makefile.in Makefile ]) AC_OUTPUT pv-1.9.31/docs/000077500000000000000000000000001474702661500131765ustar00rootroot00000000000000pv-1.9.31/docs/ACKNOWLEDGEMENTS.md000066400000000000000000000273731474702661500160660ustar00rootroot00000000000000The following people have contributed to this project, and their assistance is acknowledged and greatly appreciated: * Antoine Beaupré - Debian package maintainer * Kevin Coyner - previous Debian package maintainer * Cédric Delfosse - previous Debian package maintainer * Jakub Hrozek - Fedora package maintainer * Eduardo Aguiar - provided Portuguese (Brazilian) translation * Stéphane Lacasse - provided French translation * Marcos Kreinacke - provided German translation * Bartosz FeÅ„ski - provided Polish translation along with Krystian Zubel * Joshua Jensen - reported RPM installation bug * Boris Folgmann - reported cursor handling bug * Mathias Gumz - reported NLS bug * Daniel Roethlisberger - submitted patch to use lockfiles for **-c** if terminal locking fails * Adam Buchbinder - lots of help with a Cygwin port of **-c** * Mark Tomich - suggested **-B** option * Gert Menke - reported bug when piping to `dd` with a large input buffer size * Ville Herva - informative bug report about rate limiting performance * Elias Pipping - patch to compile properly on Darwin 9; potential NULL deref report * Patrick Collison - similar patch for OS X * Boris Lohner - reported problem that **-L** does not complain if given non-numeric value * Sebastian Kayser - supplied testing for *SIGPIPE*, demonstrated internationalisation problem * Laszlo Ersek - reported shared memory leak on *SIGINT* with **-c** * Phil Rutschman - provided a patch for fully restoring terminal state on exit * Henry Precheur - reporting and suggestions for **--rate-limit** bug when rate is under 10 * E. Rosten - supplied patch for block buffering in line mode * Kjetil Torgrim Homme - reported compilation error with default *CFLAGS* on non-GCC compilers * Alexandre de Verteuil - reported bug in OS X build and supplied test environment to fix in * Martin Baum - supplied patch to return nonzero exit status if terminated by signal * Sam Nelson - supplied patch to fix trailing slash on *DESTDIR* * Daniel Pape - reported Cygwin installation problem due to *DESTDIR* * Philipp Beckers - ported to the Syabas PopcornHour A-100 series * Henry Gebhard - supplied patches to improve SI prefixes and add **--average-rate** * Vladimir Kokarev, Alexander Leo - reported that exit status did not reflect file errors * Thomas Rachel - submitted patches for IEEE1541 (MiB suffixes), 1+e03 bug * Guillaume Marcais - submitted speedup patch for line mode * Moritz Barsnick - submitted patch for compile warning in size calculation * Pawel Piatek - submitted RPM and patches for AIX * Sami Liedes - submitted patch for **--timer** and **--bytes** with **--numeric** * Steven Willis - reported problem with **-R** killing non-PV remote processes * Vladimir Pal, Vladimir Ermakov - submitted patch which led to development of **--format** option * Peter Samuelson - submitted patch to calculate size if stdout is a block device * Miguel Diaz - much Cygwin help (and packaging), found narrow-terminal bug * Jim Salter - commissioned work on the **--skip-errors** option * Wouter Pronk - reported build problem on SCO * Bryan Dongray - provided patches for test scripts failing on older Red Hats * Zev Weiss - provided patch to fix `splice()` not using stdin * Zing Shishak - provided patch for **--null** / **-0** (count null terminated lines) * Jacek Wielemborek - implemented fdwatch in Python, suggested PV port; reported bug with **-l** and ETA / size; many other contributions * Kim Krecht - suggested buffer fill status and last bytes output display options * Cristian Ciupitu , Josh Stone - pointed out file descriptor leak with helpful suggestions (Josh Stone initially noticed the missing close) * Jan Seda - found issue with `splice()` and *SPLICE_F_NONBLOCK* causing slowdown * André Stapf - pointed out formatting problem e.g. 13GB -> 13.1GB which should be shown 13.0GB -> 13.1GB; highlighted on-startup row swapping in **-c**, and suggested **--discard**; suggested making **--fineta** have a "FIN" prefix * Damon Harper - suggested **-D** / **--delay-start** option * Ganaël Laplanche - provided patch for `lstat64()` on systems that do not support it * Peter Korsgaard - provided similar patch for `lstat64()`, specifically for uClibc support; provided AIX cross-compilation patch to fix bug in **-lc128** check * Ralf Ramsauer - reported bug which dropped transfer rate on terminal resize * Michiel Van Herwegen - reported and discussed bug with **-l** and ETA / size * Erkki Seppälä - provided patch implementing **-I** * Eric A. Borisch - provided details of compatibility fix for "`%Lu`" in watchpid code * Jan Venekamp - reported MacOS buffer size interactions with pipes * Matt - provided "rate-window" patches for rate calculation * [Filippo Valsorda](https://github.com/FiloSottile) - provided patch for stat64 issue on Apple Silicon * Matt Koscica, William Dillon - also reported stat64 issue on Apple Silicon * [Demitri Muna](https://github.com/demitri) - assisted with stat64 patch on Apple Silicon * Norman Rasmussen - suggested **-c** with **-d PID:FD**, reject **-N** with **-d PID** * Andriy Gapon, Jonathan Elchison - reported bug where "`pv /dev/zero >/dev/null &`" stops immediately * Marcelo Chiesa - reported unused-result warnings when compiling PV 1.6.6 * Jered Floyd - provided patches to improve **--rate-limit** * Christoph Biedl - provided ETA and dynamic interval patches * Richard Fonfara - provided German translations for "`pv --help`" * Johannes Gerer - suggested that **-B** should enable **-C** * Sam James - provided fix for number.c build issue caused by missing stddef.h * Jakub Wilk - corrected README encoding * Frederik Eaton - reported issue with `<()` shell constructs * [gray](https://github.com/gray) - reported issue with **--force** and terminal process groups, and proposed a patch * [Luc Gommans](https://github.com/lgommans) / https://lgms.nl/ - provided a "momentary ETA" patch * [ikasty](https://github.com/ikasty) - added relative filename display to **--watchfd** * [Michael Weiß](https://github.com/quitschbo) - corrected behaviour when not attached to a terminal * [christoph-zededa](https://github.com/christoph-zededa) - provided OS X support for **--watchfd** * [Dave Beckett](https://github.com/dajobe) - added "`@filename`" syntax to **--size**, and corrected an autoconf problem with stat64 on OS X * [Volodymyr Bychkovyak](https://github.com/vbychkoviak) - provided fix for rate limit behaviour with bursty traffic * [Nick Black](https://nick-black.com) - added **--bits** option * [Andrew Schulman](https://github.com/andrew-schulman) - provided reproducible example of terminal size detection issue in 1.7.17/1.7.18 * [fuschia74](https://github.com/fuchsia74) - provided **--enable-static** patch for "`configure`" * [Wilhelm von Thiele](https://github.com/TurtleWilly) - assisted with OS X cleanups ([#73](https://codeberg.org/a-j-wood/pv/issues/73), [#74](https://codeberg.org/a-j-wood/pv/issues/74)) * MatÄ›jů Miroslav, Ing. - suggested fix for ETA and elapsed time faults when suspending and resuming a machine ([#13](https://codeberg.org/a-j-wood/pv/issues/13)) * Anthony DeRobertis - suggested the **--error-skip-block** option ([#37](https://codeberg.org/a-j-wood/pv/issues/37)) * Benoit Pierre - provided patches for compilation without IPC support, without HAVE_STRUCT_STAT_ST_BLKSIZE, and on MacOS * [gustav-b](https://codeberg.org/gustav-b) - suggested percentage formatting correction ([#80](https://codeberg.org/a-j-wood/pv/issues/80)) * [Thomas Bertels](https://codeberg.org/tbertels) - updated French translations ([#83](https://codeberg.org/a-j-wood/pv/pulls/83)) * [kevinruddy](https://codeberg.org/kevinruddy) - added decimal units option ([#85](https://codeberg.org/a-j-wood/pv/pulls/85)) * [xmort](https://codeberg.org/xmort) - added **--output** option ([#90](https://codeberg.org/a-j-wood/pv/pulls/90)) * [bogiord](https://codeberg.org/bogiord) - reported the loss of output block device size detection in 1.8.10, and suggested the fix ([#91](https://codeberg.org/a-j-wood/pv/issues/91)) * [eborisch](https://codeberg.org/eborisch) - provided fix for misbehaviour when used with "`zfs send`" due to treating zero sized writes (generally due to timer interruption) as end of file ([#92](https://codeberg.org/a-j-wood/pv/pulls/92), [#93](https://codeberg.org/a-j-wood/pv/pulls/93)) * [alexanderperlis](https://codeberg.org/alexanderperlis) - provided initial support for block devices with **--size `@`FILE** ([#94](https://codeberg.org/a-j-wood/pv/pulls/94)) * [jettero](https://codeberg.org/jettero) - reported double-free coredump when using **--watchfd** after 1.8.10 ([#96](https://codeberg.org/a-j-wood/pv/issues/96)) * Venky.N.Iyer - suggested **--stats** ([#49](https://codeberg.org/a-j-wood/pv/issues/49)) * Roland Kletzing - suggested **--rate** with **--numeric** ([#17](https://codeberg.org/a-j-wood/pv/issues/17)) * [Michael Mior](https://codeberg.org/michaelmior) - suggested **--store-and-forward** ([#100](https://codeberg.org/a-j-wood/pv/issues/100)) * [dbungert](https://codeberg.org/dbungert) - reported issue with *valgrind* 3.23 misreporting leaking file descriptors ([#97](https://codeberg.org/a-j-wood/pv/issues/97)) * Joachim Haga - suggested showing progress in the window title ([#3](https://codeberg.org/a-j-wood/pv/issues/3)) * [Martin Sarsale](https://github.com/runa) - suggested showing progress in the process title ([#4](https://codeberg.org/a-j-wood/pv/issues/4)) * [2bits](https://github.com/2bits) - reported position sensing fault with **--watchfd** in 1.9.0 ([#118](https://codeberg.org/a-j-wood/pv/issues/118)) * [heitbaum](https://codeberg.org/heitbaum) - assisted with cross-compilation fault introduced in 1.9.7 ([#120](https://codeberg.org/a-j-wood/pv/issues/120)) * [meego](https://codeberg.org/meego) - suggested "**%nL**", the last line preview ([#121](https://codeberg.org/a-j-wood/pv/issues/121)) * [Alexander Petrossian](https://github.com/neopaf) - suggested using Unicode output for a more granular progress bar, and provided the codepoints to use ([#15](https://codeberg.org/a-j-wood/pv/issues/15)) * [jmealo](https://codeberg.org/jmealo) - suggested JSON progress output ([#127](https://codeberg.org/a-j-wood/pv/issues/127)) Translations provided through [Codeberg Weblate](https://translate.codeberg.org/projects/pv/): * **Czech** * [mmatous](https://translate.codeberg.org/user/mmatous/) (135) * **French** * anonymous suggestions (7) * **German** * [Hartmut Goebel](https://translate.codeberg.org/user/htgoebel/) (77) * [m0yellow](https://translate.codeberg.org/user/m0yellow/) (9) * [Benny](https://translate.codeberg.org/user/Benny/) (7) * [kre](https://translate.codeberg.org/user/kre/) (2) * [fnetX](https://translate.codeberg.org/user/fnetX/) (1) * **Polish** * [coralpink](https://translate.codeberg.org/user/coralpink/) (106) * **Russian** * [0ko](https://translate.codeberg.org/user/0ko/) (157) * **Turkish** * [omerdduran](https://translate.codeberg.org/user/omerdduran/) (129) --- pv-1.9.31/docs/COPYING000066400000000000000000001045151474702661500142370ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If 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 convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 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 . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . pv-1.9.31/docs/DEVELOPERS.md000066400000000000000000000162761474702661500152040ustar00rootroot00000000000000# Notes for developers and translators The following _configure_ options will be of interest to developers and translators: * **--enable-debugging** - build in debugging support * **--enable-profiling** - build in support for profiling These targets are available when running _make_: * "`make analyse`" - run _splint_ and _flawfinder_ on all C source files ## Debugging and profiling support When "`./configure --enable-debugging`" is used, the _pv_ produced by _make_ will support an extra option, "**--debug FILE**", which will cause debugging output to be written to *FILE*. This is not recommended for production builds due to the extra processing it introduces, and the potential size of the output. Within the code, "**debug()**" is used in a similar way to "**printf()**". It will automatically include the calling function, source file, and line number, so they don't need to be included in the parameters. When debugging support is not enabled, it evaluates to a null statement. This does mean that if you call "**debug()**", make sure it has no side effects, as they won't be present in builds without debugging support. Builds produced after "`./configure --enable-profiling`" will write profile data when run, to be used with _gprof_. See "`man gprof`" for details. Please note that the memory safety checks will fail with profiling enabled. ## Source code analysis Running "`make analyse`" runs _splint_ and _flawfinder_ on all C sources, writing the output of both programs to files named _"*.e"_ for each _"*.c"_. There are no dependency rules set up for these _".e"_ files, so if a header file is altered, manually remove the relevant _".e"_ files, or update the timestamp of the relevant _".c"_ files, before running "`make analyse`" again. The goal is for all C source files to generate zero warnings from either tool. Wherever warnings are disabled by annotations to the source, there should be associated commentary nearby explaining the rationale behind it, and any assumptions made. This is so that there can be some assurance that the issue highlighted by the analyser has been considered properly, as well as documenting anything that might need further work if the surrounding code is altered in future. ## Translation notes Translators can use the Weblate instance hosted by Codeberg: [https://translate.codeberg.org/projects/pv/](https://translate.codeberg.org/projects/pv/) If you don't see your language listed, raise an issue on the issue tracker (or just email the maintainer) asking for it to be added. Alternatively, read on for details of how to maintain the translations directly within the source tree. The message catalogues used to translate program messages into other languages are in the _"po/"_ directory, named _"xx.po"_, where _"xx"_ is the ISO 639-1 2-letter language code, such as "**fr**" for French. Each of these files contains lines like this: #: src/pv/cursor.c:85 msgid "failed to get terminal name" msgstr "erro ao ler o nome do terminal" The comment line, starting _"#"_, shows the source filename and line number at which this message can be found. The _"msgid"_ is the original message in the program, in English. The _"msgstr"_ is the translated text. It is the _"msgstr"_ lines which need to be updated by translators. Message catalogue files should all be encoded as UTF-8. After making a change to a _".po"_ file, test it by compiling it and installing to a temporary location, like this: ./configure --enable-debugging --prefix=/tmp/yourtest make clean make install localedef -f UTF-8 -i de_DE /tmp/yourtest/share/locale/de_DE.UTF-8 bash export LOCPATH=/tmp/yourtest/share/locale export LC_ALL=de_DE.UTF-8 export LANGUAGE=de_DE /tmp/yourtest/bin/pv --help exit Replace "**--help**" with whatever is appropriate for your test. In this example, the language being tested is _"de"_ (German), on a system which is running with UTF-8 support. In the example above, a new shell is started by typing "`bash`" so that after your tests, "`exit`" will return you to your previous shell with your language settings intact. Note that at the start, you have to re-run _configure_ with "**--prefix**" rather than using "`make DESTDIR=...`", because the locale directory is set at compile time. Also, on Debian at least, both the environment variables _"LC_ALL"_ and _"LANGUAGE"_ must be set. To find untranslated strings in a language that's already supported but which you can help with gaps in, use this command: msgattrib --untranslated < po/fr.po replacing _"po/fr.po"_ as appropriate. To add a new language, create the new message catalogue file under _"po/"_ by copying _"po/pv.pot"_ to _"po/xx.po"_, where _"xx"_ is the language code, and adjusting it. The _".pot"_ file is generated automatically by _make_. Next, add the language code to _"po/LINGUAS"_ - this is a list of the 2-letter codes of the supported languages. Finally, run "`./config.status`" and "`make -C po update-po`". When the source code is updated, running "`make -C po update-po`" will update the _"pv.pot"_ file so that it lists where all the messages are in the source. It will also use _msgmerge_ to update all of the _".po"_ files from the updated _"pv.pot"_ file. After doing this, look for missing translations (empty _"msgstr"_ lines) or translations marked as "fuzzy", as these will need to be corrected by translators. ## Release checklist The package maintainer should run through these steps for a new release: * Check for patches and bug reports: * * * * * * * * Run "`make indent; make indent indentclean check`" * Check that _po/POTFILES.in_ is up to date * Run "`make -C po update-po`" * Run "`make analyse`" and see whether remaining warnings can be addressed * Version bump and documentation checks: * Update the version in _configure.ac_ and _docs/NEWS.md_ * Check that _docs/NEWS.md_ is up to date * Check that the manual _docs/pv.1_ is up to date * Run "`make docs/pv.1.md`" and, if using VPATH, copy the result to the source directory * Check that the year displayed by _src/main/version.c_ is correct * Ensure everything has been committed to the repository * Run "`autoreconf -is`" in the source directory * Consistency and build checks: * Wipe the build directory, and run _configure_ there * Run "`make distcheck`" * Run "`./configure && make check`" on all test systems including Cygwin, using the `tar.gz` that was just created * Run a cross-compilation check * Run "`make release MAINTAINER=`" * Update the project web site: * Copy the release _.tar.gz_, _.txt_, and _.asc_ files to the web site * Use "`pandoc --from markdown --to html`" to convert the news and manual to HTML * Update the news and manual on the web site * Update the version numbers on the web site * Update the package index on the web site * Create a new release in the repository, and apply the associated tag pv-1.9.31/docs/INSTALL000066400000000000000000000172301474702661500142320ustar00rootroot00000000000000Basic Installation ================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, a file `config.cache' that saves the results of its tests to speed up reconfiguring, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.in' is used to create `configure' by a program called `autoconf'. You only need `configure.in' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. You can give `configure' initial values for variables by setting them in the environment. Using a Bourne-compatible shell, you can do that on the command line like this: CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure Or on systems that have the `env' program, you can do it like this: env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not supports the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' can not figure out automatically, but needs to determine by the type of host the package will run on. Usually `configure' can figure that out, but if it prints a message saying it can not guess the host type, give it the `--host=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name with three fields: CPU-COMPANY-SYSTEM See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the host type. If you are building compiler tools for cross-compiling, you can also use the `--target=TYPE' option to select the type of system they will produce code for and the `--build=TYPE' option to select the type of system on which you are compiling the package. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Operation Controls ================== `configure' recognizes the following options to control how it operates. `--cache-file=FILE' Use and save the results of the tests in FILE instead of `./config.cache'. Set FILE to `/dev/null' to disable caching, for debugging `configure'. `--help' Print a summary of the options to `configure', and exit. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--version' Print the version of Autoconf used to generate the `configure' script, and exit. `configure' also accepts some other, not widely useful, options. pv-1.9.31/docs/NEWS.md000066400000000000000000001006461474702661500143030ustar00rootroot00000000000000### 1.9.31 - 28 January 2025 * *feature:* the **--format** option can now be used with **--numeric** for customised numeric output, such as JSON ([#127](https://codeberg.org/a-j-wood/pv/issues/127)) * *i18n:* German translations updated * *i18n:* Polish translations updated * *i18n:* Russian translations updated ### 1.9.27 - 12 January 2025 * *fix:* turn off IPC support if _sys/shm.h_ is not available, for compilation on Termux * *fix:* bypass valgrind checks on ARM by default due to false positives ### 1.9.25 - 22 December 2024 * *fix:* test failure of **--watchfd** on macOS corrected ([#124](https://codeberg.org/a-j-wood/pv/issues/124)) ### 1.9.24 - 19 December 2024 * *feature:* new **--format** sequences for graphical progress bars - "**%{bar-block}**", "**%{bar-granular}**", and "**%{bar-shaded}**" ([#15](https://codeberg.org/a-j-wood/pv/issues/15)) * *feature:* new **--format** sequence "**%{sgr:colour,...}**" to use ECMA-48 Select Graphic Rendition codes to add colours * *feature:* new **--bar-style** option to change the default bar style ([#15](https://codeberg.org/a-j-wood/pv/issues/15)) * *feature:* allow decimal values such as "1.5G" with "**--size**", "**--rate-limit**", "**--buffer-size**", and "**error-skip-block**" ([#35](https://codeberg.org/a-j-wood/pv/issues/35)) * *cleanup:* improve progress bar granularity on wide displays by internally tracking the transfer percentage as a decimal number * *cleanup:* correct detection of **--remote** usability on GNU Hurd * *cleanup:* reduce likelihood of race conditions in tests when running on slow systems * *cleanup:* reduce memory footprint * *docs:* simplified the synopsis section of the manual ### 1.9.15 - 8 December 2024 * *feature:* new **--format** sequence "**%nL**", showing the most recent line written ([#121](https://codeberg.org/a-j-wood/pv/issues/121)) * *feature:* each **--format** sequence now has a more readable equivalent name, for example "**%r**" can be written as "**%{rate}**" * *feature:* new **--format** sequences "**%{progress-bar-only}**" and "**%{progress-amount-only}**" * *fix:* allow **--format** to include "%nA" more than once, with different "n" values ([#122](https://codeberg.org/a-j-wood/pv/issues/122)) * *fix:* allow **--format** to include "%p" more than once, with optional width prefix * *fix:* calculate width correctly when wide characters are in **--format** strings * *fix:* add _configure_ script fallback for **--remote** check when cross-compiling ([#120](https://codeberg.org/a-j-wood/pv/issues/120)) * *fix:* allow **extra-display** to be changed by **--remote** ([#123](https://codeberg.org/a-j-wood/pv/issues/123)) * *cleanup:* refactored display formatters into separate functions * *cleanup:* improve format parser handling of dangling or invalid "%" sequences ### 1.9.7 - 2 December 2024 * *feature:* new **--extra-display** option to update window and process titles ([#3](https://codeberg.org/a-j-wood/pv/issues/3), [#4](https://codeberg.org/a-j-wood/pv/issues/4)) * *fix:* correct failure to report file positions in **--watchfd** ([#118](https://codeberg.org/a-j-wood/pv/issues/118)) * *i18n:* Russian translations added * *cleanup:* tests added for **--watchfd** ([#10](https://codeberg.org/a-j-wood/pv/issues/10)) * *cleanup:* worked around file descriptor leak false positives in valgrind 3.23 ([#97](https://codeberg.org/a-j-wood/pv/issues/97)) * *cleanup:* cleared all *shellcheck* warnings in the test scripts * *cleanup:* check at compile-time whether **--remote** is going to be usable ([#119](https://codeberg.org/a-j-wood/pv/issues/119)) ### 1.9.0 - 15 October 2024 * *feature:* new **--store-and-forward** option to read input to a file first, then write it to the output ([#100](https://codeberg.org/a-j-wood/pv/issues/100)) * *feature:* new **--stats** option to show transfer stats at the end, like "`ping`" ([#49](https://codeberg.org/a-j-wood/pv/issues/49)) * *feature:* **--rate** can now be used with **--numeric** ([#17](https://codeberg.org/a-j-wood/pv/issues/17)) * *feature:* **--gauge** with **--progress** to show rate gauge when size is unknown ([#46](https://codeberg.org/a-j-wood/pv/issues/46)) * *i18n:* comprehensive German translations update * *i18n:* comprehensive Polish translations update * *i18n:* complete Turkish translations added * *i18n:* complete Czech translations added * *i18n:* updates to French translations * *fix:* resume stopped pipelines when running in the background (part of [#56](https://codeberg.org/a-j-wood/pv/issues/56)) * *fix:* inspect the output pipe buffer to give a more accurate progress indicator of how much the next command has consumed * *fix:* prefix completion time (**--fineta**) with *FIN* rather than *ETA* ([#43](https://codeberg.org/a-j-wood/pv/issues/43)) * *fix:* surround average rate (**--average-rate**) with brackets rather than square brackets * *fix:* correct a memory leak in **--watchfd PID** * *fix:* make **--direct-io** work correctly with **--output** instead of assuming stdout * *fix:* call `posix_fadvise()` on every input, not just the first one * *fix:* write UTC timestamps in debugging mode to avoid lockups in signal handlers * *security:* added a signed *MANIFEST* file to releases * *cleanup:* removed TODO.md, since it's just an outdated copy of the issue tracker * *cleanup:* re-ordered structure members to reduce padding * *cleanup:* improved readability of *SIGTTOU* handling code * *cleanup:* refactored to separate display, transfer, and calculation more cleanly * *cleanup:* instead of moving stderr when backgrounded, set a suspend-output flag ### 1.8.14 - 7 September 2024 * *fix:* correct double-free on exit when using **--watchfd** ([#96](https://codeberg.org/a-j-wood/pv/issues/96)) reported by [jettero](https://codeberg.org/jettero) ### 1.8.13 - 18 August 2024 * *feature:* when using **--size @FILE**, *FILE* can be a block device, and its size will be used (pull request [#94](https://codeberg.org/a-j-wood/pv/pulls/94)) supplied by [alexanderperlis](https://codeberg.org/alexanderperlis) ### 1.8.12 - 18 July 2024 * *fix:* correct the detection of output block device size that was broken in 1.8.10 ([#91](https://codeberg.org/a-j-wood/pv/issues/91)) * *fix:* do not treat a zero/interrupted write as an end of file (pull requests [#92](https://codeberg.org/a-j-wood/pv/pulls/92) and [#93](https://codeberg.org/a-j-wood/pv/pulls/93)) ### 1.8.10 - 15 June 2024 * *feature:* new **--output** option to write to a file instead of standard output (pull request [#90](https://codeberg.org/a-j-wood/pv/pulls/90)) supplied by [xmort](https://codeberg.org/xmort) ### 1.8.9 - 21 April 2024 * *feature:* new **--si** option to display and interpret size suffixes in multiples of 1000 rather than 1024 (pull request [#85](https://codeberg.org/a-j-wood/pv/pulls/85)) supplied by [kevinruddy](https://codeberg.org/kevinruddy) * *fix:* continue producing progress output when the output is blocking writes ([#34](https://codeberg.org/a-j-wood/pv/issues/34), [#86](https://codeberg.org/a-j-wood/pv/issues/86), [#87](https://codeberg.org/a-j-wood/pv/issues/87)) * *fix:* honour the *TMPDIR* / *TMP* environment variables again, rather than hard-coding "`/tmp`", when using a terminal lock file (originally removed in 1.8.0) ([#88](https://codeberg.org/a-j-wood/pv/issues/88)) * *i18n:* corrections and missing strings added to French translations (pull request [#83](https://codeberg.org/a-j-wood/pv/pulls/83)) supplied by [Thomas Bertels](https://codeberg.org/tbertels) ### 1.8.5 - 19 November 2023 * *fix:* corrected percentage formatting so it doesn't jump from 2 to 3 characters wide at 100% ([#80](https://codeberg.org/a-j-wood/pv/issues/80)) * *fix:* replaced **--remote** mechanism, using a temporary file instead of SysV IPC, so it can work reliably even when there are multiple PV instances * *fix:* corrected compilation failure when without IPC support * *security:* addressed all issues highlighted by the software auditing tools "`splint`" and "`flawfinder`" (see "`make analyse`") ([#77](https://codeberg.org/a-j-wood/pv/issues/77)) * *cleanup:* compilation warnings fixed on non-IPC and MacOS systems ### 1.8.0 - 24 September 2023 #### Features * *feature:* new **--discard** option to discard input as if writing to */dev/null* ([#42](https://codeberg.org/a-j-wood/pv/issues/42)) * *feature:* new **--error-skip-block** option to make **--skip-errors** skip whole blocks ([#37](https://codeberg.org/a-j-wood/pv/issues/37)) * *feature:* use `posix_fadvise()` like `cat`(1) does, to improve efficiency ([#39](https://codeberg.org/a-j-wood/pv/issues/39)) * *feature:* new **--enable-static** option to "`configure`" for static builds ([#75](https://codeberg.org/a-j-wood/pv/pull/75)) #### Security * *security:* with **--pidfile**, write to a temporary file and rename it into place, to improve security * *security:* keep self-contained copies of name and format string in PV internal state for memory safety * *security:* ignore *TMP* / *TMPDIR* environment variables when using a terminal lock file #### Fixes * *fix:* only report errors about missing files when starting to transfer from them, not while calculating size, and behave more like `cat`(1) by skipping them and moving on * *fix:* auto-calculate total line count with **--line-mode** when all inputs are regular files * *fix:* use `clock_gettime()` in ETA calculation to cope with machine suspend/resume ([#13](https://codeberg.org/a-j-wood/pv/issues/13)) * *fix:* if **--width** or **--height** were provided, do not change them when the window size changes ([#36](https://codeberg.org/a-j-wood/pv/issues/36)) * *fix:* when a file descriptor position in **--watchfd** moves backwards, show the rate using the correct prefix ([#41](https://codeberg.org/a-j-wood/pv/issues/41)) * *fix:* rewrite terminal state save/restore so state is not intermittently garbled on exit when using **--cursor** ([#20](https://codeberg.org/a-j-wood/pv/issues/20)), ([#24](https://codeberg.org/a-j-wood/pv/issues/24)) #### Cleanups * *cleanup:* addressed many potential issues highlighted by the software auditing tools "`splint`" and "`flawfinder`" (see new target "`make analyse`") * *cleanup:* switched the build system to GNU Automake * *cleanup:* replaced the test harness with the one native to GNU Automake * *cleanup:* added a test for terminal width detection to "`make check`" * *cleanup:* added a test to "`make check`" to ensure that "`make install`" installs everything expected * *cleanup:* replaced *AC_HEADER_TIOCGWINSZ* with *AC_CHECK_HEADERS(sys/ioctl.h)* for better MacOS compatibility ([#74](https://codeberg.org/a-j-wood/pv/issues/74)) * *cleanup:* with **--sync**, call `fsync()` instead of `fdatasync()` on incapable systems ([#73](https://codeberg.org/a-j-wood/pv/issues/73)) * *cleanup:* the manual is now a static file instead of needing to be built with "`configure`" #### Dropped items * *dropped:* dropped support for **--enable-static-nls** * *dropped:* removed the Linux Software Map file, as the LSM project appears to be long dead * *dropped:* will no longer publish to SourceForge as it has a chequered history and is unnecessary * *dropped:* removed project from GitHub and moved to Codeberg - see "[Give Up GitHub](https://giveupgithub.org/)" #### Other items * licensing change from Artistic 2.0 to GPLv3+ ### 1.7.24 - 30 July 2023 * *fix:* correct terminal size detection, broken in 1.7.17 by the configuration script rewrite ([#72](https://codeberg.org/a-j-wood/pv/issues/72)) * *security:* removed *DEBUG* environment variable in debug mode, added **--debug** instead * *cleanup:* added "`make analyse`" to run "`splint`" and "`flawfinder`" on all source files * *cleanup:* corrected detection of boolean capability * *cleanup:* word wrapping of **--help** output is now multi-byte locale aware * *cleanup:* adjusted "`indent`" rules to line length of 120 and reformatted code ### 1.7.18 - 28 July 2023 * *fix:* language file installation had been broken by the configuration script rewrite ### 1.7.17 - 27 July 2023 * *feature:* new **--sync** option to flush cache to disk after every write (related to [#6](https://codeberg.org/a-j-wood/pv/issues/6), to improve accuracy when writing to slow disks) * *feature:* new **--direct-io** option to bypass cache - implements [#29 "Option to enable O_DIRECT"](https://codeberg.org/a-j-wood/pv/issues/29) - requested by Romain Kang, Jacek Wielemborek * *fix:* correct byte prefix size to 2 spaces in rate display, so progress display size remains constant at low transfer rates * *cleanup:* rewrote `configure.in` as per suggestions in newer "`autoconf`" manuals * *cleanup:* replaced `header.in` with one generated by "`autoheader`", moving custom logic to a separate header file "`config-aux.h`" * *cleanup:* added copyright notice to all source files as per GNU standards * *cleanup:* changed **--version** output to conform to GNU standards * *cleanup:* replaced backticks with `$()` in all shell scripts that did not come from elsewhere, as backticks are deprecated and harder to read * *cleanup:* improved the output formatting of "`make test`" * *cleanup:* extended the "`make test`" mechanism to allow certain tests to be skipped on platforms that cannot support them * *cleanup:* skip the "pipe" test (for *SIGPIPE*) if GNU "`head`" is not available, so that "`make test`" on stock OpenBSD 7.3 works * *cleanup:* added a lot more tests to "`make test`" * *cleanup:* replace all calls to `sprintf()` and `snprintf()` with a new wrapper function `pv_snprintf()` to improve security and compatibility * *cleanup:* replace all calls to `strcat()` with a wrapper `pv_strlcat()` to improve security and compatibility * *cleanup:* replace all `write()` calls to the terminal with a wrapper `pv_write_retry()` for consistency * *cleanup:* tidy up and fix compilation warning in **--watchfd** code * *cleanup:* rewrote all local shell scripts to pass analysis by [ShellCheck](https://www.shellcheck.net) ### 1.7.0 - 17 July 2023 * *dropped:* support for Red Hat Enterprise Linux and its derivatives has been dropped; removed the RPM spec file, and will no longer build binaries * *feature:* the **--size** option now accepts "`@filename`" to use the size of another file (pull request [#57](https://codeberg.org/a-j-wood/pv/pull/57) supplied by [Dave Beckett](https://github.com/dajobe)) * *feature:* the **--watchfd** option is now available on OS X (pull request [#60](https://codeberg.org/a-j-wood/pv/pull/60) supplied by [christoph-zededa](https://github.com/christoph-zededa)) * *feature:* new **--bits** option to show bit count instead of byte count (adapted from pull request [#63](https://codeberg.org/a-j-wood/pv/pull/63) supplied by [Nick Black](https://nick-black.com)) * *feature:* new **--average-rate-window** option, to set the window over which the average rate is calculated, also used for ETA (modified from pull request [#65](https://codeberg.org/a-j-wood/pv/pull/65) supplied by [lemonsqueeze](https://github.com/lemonsqueeze)) * *feature:* the **--watchfd** option will now show relative filenames, if they are under the current directory (pull request [#66](https://codeberg.org/a-j-wood/pv/pull/66) supplied by [ikasty](https://github.com/ikasty)) * *fix:* correction to `pv_in_foreground()` to behave as its comment block says it should, when not on a terminal - corrects [#19 "No output in Arch Linux initcpio after 1.6.6"](https://codeberg.org/a-j-wood/pv/issues/19), [#31 "No output written from inside zsh <() construct"](https://codeberg.org/a-j-wood/pv/issues/31), [#55 "pv Stopped Working in the Background"](https://codeberg.org/a-j-wood/pv/issues/55) (pull request [#64](https://codeberg.org/a-j-wood/pv/pull/64) supplied by [Michael Weiß](https://github.com/quitschbo)) * *fix:* workaround for OS X 11 behaviour in configure script regarding stat64 at compile time (pull request [#57](https://codeberg.org/a-j-wood/pv/pull/57) supplied by [Dave Beckett](https://github.com/dajobe)) * *fix:* workaround for macOS equivalence of stat to stat64 - patches from [Filippo Valsorda](https://github.com/FiloSottile) and [Demitri Muna](https://github.com/demitri), correcting [#33 "Fix compilation problems due to `stat64()` on Apple Silicon"](https://codeberg.org/a-j-wood/pv/issues/33) * *fix:* add burst rate limit to transfer, so rate limits are not broken by bursty traffic (pull request [#62](https://codeberg.org/a-j-wood/pv/pull/62) supplied by [Volodymyr Bychkovyak](https://github.com/vbychkoviak)) * *fix:* corrected **--force** option so it will still output progress when not in the same process group as the owner of the terminal - corrects [#23 "No output with "-f" when run in background after 1.6.6"](https://codeberg.org/a-j-wood/pv/issues/23) and helps to correct [#31 "No output written from inside zsh <() construct"](https://codeberg.org/a-j-wood/pv/issues/31) * *fix:* corrected elapsed time display to show as D:HH:MM:SS after 1 day, like the ETA does - corrects [#16 "Show days in same format in ETA as in elapsed time"](https://codeberg.org/a-j-wood/pv/issues/16) * *fix:* corrected bug where percentages went down after 100% when in **--numeric** mode with a **--size** that was too small - corrects [#26 "Correct "-n" behaviour when going past 100% of "-s" size"](https://codeberg.org/a-j-wood/pv/issues/26) * *i18n:* recoded Polish translation file to UTF-8 * *i18n:* removed inaccurate fuzzy translation matches * *docs:* moved all open issues into GitHub and updated the TODO list * *docs:* renamed README to README.md and altered it to Markdown format * *docs:* moved contributors from the README to docs/ACKNOWLEDGEMENTS.md * *docs:* moved TODO to TODO.md and altered it to Markdown format * *docs:* moved NEWS to NEWS.md, converted it to UTF-8, and altered it to Markdown format ### 1.6.20 - 12 September 2021 * *fix:* add missing `stddef.h` include to `number.c` (Sam James) ### 1.6.19 - 5 September 2021 * *fix:* starting pv in the background no longer immediately stops unless the transfer is to/from the terminal (Andriy Gapon, Jonathan Elchison) * *fix:* using **-B**, **-A**, or **-T** now switches on **-C** implicitly (Johannes Gerer, André Stapf) * *fix:* AIX build fixes (Peter Korsgaard) * *i18n:* updated German **--help** translations (Richard Fonfara) * *i18n:* switched to UTF-8 encoding, added missing translations (de,fr,pt) * *docs:* new "common switches" manual section (Jacek Wielemborek) * *docs:* use placeholder instead of `/dev/sda` in the manual (Pranav Peshwe) * *docs:* mention MacOS pipes and **-B 1024** in the manual (Jan Venekamp) * *docs:* correct shell in `autoconf/scripts/index.sh` (Juan Picca) * *cleanup:* various compiler warnings cleaned up Full changelog is below: * (r181) added common switches section to manual (Jacek Wielemborek) * (r184) use placeholder instead of /dev/sda in the manual (Pranav Peshwe) * (r185) replace ash with sh in autoconf/scripts/index.sh (Juan Picca) * (r185) added note to manual about **-B 1024** in MacOS pipes (Jan Venekamp) * (r185) fix AIX config check when the CWD contains "yes" (Peter Korsgaard) * (r189) (#1556) updated German **--help** translations (Richard Fonfara) * (r189) updated missing German translations and changed to UTF-8 encoding * (r191) updated missing French translations and changed to UTF-8 encoding * (r193) updated missing Portuguese translations, changed to UTF-8 encoding * (r196) (#1563) using **-B**, **-A**, or **-T** now switches on **-C** implicitly (Johannes Gerer, André Stapf) * (r199) fixed numerous compiler warnings in newer GCC versions * (r200,205) fixed bug where "`pv /dev/zero >/dev/null &`" stopped immediately (Jonathan Elchison, Andriy Gapon) * (r203,205) marked unused arguments with GCC unused attribute, started using boolean data type for flags, corrected more compiler warnings ### 1.6.6 - 30 June 2017 * (r161) use `%llu` instead of `%Lu` for better compatibility (Eric A. Borisch) * (r162) (#1532) fix target buffer size (**-B**) being ignored (AndCycle, Ilya Basin, Antoine Beaupré) * (r164) cap read/write sizes, and check elapsed time during read/write cycles, to avoid display hangs with large buffers or slow media; also remove `select()` call from repeated_write function as it slows the transfer down and the wrapping `alarm()` means it is unnecessary * (r169) (#1477) use alternate form for transfer counter, such that 13GB is shown as 13.0GB so it's the same width as 13.1GB (André Stapf) * (r171) cleanup: units corrections in man page, of the form kb -> KiB * (r175) report error in **-d** if process fd directory is unreadable, or if process disappears before we start the main loop (Jacek Wielemborek) ### 1.6.0 - 15 March 2015 * fix lstat64 support when unavailable - separate patches supplied by Ganael Laplanche and Peter Korsgaard * (#1506) new option **-D** / **--delay-start** to only show bar after N seconds (Damon Harper) * new option **--fineta** / **-I** to show ETA as time of day rather than time remaining - patch supplied by Erkki Seppälä (r147) * (#1509) change ETA (**--eta** / **-e**) so that days are given if the hours remaining are 24 or more (Jacek Wielemborek) * (#1499) repeat read and write attempts on partial buffer fill/empty to work around post-signal transfer rate drop reported by Ralf Ramsauer * (#1507) do not try to calculate total size in line mode, due to bug reported by Jacek Wielemborek and Michiel Van Herwegen * cleanup: removed defunct RATS comments and unnecessary copyright notices * clean up displayed lines when using **--watchfd PID**, when PID exits * output errors on a new line to avoid overwriting transfer bar ### 1.5.7 - 26 August 2014 * show KiB instead of incorrect kiB (Debian bug #706175) * (#1284) do not gzip man page, for non-Linux OSes (Bob Friesenhahn) * work around "awk" bug in `tests/016-numeric-timer` in decimal "," locales * fix "`make rpm`" and "`make srpm`", extend "`make release`" to sign releases ### 1.5.3 - 4 May 2014 * remove *SPLICE_F_NONBLOCK* to fix problem with slow `splice()` (Jan Seda) ### 1.5.2 - 10 February 2014 * allow **--watchfd** to look at block devices * let **--watchfd PID:FD** work with **--size N** * moved contributors out of the manual as the list was too long (NB everyone is still listed in the README and always will be) ### 1.5.1 - 23 January 2014 * new option **--watchfd** - suggested by Jacek Wielemborek and "fdwatch" * use non-block flag with `splice()` * new display option **--buffer-percent**, suggested by Kim Krecht * new display option **--last-written**, suggested by Kim Krecht * new transfer option **--no-splice** * fix for minor bug which dropped display elements after one empty one * fix for single fd leak on exit (Cristian Ciupitu) ### 1.4.12 - 5 August 2013 * new option **--null** - patch supplied by Zing Shishak * AIX build fix (add "`-lc128`") - with help from Pawel Piatek * AIX **-c** fixes - with help from Pawel Piatek * SCO build fix (`po2table.sh`) - reported by Wouter Pronk * test scripts fix for older distributions - patch from Bryan Dongray * fix for `splice()` not using stdin - patch from Zev Weiss ### 1.4.6 - 22 January 2013 * added patch from Pawel Piatek to omit *O_NOFOLLOW* in AIX ### 1.4.5 - 10 January 2013 * updated manual page to show known problem with **-R** on Cygwin ### 1.4.4 - 11 December 2012 * added debugging, see "`pv -h`" when `configure` is run with **--enable-debugging** * rewrote cursor positioning code used when IPC is unavailable (Cygwin) * fixed cursor positioning cursor read answerback problem (Cygwin/Solaris) * fixed bug causing crash when progress displayed with too-small terminal ### 1.4.0 - 6 December 2012 * new option **--skip-errors** commissioned by Jim Salter * if stdout is a block device, and we don't know the total size, use the size of that block device as the total (Peter Samuelson) * new option **--stop-at-size** to stop after **--size** bytes * report correct filename on read errors * fix use-after-free bug in remote PID cleanup code * refactored large chunks of code to make it more readable and to replace most static variables with a state structure ### 1.3.9 - 5 November 2012 * allow **--format** parameters to be sent with **--remote** * configure option **--disable-ipc** * added tests for **--numeric** with **--timer** and **--bytes** * added tests for **--remote** ### 1.3.8 - 29 October 2012 * new **--pidfile** option to save process ID to a file * integrated patch for **--numeric** with **--timer** and **--bytes** (Sami Liedes) * removed signalling from **--remote** to prevent accidental process kills * new **--format** option (originally Vladimir Pal / Vladimir Ermakov) ### 1.3.4 - 27 June 2012 * new **--disable-splice** configure script option * fixed line mode size count with multiple files (Moritz Barsnick) * fixes for AIX core dumps (Pawel Piatek) ### 1.3.1 - 9 June 2012 * do not use `splice()` if the write buffer is not empty (Thomas Rachel) * added test 15 (pipe transfers), and new test script ### 1.3.0 - 5 June 2012 * added Tiger build patch from Olle Jonsson * fix 1024-boundary display garble (Debian bug #586763) * use `splice`(2) where available (Debian bug #601683) * added known bugs section of the manual page * fixed average rate test, 12 (Andrew Macheret) * use IEEE1541 units (Thomas Rachel) * bug with rate limit under 10 fixed (Henry Precheur) * speed up PV line mode (patch: Guillaume Marcais) * remove `LD=ld` from `vars.mk` to fix cross-compilation (paintitgray/PV#1291) ### 1.2.0 - 14 December 2010 * integrated improved SI prefixes and **--average-rate** (Henry Gebhardt) * return nonzero if exiting due to *SIGTERM* (Martin Baum) * patch from Phil Rutschman to restore terminal properly on exit * fix i18n especially for **--help** (Sebastian Kayser) * refactored `pv_display` * we now have a coherent, documented, exit status * modified pipe test and new cksum test from Sebastian Kayser * default *CFLAGS* to just "`-O`" for non-GCC (Kjetil Torgrim Homme) * LFS compile fix for OS X 10.4 (Alexandre de Verteuil) * remove *DESTDIR* `/` suffix (Sam Nelson, Daniel Pape) * fixed potential NULL deref in transfer (Elias Pipping / LLVM/Clang) ### 1.1.4 - 6 March 2008 * patch from Elias Pipping correcting compilation failure on Darwin 9 * patch from Patrick Collison correcting similar problems on OS X * trap *SIGINT* / *SIGHUP* / *SIGTERM* so we clean up IPCs on exit (Laszlo Ersek) * abort if numeric option, eg **-L**, has non-numeric value (Boris Lohner) ### 1.1.0 - 30 August 2007 * new option **--remote** (**-R**) to control an already-running process * new option **--line-mode** (**-l**) to count lines instead of bytes * fix for **-L** to be less resource intensive * fix for input/output equivalence check on Mac OS X * fix for size calculation in pipelines on Mac OS X * fixed "`make uninstall`" * removed "`/debian`" directory at request of new Debian maintainer ### 1.0.1 - 4 August 2007 * licensing change from Artistic to Artistic 2.0 * removed the **-l** / **--license** option ### 1.0.0 - 2 August 2007 * act more like "`cat`" - just skip unreadable files, don't abort * removed text version of manual page, and obsolete Info file generation * code cleanup and separation of PV internals from CLI front-end ### 0.9.9 - 5 February 2007 * new option **--buffer-size** (**-B**) suggested by Mark Tomich * build fix: HP/UX largefile compile fix from Timo Savinen * maintain better buffer filling during transfers * workaround: "`pv /dev/zero | dd bs=1M count=1k`" bug (reported by Gert Menke) * dropped support for the Texinfo manual ### 0.9.6 - 27 February 2006 * bugfix: `key_t` incompatibility with Cygwin * bugfix: interval (**-i**) parameter parses numbers after decimal point * build fix: use static NLS if `msgfmt` is unavailable * on the final update, blank out the now-zero ETA ### 0.9.2 - 1 September 2005 * Daniel Roethlisberger patch: use lockfiles if terminal locking fails ### 0.9.1 - 16 June 2005 * minor RPM spec file fix for Fedora Core 4 ### 0.9.0 - 15 November 2004 * minor NLS bugfix ### 0.8.9 - 6 November 2004 * decimal values now accepted for rate and size, eg **-L 1.23M** * code cleanup * developers: "`make help`" now lists Makefile targets ### 0.8.6 - 29 June 2004 * use `uu_lock()` for terminal locking on FreeBSD ### 0.8.5 - 2 May 2004 * cursor positioning (**-c**) reliability improved on systems with IPC * minor fix: made test 005 more reliable * new option **--height** (**-H**) ### 0.8.2 - 24 April 2004 * allow k,m,g,t suffixes on numbers * added "`srpm`" and "`release`" Makefile targets ### 0.8.1 - 19 April 2004 * bugfix in cursor positioning (**-c**) ### 0.8.0 - 12 February 2004 * replaced GNU getopt with my library code * replaced GNU gettext with my very minimal replacement * use *DESTDIR* instead of *RPM_BUILD_ROOT* for optional installation prefix * looked for flaws using RATS, cleaned up code ### 0.7.0 - 8 February 2004 * display buffer management fixes (thanks Cédric Delfosse) * replaced **--enable-debug** with **--enable-debugging** and **--enable-profiling** ### 0.6.4 - 14 January 2004 * fixed minor bug in RPM installation * bugfix in "`make index`" (only of interest to developers) ### 0.6.3 - 22 December 2003 * fixed transient bug that reported "resource unavailable" occasionally ### 0.6.2 - 6 August 2003 * block devices now have their size read correctly, so "`pv /dev/hda1`" works * minor code cleanups (mainly removal of CVS "Id" tags) ### 0.6.0 - 3 August 2003 * doing *^Z* then "`bg`" then "`fg`" now continues displaying ### 0.5.9 - 23 July 2003 * fix for test 007 when not in C locale * fix for build process to use *CPPFLAGS* * fix for build process to use correct i18n libraries * fix for build process - more portable sed in dependency generator * fix for install process - remember to `mkinstalldirs` before installing * fixes for building on Mac OS X ### 0.5.3 - 4 May 2003 * added Polish translation thanks to Bartosz FeÅ„ski and Krystian Zubel * moved `doc/debian` to `./debian` at insistence of common sense * minor Solaris 8 compatibility fixes * seems to compile and test OK on Mac OS X ### 0.5.0 - 15 April 2003 * added French translation thanks to Stéphane Lacasse * added German translation thanks to Marcos Kreinacke * switched LGPL reference from "Library" to "Lesser" ### 0.4.9 - 18 February 2003 * support for >2GB files added where available (Debian bug #180986) * added `doc/debian` dir (from Cédric Delfosse) * added "`make rpm`" and "`make deb`" targets to build RPM and Debian packages * added a "`make pv-static`" rule to build a statically linked version ### 0.4.5 - 13 December 2002 * added Portuguese (Brazilian) translation thanks to Eduardo Aguiar ### 0.4.4 - 7 December 2002 * pause/resume support - don't count time while stopped * stop output when resumed in the background * terminal size change support * bugfix: "`<=>`" indicator no longer sticks at right hand edge ### 0.4.0 - 27 November 2002 * allow decimal interval values, eg 0.1, 0.5, etc * some simple tests added ("`make check`") * smoother throughput limiting (**--rate-limit**), now done in 0.1sec chunks * bounds-check interval values (**-i**) - max update interval now 10 minutes * more reliable non-blocking output to keep display updated * no longer rely on `atoll()` * don't output final blank line if **--numeric** * use `fcntl()` instead of `flock()` for Solaris compatibility ### 0.3.0 - 25 November 2002 * handle broken output pipe gracefully * continue updating display even when output pipe is blocking ### 0.2.6 - 21 October 2002 * we now ignore *EINTR* on `select()` * variable-size buffer (still need to add code to change size) * added (tentative) support for internationalisation * removed superfluous **--no-progress**, etc options * optimised transfer by using bigger buffers, based on `st_blksize` * added **--wait** option to wait until transfer begins before showing progress * added **--rate-limit** option to limit rate to a maximum throughput * added **--quiet** option (no output at all) to be used with **--rate-limit** ### 0.2.5 - 23 July 2002 * added *[FILE]...* arguments, like "`cat`" * function separation in code * some bug fixes related to numeric overflow ### 0.2.3 - 19 July 2002 * Texinfo manual written, man page updated * byte counter added ### 0.2.0 - 18 July 2002 * ETA counter added * screen width estimation added * progress bar added ### 0.1.0 - 17 July 2002 * main loop created * rate counter added * elapsed time counter added * percentage calculation added ### 0.0.1 - 16 July 2002 * package created * first draft of man page written pv-1.9.31/docs/benchmark.sh000077500000000000000000000020521474702661500154660ustar00rootroot00000000000000#!/bin/bash # # Benchmark the read/write performance of pv by looking at the number of # read() and write() calls and the average amount of data transferred each # time, as suggested by Ville Herva . # test_input=$(mktemp /tmp/pvbench1XXXXXX) strace_output=$(mktemp /tmp/pvbench2XXXXXX) trap 'rm -f ${test_input} ${strace_output}' EXIT pv=${pv:-./pv} test -x "${pv}" || pv="pv" dd if=/dev/zero of="${test_input}" bs=1k count=1k >/dev/null 2>&1 echo -e "Buf(k)\tRate(k)\tReads\tRsize\tWrites\tWsize" for ((buffer=100; buffer<=1000; buffer+=100)); do for ((rate=100; rate<=1000; rate+=100)); do rateparm="-L ${rate}k" test ${rate} -eq 0 && rateparm="" strace -tt -o "${strace_output}" \ "${pv}" "${rateparm}" -B "${buffer}k" \ -f < "${test_input}" > /dev/null 2>&1 rdata=$( awk '$2~/^read\(0,/{c++;t+=$NF}END{print c "\t" t/c}' \ "${strace_output}" ) wdata=$( awk '$2~/^write\(1,/{c++;t+=$NF}END{print c "\t" t/c}' \ "${strace_output}" ) echo -e "${buffer}\t${rate}\t${rdata}\t${wdata}" done done pv-1.9.31/docs/build-package.sh000077500000000000000000000105331474702661500162270ustar00rootroot00000000000000#!/bin/sh # # Usage: sh build-package.sh source-1.2.3.tar.gz # # Given a tar.gz, build a package for the current OS. # # Supports these packaging types: # # .deb (Debian, Ubuntu, etc) - requires dpkg-dev, debhelper # .rpm (AlmaLinux, Rocky Linux, OpenSUSE etc) - requires rpmbuild # # If the MAINTAINER environment variable is set, this is used as a GPG key # ID for package signing. # # The packages built with this script are not "official", in that they are # not part of any Linux distribution and may not follow the distribution's # policies. Use at your own risk. # # Copyright 2024-2025 Andrew Wood # License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. sourceArchive="$1" test -n "${sourceArchive}" && test -f "${sourceArchive}" \ || { printf "%s: %s: %s\n" "${0##*/}" "${sourceArchive}" "source archive not found" 1>&2; exit 1; } packageName="pv" packageSummary="Shell pipeline element to meter data passing through" packageDescription="\ pv (Pipe Viewer) can be inserted into any normal pipeline between two processes to give a visual indication of how quickly data is passing through, how long it has taken, how near to completion it is, and an estimate of how long it will be until completion." packageUrl="https://www.ivarch.com/programs/pv.shtml" sourceUrl="https://www.ivarch.com/programs/sources/${packageName}-%{version}.tar.gz" packageEmail="Andrew Wood " workDir="$(mktemp -d)" || exit 1 trap 'rm -rf "${workDir}"' EXIT # Infer the version from the most recent NEWS entry. version="$(tar xzf "${sourceArchive}" --wildcards -O '*/docs/NEWS.md' 2>/dev/null | awk '/^### [0-9]/{print $2}' | sed -n 1p)" if command -v rpmbuild >/dev/null 2>&1; then # Build an RPM. cat > "${workDir}"/spec </dev/null 2>&1; then # Build a Debian package. mkdir "${workDir}/build" "${workDir}/build/debian" "${workDir}/build/debian/source" tar xzf "${sourceArchive}" -C "${workDir}/build" --strip-components=1 printf "%s\n" "10" > "${workDir}/build/debian/compat" touch "${workDir}/build/debian/copyright" printf "%s\n" "3.0 (quilt)" > "${workDir}/build/debian/source/format" cat > "${workDir}/build/debian/rules" < "${workDir}/build/debian/control" <= 9) Package: ${packageName} Architecture: any Depends: \${misc:Depends} Description: ${packageSummary} $(printf "%s\n.\n" "${packageDescription}" | sed 's,^, ,') EOF cat > "${workDir}/build/debian/changelog" < out.tar.gz .EE .in .PP Taking an image of a disk, skipping errors: .PP .in +4 .EX pv \-EE /dev/your/disk/device > disk-image.img .EE .in .PP Writing an image back to a disk: .PP .in +4 .EX pv disk-image.img > /dev/your/disk/device .EE .in .PP Zeroing a disk: .PP .in +4 .EX pv < /dev/zero > /dev/your/disk/device .EE .in .PP Note that if the input size cannot be calculated, and the output is a block device, then the size of the block device will be used and \fBpv\fR will automatically stop at that size as if \*(lq\fB\-\-stop\-at\-size\fR\*(rq had been given. .PP (Linux and macOS only): Watching file descriptor 3 opened by another process 1234: .PP .in +4 .EX pv \-\-watchfd 1234:3 .EE .in .PP (Linux and macOS only): Watching all file descriptors used by process 1234: .PP .in +4 .EX pv \-\-watchfd 1234 .EE .in .PP Rate-limiting the transfer between two processes in a pipeline, with no display: .PP .in +4 .EX producer | pv \-\-quiet \-\-rate\-limit 1M | consumer .EE .in .PP Sending logs to a processing script, showing the most recent line as part of the progress display: .PP .in +4 .EX pv \-\-format '%a %p : %L' big.log | processing-script .EE .in .PP Showing progress as lines of JSON data: .PP .in +4 .EX pv \-\-numeric \-\-format '{"elapsed":%t,"bytes":%b,"rate":%r,"percentage":%{progress-amount-only}}' big.log | processing-script .EE .in .\" .SH EXIT STATUS An exit status of 1 indicates a problem with the \*(lq\fB\-\-remote\fR\*(rq or \*(lq\fB\-\-pidfile\fR\*(rq options. .PP Any other exit status is a bitmask of the following: .TP 5 \~\fB2\fR One or more files could not be accessed, \fBstat\fR(2)ed, or opened. .TP \~\fB4\fR An input file was the same as the output file. .TP \~\fB8\fR Internal error with closing a file or moving to the next file. .TP \~\fB16\fR There was an error while transferring data from one or more input files. .TP \~\fB32\fR A signal was caught that caused an early exit. .TP \~\fB64\fR Memory allocation failed. .PP A zero exit status indicates no problems. .\" .SH ENVIRONMENT The following environment variables may affect \fBpv\fR: .TP .B HOME The current user's home directory. This may be used by \*(lq\fB\-\-remote\fR\*(rq to exchange messages between \fBpv\fR instances: if the \fI/run/user/UID/\fR directory does not exist (where \fIUID\fR is the current user ID), then \fI$HOME/.pv/\fR will be used instead. .TP .BR TMPDIR ", " TMP The directory to create per-tty lock files for the terminal when using \*(lq\fB\-\-cursor\fR\*(rq. If \fBTMPDIR\fR is set to a non-empty value, it is the directory under which lock files are created. Otherwise, \fBTMP\fR is used. If neither are set, then \fI/tmp\fR is used. .\" .SH NOTES In some versions of \fBbash\fR(1) and \fBzsh\fR(1), the construct \*(lq\fB<(pv\~filename)\fR\*(rq will not output any progress to the terminal when run from an interactive shell, due to the subprocess being run in a separate process group from the one that owns the terminal. In these cases, use \*(lq\fB\-\-force\fR\*(rq. .PP If \fBpv\fR is used in a pipeline in \fBzsh\fR version 5.8, and the last command in the pipeline is based on shell builtins, \fBzsh\fR takes control of the terminal away from \fBpv\fR, preventing progress from being displayed. For example, this will produce no progress bar: .PP .in +4n .EX pv InputFile | { while read \-r line; do sleep 0.1; done; } .EE .in .PP To work around this, put the last commands of the pipeline in normal brackets to force the use of a subshell: .PP .in +4n .EX pv InputFile | ( while read \-r line; do sleep 0.1; done; ) .EE .in .PP Refer to .UR https://codeberg.org/a-j-wood/pv/issues/105 issue #105 .UE for full details. .PP The \*(lq\fB\-\-remote\fR\*(rq option requires that either \fI/run/user//\fR or \fI$HOME/\fR can be written to, for inter-process communication. .PP The \*(lq\fB\-\-size\fR\*(rq option has no effect if used with \*(lq\fB\-\-watchfd\fR\~\fIPID\fR\*(rq to watch all file descriptors of a process, but will work with \*(lq\fB\-\-watchfd\fR\~\fIPID\fR:\fIFD\fR\*(rq to watch a single file descriptor. .PP If the input size cannot be calculated, and the output is a block device, then \fBpv\fR will read the output device's size, use that as if it had been passed to \*(lq\fB\-\-size\fR\*(rq, and activate \*(lq\fB\-\-stop\-at\-size\fR\*(rq. .PP The \*(lq\fB%nA\fR\*(rq and \*(lq\fB%nL\fR\*(rq format sequences may not be effective with small input files, and \*(lq\fB%nL\fR\*(rq may be a few lines out due to buffering within the pipeline itself. .PP Numbers passed to \*(lq\fB\-\-size\fR\*(rq, \*(lq\fB\-\-rate\-limit\fR\*(rq, \*(lq\fB\-\-buffer\-size\fR\*(rq, and \*(lq\fB\-\-error\-skip\-block\fR\*(rq may all be expressed as decimals if followed by a suffix, so for example \*(lq\fI\-\-size\~1.5G\fR\*(rq is equivalent to \*(lq\fI\-\-size\~1536M\fR\*(rq. .PP Numbers passed to \*(lq\fB\-\-interval\fR\*(rq and \*(lq\fB\-\-delay\-start\fR\*(rq may be integers or decimals, but may not have a suffix. .PP Numbers passed to \*(lq\fB\-\-last\-written\fR\*(rq, \*(lq\fB\-\-width\fR\*(rq, \*(lq\fB\-\-height\fR\*(rq, \*(lq\fB\-\-average\-rate\-window\fR\*(rq, and \*(lq\fB\-\-remote\fR\*(rq must be integers with no suffix. .\" .SH REPORTING BUGS Please report any bugs to \fBpv@ivarch.com\fR. .PP Alternatively, use the issue tracker linked from the .UR https://www.ivarch.com/programs/pv.shtml \fBpv\fR home page .UE . .\" .SH "SEE ALSO" .BR cat (1), .BR splice (2), .BR fdatasync (2), .BR open (2) (for \fBO_DIRECT\fR), .BR console_codes (4) .\" .SH COPYRIGHT Copyright \(co 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2025 Andrew Wood. .PP License GPLv3+: .UR https://www.gnu.org/licenses/gpl-3.0.html GNU GPL version 3 or later .UE . .PP This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .PP Please see the package's ACKNOWLEDGEMENTS file for a complete list of contributors. pv-1.9.31/docs/pv.1.md000066400000000000000000000664701474702661500143210ustar00rootroot00000000000000# NAME pv - monitor the progress of data through a pipe # SYNOPSIS **pv** \[*OPTION*\]\... \[*FILE*\]\... **pv** **-d**\|**\--watchfd** *PID*\[:*FD*\] \[*OPTION*\]\... **pv** **-R**\|**\--remote** *PID* \[*OPTION*\]\... # DESCRIPTION Show the progress of data through a pipeline by giving information such as time elapsed, percentage completed (with progress bar), current throughput rate, total data transferred, and ETA. Each *FILE* is copied to standard output. With no *FILE*, or when *FILE* is "-", standard input is read. This is the same behaviour as **cat**(1). # OPTIONS ## Display switches If no display switches are specified, **pv** behaves as if "**\--progress**", "**\--timer**", "**\--eta**", "**\--rate**", and "**\--bytes**" had been given. Otherwise, only those display types that are explicitly switched on will be shown. **-p, \--progress** : Turn the progress bar on. If any inputs are not files, or are unreadable, and no size was explicitly given with "**\--size**", the progress bar cannot indicate how close to completion the transfer is, so it will just move left and right to indicate that data is moving - or, with "**\--gauge**", the bar will indicate the current rate as a percentage of the maximum rate seen so far. **-t, \--timer** : Turn the timer on. This will display the total elapsed time that **pv** has been running for. **-e, \--eta** : Turn the ETA countdown on. This will estimate, based on current transfer rates and the total data size, how long it will be before completion. The countdown is prefixed with "ETA". This option will have no effect if the total data size cannot be determined. **-I, \--fineta** : Turn the ETA countdown on, but display the estimated local time at which the transfer will finish, instead of the amount of time remaining. When the estimated time is more than 6 hours in the future, the date is shown as well. The time is prefixed with "FIN" for finish time. As with "**\--eta**", this option will have no effect if the total data size cannot be determined. **-r, \--rate** : Turn the rate counter on. This will display the current rate of data transfer. The rate is shown in square brackets "\[\]". **-a, \--average-rate** : Turn the average rate counter on. This will display the current average rate of data transfer, over the last 30 seconds by default (see "**\--average-rate-window**"). The average rate is shown in brackets "()". **-b, \--bytes** : Turn the total byte counter on. This will display the total amount of data transferred so far. **-T, \--buffer-percent** : Turn on the transfer buffer percentage display. This will show the percentage of the transfer buffer in use. Implies "**\--no-splice**". The transfer buffer percentage is shown in curly brackets "{}". **-A NUM, \--last-written NUM** : Show the last *NUM* bytes written. Implies "**\--no-splice**". **-F FORMAT, \--format FORMAT** : Ignore all of the above options and instead use the format string *FORMAT* to determine the output format. See the **FORMATTING** section below. **-n, \--numeric** : Numeric output. Instead of giving a visual indication of progress, write an integer percentage, one per line, on standard error, suitable for passing to a tool such as **dialog**(1). Note that "**\--force**" is not required if "**\--numeric**" is being used. Combining "**\--numeric**" with "**\--bytes**" will cause the number of bytes processed so far to be output instead of a percentage. Adding "**\--line-mode**" as well as "**\--bytes**" writes the number of lines instead of bytes or a percentage. Adding "**\--rate**" adds the transfer rate to each output line (if "**\--bytes**" is also in use, the rate comes after the byte/line count). Adding "**\--timer**" prefixes each output line with the elapsed time so far, as a decimal number of seconds. Combining "**\--numeric**" with "**\--format**" allows for custom output. The default format string components for "**\--numeric**" are "**%t %b %r %{progress-amount-only}**" in that order, each item being active or inactive according to the rules above (so the default with no other options is "**%{progress-amount-only}**". **-q, \--quiet** : No output. Useful if the "**\--rate-limit**" option is being used on its own to limit the transfer rate of a pipe. ## Output modifiers **-8, \--bits** : Use bits instead of bytes for the byte and rate counters. The output suffix will be "b" instead of "B". **-k, \--si** : Display and interpret suffixes as multiples of 1000 rather than the default of 1024. Note that this only takes effect on options after this one, so for consistency, specify this option first. **-W, \--wait** : Wait until the first byte has been transferred before showing any progress information or calculating any ETAs. Useful if the program you are piping to or from requires extra information before it starts, such as when piping data into **gpg**(1) or **mcrypt**(1) which require a passphrase before data can be processed. **-D SEC, \--delay-start SEC** : Wait until *SEC* seconds have passed before showing any progress information, for example in a script where you only want to show a progress bar if it starts taking a long time. The value of *SEC* can be a decimal such as "0.5". **-s SIZE, \--size SIZE** : Assume the total amount of data to be transferred is *SIZE* bytes when calculating percentages and ETAs. A suffix of "K", "M", "G", or "T" can be added to denote kibibytes (\*1024), mebibytes, gibibytes, tebibytes. If "**\--si**" appears before this option, suffixes will denote kilobytes (\*1000), megabytes, and so on instead. If *SIZE* starts with "**@**", the size of file whose name follows the @ will be used. **-g, \--gauge** : If the progress bar is shown but the size is not known, then instead of moving the bar left and right to show progress, show the current transfer rate as a percentage of the maximum rate seen so far. **-l, \--line-mode** : Instead of counting bytes, count lines (newline characters). The progress bar will only move when a new line is found, and the value passed to "**\--size**" will be interpreted as a line count. If this option is used without "**\--size**", the \"total size\" (in this case, total line count) is calculated by reading through all input files once before transfer starts. If any inputs are pipes or non-regular files, or are unreadable, the total size will not be calculated. **-0, \--null** : Count lines as terminated with a null byte instead of with a newline. This option implies "**\--line-mode**". **-i SEC, \--interval SEC** : Wait *SEC* seconds between updates. The default is to update every second. The value of *SEC* can be a decimal such as "0.1". **-m SEC, \--average-rate-window SEC** : Compute current average rate over a *SEC* seconds window for average rate and ETA calculations. The default is 30 seconds. The value must be an integer. **-w WIDTH, \--width WIDTH** : Assume the terminal is *WIDTH* columns wide, instead of trying to work it out (or assuming 80 if it cannot be guessed). If this option is used, the output width will not be adjusted if the width of the terminal changes while the transfer is running. **-H HEIGHT, \--height HEIGHT** : Assume the terminal is *HEIGHT* rows high, instead of trying to work it out (or assuming 25 if it cannot be guessed). If this option is used, the output height will not be adjusted if the height of the terminal changes while the transfer is running. **-N NAME, \--name NAME** : Prefix the output information with *NAME*. Useful in conjunction with "**\--cursor**" if you have a complicated pipeline and you want to be able to tell different parts of it apart. **-u STYLE, \--bar-style STYLE** : Change the default progress bar style shown by "**\--progress**", or by the "**\--format**" sequences "**%{progress}**" or "**%{progress-bar-only}**", to *STYLE*. The *STYLE* can be one of **plain** (the default), **block**, **granular**, or **shaded**. These styles are described in the **FORMATTING** section below. **-x SPEC, \--extra-display SPEC** : As well as displaying progress to the terminal, also write it to *SPEC*. The *SPEC* must start with a comma-separated list of destinations, and can optionally be followed by a colon and a format string. The destinations can be **windowtitle** or **window** for the xterm window title, and **processtitle**, **proctitle**, **process**, or **proc** for the process title displayed by **ps**(1). If a format string is not supplied, the same format is used as for the terminal. For example, "**-x \'window,process:%t %b %r\'**" will show the elapsed time, bytes transferred, and rate, in both the window title and the process title. **-v, \--stats** : At the end of the transfer, write an additional line showing the transfer rate minimum, maximum, mean, and standard deviation. The values are always in bytes per second (or bits, with "**\--bits**"). **-f, \--force** : Force output. Normally, **pv** will not output any visual display if standard error is not a terminal. This option forces it to do so. **-c, \--cursor** : Use cursor positioning escape sequences instead of just using carriage returns. This is useful in conjunction with "**\--name**" if you are using multiple **pv** invocations in a single pipeline. ## Data transfer modifiers **-o FILE, \--output FILE** : Write data to *FILE* instead of standard output. If the file already exists, it will be truncated. **-L RATE, \--rate-limit RATE** : Limit the transfer to a maximum of *RATE* bytes per second. The same suffixes as "**\--size**" can be used. **-B BYTES, \--buffer-size BYTES** : Use a transfer buffer size of *BYTES* bytes. The same suffixes as "**\--size**" can be used. The default buffer size is the block size of the input file\'s filesystem multiplied by 32 (512KiB max), or 400KiB if the block size cannot be determined. This can be useful on platforms like macOS with pipelines that perform better with specific buffer sizes such as 1024. Implies "**\--no-splice**". **-C, \--no-splice** : Never use **splice**(2), even if it would normally be possible. The **splice**(2) system call is a more efficient way of transferring data from or to a pipe than regular **read**(2) and **write**(2), but means that the transfer buffer may not be used. This prevents "**\--buffer-percent**" and "**\--last-written**" from working, cannot work with "**\--discard**", and makes "**\--buffer-size**" redundant, so using any of those options automatically switches on "**\--no-splice**". Switching on this option results in a small loss of transfer efficiency. It has no effect on systems where **splice**(2) is unavailable. **-E, \--skip-errors** : Ignore read errors by attempting to skip past the offending sections. The corresponding parts of the output will be null bytes. At first only a few bytes will be skipped, but if there are many errors in a row then the skips will move up to chunks of 512. This is intended to be similar to "*dd conv=sync,noerror*". Specify "**\--skip-errors**" twice to only report a read error once per file, instead of reporting each byte range skipped. **-Z BYTES, \--error-skip-block BYTES** : When ignoring read errors with "**\--skip-errors**", instead of trying to adaptively skip by reading small amounts and skipping progressively larger sections until a read succeeds, move to the next file block of *BYTES* bytes as soon as an error occurs. There may still be some shorter skips where the block being skipped coincides with the end of the transfer buffer. The same suffixes as "**\--size**" can be used. This option can only be used with "**\--skip-errors**" and is intended for use when reading from a block device, such as "**\--skip-errors \--error-skip-block 4K**" to skip in 4 kibibyte blocks. This will speed up reads from faulty media, at the expense of potentially losing more data. **-S, \--stop-at-size** : If a size was specified with "**\--size**", stop transferring data once that many bytes have been written, instead of continuing to the end of input. **-Y, \--sync** : After every write operation, synchronise the buffer caches to disk with **fdatasync**(2). This has no effect when the output is a pipe. Using "**\--sync**" may improve the accuracy of the progress bar when writing to a slow disk. **-K, \--direct-io** : Set the **O_DIRECT** flag on all inputs and outputs, if it is available. This will minimise the effect of caches, at the cost of performance. Due to memory alignment requirements, it also may cause read or write failures with an error of "Invalid argument", especially if reading and writing files across a variety of filesystems in a single **pv** call. Use this option with caution. **-X, \--discard** : Instead of transferring input data to standard output, discard it. This is equivalent to redirecting standard output to */dev/null*, except that **write**(2) is never called. Implies "**\--no-splice**". **-U FILE, \--store-and-forward FILE** : Instead of passing data through immediately, do it in two stages - first read all input and write it to *FILE*, and then once the input is exhausted, read all of *FILE* and write it to the output. *FILE* remains in place afterwards, unless it is "**-**", in which case **pv** creates a temporary file for this purpose, and automatically removes it afterwards. This can be useful if you have a pipeline which generates data (your input) quickly but you don\'t know the size, and you wish to pass it to some slower process, once all of the input has been generated and you know its size, so you can see its progress. Note that when doing this with relatively small amounts of data, "**\--no-splice**" may be preferable so that pipe buffering doesn\'t affect the progress display. ## Alternative operating modes **-d PID\[:FD\], \--watchfd PID\[:FD\]** : Instead of transferring data, watch file descriptor *FD* of process *PID*, and show its progress. The **pv** process will exit when *FD* either changes to a different file, changes read/write mode, or is closed; other data transfer modifiers - and remote control - may not be used with this option. If only a *PID* is specified, then that process will be watched, and all regular files and block devices it opens will be shown with a progress bar. The **pv** process will exit when process *PID* exits. **-R PID, \--remote PID** : Remotely control another instance of **pv** with process ID *PID*, making it act as though it had been given this instance\'s command line. For example, if "**pv \--rate-limit 123K**" is running with process ID 9876, then running "**pv \--remote 9876 \--rate-limit 321K**" will cause process 9876 to start using a rate limit of 321KiB instead of 123KiB. Note that some options cannot be changed while running, such as "**\--cursor**", "**\--line-mode**", "**\--force**", "**\--delay-start**", "**\--skip-errors**", and "**\--stop-at-size**". ## Other options **-P FILE, \--pidfile FILE** : Save the process ID of **pv** in *FILE*. The file will be replaced if it already exists, and will be removed when **pv** exits. While **pv** is running, *FILE* will contain a single number - the process ID of **pv** - followed by a newline. **-h, \--help** : Print a usage message on standard output and exit successfully. **-V, \--version** : Print version information on standard output and exit successfully. # FORMATTING Format strings used by "**\--format**" and "**\--extra-display**" can contain the following sequences: **%p**, **%{progress}** : Progress bar (suffixed with a percentage if the size is known). Equivalent to "**\--progress**". Expands to fill the remaining space unless prefixed by a number to set the width, such as "**%20p**" or "**%20{progress}**". **%{progress-bar-only}** : Progress bar, without any sides, and without any percentage displayed afterwards. Expands to fill the remaining space unless prefixed by a number. **%{progress-amount-only}** : The percentage completion (or maximum rate, with "**\--gauge**" when the size is unknown). **%{bar-plain}** : Progress bar in the standard plain format, without any sides, and without any percentage displayed afterwards. Expands to fill the remaining space unless prefixed by a number. **%{bar-block}** : Progress bar using Unicode full blocks, without any sides, and without any percentage displayed afterwards. Expands to fill the remaining space unless prefixed by a number. If UTF-8 output is not available, the plain format is used. **%{bar-granular}** : Progress bar using Unicode full blocks, and 1/8th blocks for partial fills, providing a more granular display. Like the other "%{bar}" strings this shows the bar without any sides, and without any percentage displayed afterwards, and expands to fill the remaining space unless prefixed by a number. If UTF-8 output is not available, the plain format is used. **%{bar-shaded}** : Progress bar using Unicode full blocks and shade characters - dark and medium shade are used for partial fills, and the light shade is used for the background. Like the other "%{bar}" strings this shows the bar without any sides, and without any percentage displayed afterwards, and expands to fill the remaining space unless prefixed by a number. If UTF-8 output is not available, the plain format is used. **%t**, **%{timer}** : Elapsed time. Equivalent to "**\--timer**". **%e**, **%{eta}** : ETA as time remaining. Equivalent to "**\--eta**". **%I**, **%{fineta}** : ETA as local time at which the transfer will finish. Equivalent to "**\--fineta**". **%r**, **%{rate}** : Current data transfer rate. Equivalent to "**\--rate**". **%a**, **%{average-rate}** : Average data transfer rate. Equivalent to "**\--average-rate**". **%b**, **%{bytes}**, **%{transferred}** : Bytes transferred so far (or lines if "**\--line-mode**" was specified). Equivalent to "**\--bytes**". If "**\--bits**" was specified, "**%b**" shows the bits transferred so far, not bytes. **%T**, **%{buffer-percent}** : Percentage of the transfer buffer in use. Equivalent to "**\--buffer-percent**". Displays "{\-\-\--}" if the transfer is being done with **splice**(2), since splicing to or from pipes does not use the buffer. **%nA**, **%n{last-written}** : Show the last *n* bytes written (for example, "**%16A**" shows the last 16 bytes). Shows only dots if the transfer is being done with **splice**(2), since splicing to or from pipes does not use the buffer. **%nL**, **%n{previous-line}** : Show the first *n* bytes of the most recently written line (for example, "**%40L**" shows the first 40 bytes). If no *n* is given, then this expands to fill the available space. Shows only spaces if the transfer is being done with **splice**(2). **%N**, **%{name}** : Show the name prefix given by "**\--name**". Padded to 9 characters with spaces, and suffixed with ":". **%{sgr:colour,\...}** : Emit ECMA-48 SGR (Select Graphic Rendition) codes if the terminal supports colours, where *colour,\...* is a comma-separated list of any of the keywords below, or the numeric values from **console_codes**(4). If colour support is not available, nothing is emitted. Supported keywords are: **reset** or **none**, **black**, **red**, **green**, **brown** or **yellow**, **blue**, **magenta**, **cyan**, **white**, **fg-black**, **fg-red**, **fg-green**, **fg-brown** or **fg-yellow**, **fg-blue**, **fg-magenta**, **fg-cyan**, **fg-white**, **fg-default**, **bg-black**, **bg-red**, **bg-green**, **bg-brown** or **bg-yellow**, **bg-blue**, **bg-magenta**, **bg-cyan**, **bg-white**, **bg-default**, **bold**, **dim**, **italic**, **underscore** or **underline**, **blink**, **reverse**, **no-bold** or **no-dim**, **no-italic**, **no-underscore** or **no-underline**, **no-blink**, **no-reverse**. With colours, the optional \"fg-\" prefix indicates foreground; a prefix of \"bg-\" indicates background. For example, "**%{sgr:green,bold}TEXT%{sgr:reset}**" will make *TEXT* bold green on supported terminals. **%%** : A single "%". Any other contents are reproduced in the progress display as-is. The format string equivalent of the default display switches is "**%b %t %r %p %e**". # EXAMPLES Some suggested common switch combinations: **pv -ptebar** : Show a progress bar, elapsed time, estimated completion time, byte counter, average rate, and current rate. **pv -betlap** : Show a progress bar, elapsed time, estimated completion time, line counter, and average rate, counting lines instead of bytes. **pv -btrpg** : Show the amount transferred, elapsed time, current rate, and a gauge showing the current rate as a percentage of the maximum rate seen - useful in a pipeline where the total size is unknown. (If the size *is* known, these options will show the percentage completion instead of the rate gauge). **pv -t** : Show only the elapsed time - useful as a simple timer, such as "**sleep 10m \| pv -t**". **pv -pterb** : The default behaviour: progress bar, elapsed time, estimated completion time, current rate, and byte counter. On macOS, it may be useful to specify "**\--buffer-size 1024**" in a pipeline, as this may improve performance. To watch how quickly a file is transferred using **nc**(1): pv file | nc -w 1 somewhere.com 3000 A similar example, transferring a file from another process and passing the expected size to **pv**: cat file | pv --size 12345 | nc -w 1 somewhere.com 3000 To watch the progress of creating a tar.gz archive: tar cf - directory/ \ | pv --size $(du -sb directory/ | awk '{print $1}') \ | gzip -9 \ > out.tar.gz Taking an image of a disk, skipping errors: pv -EE /dev/your/disk/device > disk-image.img Writing an image back to a disk: pv disk-image.img > /dev/your/disk/device Zeroing a disk: pv < /dev/zero > /dev/your/disk/device Note that if the input size cannot be calculated, and the output is a block device, then the size of the block device will be used and **pv** will automatically stop at that size as if "**\--stop-at-size**" had been given. (Linux and macOS only): Watching file descriptor 3 opened by another process 1234: pv --watchfd 1234:3 (Linux and macOS only): Watching all file descriptors used by process 1234: pv --watchfd 1234 Rate-limiting the transfer between two processes in a pipeline, with no display: producer | pv --quiet --rate-limit 1M | consumer Sending logs to a processing script, showing the most recent line as part of the progress display: pv --format '%a %p : %L' big.log | processing-script Showing progress as lines of JSON data: pv --numeric --format '{"elapsed":%t,"bytes":%b,"rate":%r,"percentage":%{progress-amount-only}}' big.log | processing-script # EXIT STATUS An exit status of 1 indicates a problem with the "**\--remote**" or "**\--pidfile**" options. Any other exit status is a bitmask of the following:  **2** : One or more files could not be accessed, **stat**(2)ed, or opened.  **4** : An input file was the same as the output file.  **8** : Internal error with closing a file or moving to the next file.  **16** : There was an error while transferring data from one or more input files.  **32** : A signal was caught that caused an early exit.  **64** : Memory allocation failed. A zero exit status indicates no problems. # ENVIRONMENT The following environment variables may affect **pv**: **HOME** : The current user\'s home directory. This may be used by "**\--remote**" to exchange messages between **pv** instances: if the */run/user/UID/* directory does not exist (where *UID* is the current user ID), then *\$HOME/.pv/* will be used instead. **TMPDIR**, **TMP** : The directory to create per-tty lock files for the terminal when using "**\--cursor**". If **TMPDIR** is set to a non-empty value, it is the directory under which lock files are created. Otherwise, **TMP** is used. If neither are set, then */tmp* is used. # NOTES In some versions of **bash**(1) and **zsh**(1), the construct "**\<(pv filename)**" will not output any progress to the terminal when run from an interactive shell, due to the subprocess being run in a separate process group from the one that owns the terminal. In these cases, use "**\--force**". If **pv** is used in a pipeline in **zsh** version 5.8, and the last command in the pipeline is based on shell builtins, **zsh** takes control of the terminal away from **pv**, preventing progress from being displayed. For example, this will produce no progress bar: pv InputFile | { while read -r line; do sleep 0.1; done; } To work around this, put the last commands of the pipeline in normal brackets to force the use of a subshell: pv InputFile | ( while read -r line; do sleep 0.1; done; ) Refer to [issue #105](https://codeberg.org/a-j-wood/pv/issues/105) for full details. The "**\--remote**" option requires that either */run/user/\/* or *\$HOME/* can be written to, for inter-process communication. The "**\--size**" option has no effect if used with "**\--watchfd** *PID*" to watch all file descriptors of a process, but will work with "**\--watchfd** *PID*:*FD*" to watch a single file descriptor. If the input size cannot be calculated, and the output is a block device, then **pv** will read the output device\'s size, use that as if it had been passed to "**\--size**", and activate "**\--stop-at-size**". The "**%nA**" and "**%nL**" format sequences may not be effective with small input files, and "**%nL**" may be a few lines out due to buffering within the pipeline itself. Numbers passed to "**\--size**", "**\--rate-limit**", "**\--buffer-size**", and "**\--error-skip-block**" may all be expressed as decimals if followed by a suffix, so for example "*\--size 1.5G*" is equivalent to "*\--size 1536M*". Numbers passed to "**\--interval**" and "**\--delay-start**" may be integers or decimals, but may not have a suffix. Numbers passed to "**\--last-written**", "**\--width**", "**\--height**", "**\--average-rate-window**", and "**\--remote**" must be integers with no suffix. # REPORTING BUGS Please report any bugs to **pv@ivarch.com**. Alternatively, use the issue tracker linked from the [**pv** home page](https://www.ivarch.com/programs/pv.shtml). # SEE ALSO **cat**(1), **splice**(2), **fdatasync**(2), **open**(2) (for **O_DIRECT**), **console_codes**(4) # COPYRIGHT Copyright © 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2025 Andrew Wood. License GPLv3+: [GNU GPL version 3 or later](https://www.gnu.org/licenses/gpl-3.0.html). This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Please see the package\'s ACKNOWLEDGEMENTS file for a complete list of contributors. pv-1.9.31/docs/release.sh000077500000000000000000000177651474702661500151750ustar00rootroot00000000000000#!/bin/sh # # Automate a portion of the release checklist. Expects to be run from a # build directory, such as one in which "configure" has been run, i.e. # there should be a Makefile present. # # If ~/.config/packaging-hosts exists, then build-package.sh is run on each # one and the resultant packages (RPMs, DEBs, etc) are copied back. # # All of the release artefacts are placed in a "RELEASE-x" directory, where # "x" is the version. # # Copyright 2024-2025 Andrew Wood # License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. # # Version: 0.0.2 / 16 Dec 2024 srcdir="$(awk '/^VPATH/{print $NF}' < Makefile | sed -n 1p)" manuals="$(find "${srcdir}/docs" -mindepth 1 -maxdepth 1 -type f -name "*.[0-9]" -printf "%f\n")" mainProgram="$(awk '/^[a-z]+_PROGRAMS/{print $3}' Makefile |cut -d '$' -f 1 | sed -n 1p)" labTestScript="${srcdir}/docs/test-on-vm-lab.sh" packageBuildScript="${srcdir}/docs/build-package.sh" status () { test -n "$*" && printf "\n" printf '\e]0;%s\007\r' "$*" >&2 if test -n "$*"; then tput rev >&2 printf " -- %s -- " "$*" >&2 tput sgr0 >&2 printf "\n\n" fi } possiblyDie () { printf "\n" >&2 tput bold >&2 printf "%s: %s\n" "release" "$*" >&2 tput sgr0 >&2 printf "\n%s\n" "Type 'y' and hit Enter to continue anyway." read -r line test "${line}" = "y" || { status ""; exit 1; } } test -e "${labTestScript}" || labTestScript="" test -e "${packageBuildScript}" || packageBuildScript="" # The checklist is re-ordered a little so that we defer making changes (like # "make indent") until as late as possible, in case any checks fail. status "Initial checks" # Check MAINTAINER is provided. test -n "${MAINTAINER}" || possiblyDie "environment variable MAINTAINER is empty" # * Check that _po/POTFILES.in_ is up to date if test -d "${srcdir}/po"; then inFile="$(sort < "${srcdir}/po/POTFILES.in")" realList="$(find "${srcdir}" -name "*.c" -printf "%P\n" | sort)" test "${inFile}" = "${realList}" || possiblyDie "po/POTFILES.in is incorrect" fi status "Initial build" make || possiblyDie "failed 'make'" # * Run "_make analyse_" and see whether remaining warnings can be addressed status "Source analysis" make analyse || possiblyDie "failed 'make analyse'" # * Version bump and documentation checks: status "Version checks" # * Check that _docs/NEWS.md_ is up to date versionInNews="$(awk 'FNR==1{print $2}' "${srcdir}/docs/NEWS.md")" printf "%s\n" "${versionInNews}" | grep -Eq '^[0-9]' || possiblyDie "version in NEWS.md (${versionInNews}) is not numeric" # * Check the version in both _configure.ac_ and _docs/NEWS.md_ was updated versionInConfig="$(grep ^AC_INIT "${srcdir}/configure.ac" | cut -d '[' -f 3 | cut -d ']' -f 1)" test "${versionInConfig}" = "${versionInNews}" || possiblyDie "version in configure.ac (${versionInConfig}) mismatches NEWS.md (${versionInNews})" # * Check that the manuals are up to date for manPage in ${manuals}; do versionInManual="$(awk 'FNR==1 {print $5}' "${srcdir}/docs/${manPage}" | cut -d - -f 2)" test "${versionInManual}" = "${versionInNews}" || possiblyDie "version in ${manPage} (${versionInManual}) mismatches NEWS.md (${versionInNews})" done # * Check that the program version is correct versionInVersionOutput="$(./"${mainProgram}" --version | awk 'FNR==1{print $NF}')" test "${versionInVersionOutput}" = "${versionInNews}" || possiblyDie "version in '${mainProgram} --version' (${versionInVersionOutput}) mismatches NEWS.md (${versionInNews})" # * Check that the year displayed by --version is correct yearInVersion="$(./"${mainProgram}" --version | awk '/^Copyright/{print $2}')" yearNow="$(date '+%Y')" test "${yearInVersion}" = "${yearNow}" || possiblyDie "the year in '--version' (${yearInVersion}) is not this year (${yearNow})" # * Make the Markdown version of the manuals and, if using VPATH, copy the result to the source directory # We also wipe everything in "docs" so we don't accidentally package # leftover working files. status "Markdown manual" rm -f docs/* for manPage in ${manuals}; do make "docs/${manPage}.md" cp "docs/${manPage}.md" "${srcdir}/docs/${manPage}.md" done # * Run "_make indent; make indent indentclean check_" status "Reformat source" make indent make indent indentclean # The check will run later as part of "make distcheck". # * Run "_make -C po update-po_" status "Update po files" if test -d "${srcdir}/po"; then make -C po update-po || possiblyDie "update-po failed" fi # * Run "_autoreconf_" in the source directory status "Run autoreconf" (cd "${srcdir}" && autoreconf -is) || possiblyDie "autoreconf failed" # * Ensure everything has been committed to the repository status "Commit check" gitStatus="$(cd "${srcdir}" && git status --porcelain=v1)" || possiblyDie "failed to run 'git status'" test -z "${gitStatus}" || possiblyDie "not everything is committed - 'git status' is not empty" # * Consistency and build checks: # * Wipe the build directory, and run "_configure_" there # * Run "_make distcheck_" # * Run "_make release MAINTAINER=_" # NB "make release" implies "make distcheck". # We set SKIP_VALGRIND_TESTS=1 because the full tests will run in the lab # check. status "Release archive" workDir="$(mktemp -d)" || possiblyDie "mktemp failed" trap 'chmod -R u+w "${workDir}"; rm -rf "${workDir}"' EXIT ( cd "${workDir}" || exit 1 sh "${srcdir}/configure" || exit 1 make -j8 release SKIP_VALGRIND_TESTS=1 || exit 1 exit 0 ) || possiblyDie "failed on 'make release'" sourceArchive="$(find "${workDir}" -mindepth 1 -maxdepth 1 -type f -name "*.tar.gz")" test -e "${sourceArchive}.asc" || possiblyDie "release was not signed" # * Run "_./configure && make check_" on all test systems, using the _tar.gz_ that was just created # * Run a cross-compilation check if test -n "${labTestScript}"; then status "Lab test" sh "${labTestScript}" "${sourceArchive}" || possiblyDie "lab test failed" fi # * Update the project web site: # * Copy the release _.tar.gz_, _.txt_, and _.asc_ files to the web site # * Use "_pandoc --from markdown --to html_" to convert the news and manual to HTML status "Release dir" rm -rf "RELEASE-${versionInNews}" mkdir "RELEASE-${versionInNews}" cp "${sourceArchive}" "${sourceArchive}.asc" "${sourceArchive}.txt" "RELEASE-${versionInNews}/" || possiblyDie "failed to copy release files" status "HTML docs" for manPage in ${manuals}; do pandoc --from markdown --to html --shift-heading-level-by=1 < "${srcdir}/docs/${manPage}.md" > "RELEASE-${versionInNews}/${manPage}.html" done pandoc --from markdown --to html < "${srcdir}/docs/NEWS.md" > "RELEASE-${versionInNews}/news.html" # Build OS packages. packagingHosts="$(cat ~/.config/packaging-hosts 2>/dev/null)" test -n "${packageBuildScript}" || packagingHosts="" for buildHost in ${packagingHosts}; do remoteWorkDir="$(ssh "${buildHost}" "mktemp -d")" || continue test -n "${remoteWorkDir}" || continue status "Package: ${buildHost}" buildOK=true scp "${packageBuildScript}" "${buildHost}:${remoteWorkDir}/build-package.sh" || buildOK=false ${buildOK} && scp "${sourceArchive}" "${buildHost}:${remoteWorkDir}/" || buildOK=false # shellcheck disable=SC2029 ${buildOK} && ssh -t "${buildHost}" "cd \"${remoteWorkDir}\" && SKIP_VALGRIND_TESTS=\"${SKIP_VALGRIND_TESTS}\" MAINTAINER=\"${MAINTAINER}\" sh ./build-package.sh ./*gz" || buildOK=false # shellcheck disable=SC2029 ${buildOK} && ssh "${buildHost}" "rm \"${remoteWorkDir}\"/${sourceArchive##*/} \"${remoteWorkDir}/build-package.sh\"" ${buildOK} && mkdir -p "RELEASE-${versionInNews}/${buildHost}" ${buildOK} && scp "${buildHost}:${remoteWorkDir}/*" "RELEASE-${versionInNews}/${buildHost}/" # shellcheck disable=SC2029 ssh "${buildHost}" "rm -rf \"${remoteWorkDir}\"" done find "RELEASE-${versionInNews}/" -type f -exec chmod 644 '{}' ';' find "RELEASE-${versionInNews}/" -type d -exec chmod 755 '{}' ';' status "Done" cat <&3 if test -n "${buildHost}"; then ssh "${buildHost}" mkdir "${remoteBuildDir}" || exit 1 else mkdir "${localBuildDir}" || exit 1 fi printf '%s %s\n' 'ok' 'created build area' >&3 if test -n "${checkHost}"; then printf '%s %s\n' 'notice' 'creating check area' >&3 ssh "${checkHost}" mkdir "${remoteBuildDir}" || exit 1 printf '%s %s\n' 'ok' 'created check area' >&3 fi printf '%s %s\n' 'notice' 'copying source archive' >&3 if test -n "${buildHost}"; then scp "${sourceArchive}" "${buildHost}:${remoteBuildDir}/" || exit 1 elif test -n "${checkHost}"; then scp "${sourceArchive}" "${checkHost}:${remoteBuildDir}/" || exit 1 fi printf '%s %s\n' 'ok' 'source archive copied' >&3 printf '%s %s\n' 'notice' 'extracting source archive' >&3 if test -n "${buildHost}"; then ssh "${buildHost}" tar xzf "${remoteBuildDir}/${sourceArchive##*/}" -C "${remoteBuildDir}" || exit $? else tar xzf "${sourceArchive}" -C "${localBuildDir}" || exit $? ssh "${checkHost}" tar xzf "${remoteBuildDir}/${sourceArchive##*/}" -C "${remoteBuildDir}" || exit $? fi printf '%s %s\n' 'ok' 'source archive extracted' >&3 stepResult="ok" if test -n "${buildHost}"; then printf '%s %s\n' 'notice' 'configuring' >&3 ssh "${buildHost}" "cd \"${remoteBuildDir}\" && mkdir BUILD && cd BUILD && ../*/configure ${configureArguments}" || exit $? else printf '%s %s\n' 'notice' 'configuring locally' >&3 ( cd "${localBuildDir}" && mkdir BUILD && cd BUILD && ../*/configure ${configureArguments} ) || exit $? printf '%s %s\n' 'notice' "configuring on ${checkHost}" >&3 ssh "${checkHost}" "cd \"${remoteBuildDir}\" && mkdir BUILD && cd BUILD && ../*/configure" \ || { stepResult="warning"; printf '%s %s\n' 'warning' "configuration failed on ${checkHost}" >&3; } fi printf '%s %s\n' "${stepResult}" 'configuration completed' >&3 printf '%s %s\n' 'notice' 'building' >&3 if test -n "${buildHost}"; then ssh "${buildHost}" "cd \"${remoteBuildDir}/BUILD\" && make -j${concurrency}" || exit $? else make -j${concurrency} -C "${localBuildDir}/BUILD" || exit $? fi printf '%s %s\n' 'ok' 'build completed' >&3 if test -n "${buildHost}"; then printf '%s %s\n' 'notice' 'testing' >&3 ssh "${buildHost}" "cd \"${remoteBuildDir}/BUILD\" && make -j${concurrency} check" || exit $? printf '%s %s\n' 'ok' 'testing completed' >&3 elif test -n "${checkHost}"; then printf '%s %s\n' 'notice' "transferring build to ${checkHost}" >&3 tar cvf "${localBuildDir}/build.tar" -C "${localBuildDir}" BUILD || exit $? scp "${localBuildDir}/build.tar" "${checkHost}:${remoteBuildDir}/build.tar" || exit $? ssh "${checkHost}" "tar xf \"${remoteBuildDir}/build.tar\" -C \"${remoteBuildDir}\"" || exit $? printf '%s %s\n' 'ok' "transferred build to ${checkHost}" >&3 printf '%s %s\n' 'notice' "testing on ${checkHost}" >&3 ssh "${checkHost}" "cd \"${remoteBuildDir}/BUILD\" && make -j${concurrency} check-TESTS XCTEST=1" || exit $? printf '%s %s\n' 'ok' 'testing completed' >&3 fi exit 0 } # Using directory $1 for metrics and output, run the remaining arguments as # a command using "scw" to capture metrics and record logs. # recordCommand () { targetDir="$1" shift mkdir -p "${targetDir}" scw -c /dev/null \ -s UserConfigFile=/dev/null \ -s ItemsDir=/dev/null \ -s MetricsDir="${targetDir}" \ -s CheckLockFile="${targetDir}/.widelock" \ -s OutputMap= \ -s OutputMap="OES stamped ${targetDir}/output.log" \ -s OutputMap="OES raw ${targetDir}/raw-output.log" \ -s Command="$*" \ run item } if test "$1" = "--testRunner"; then testRunner exit 1 fi labHosts="$(cat ~/.config/lab-hosts 2>/dev/null)" workDir=$(mktemp -d) || exit 1 trap 'rm -rf "${workDir}"' EXIT sourceArchive="$1" shift hostList="$*" test -n "${hostList}" || hostList="${labHosts}" test -n "${sourceArchive}" || { echo "Usage: ${0##*/} TARBALL [HOST...]"; exit 1; } test -s "${sourceArchive}" || { echo "${sourceArchive}: not found"; exit 1; } attrBold="$(tput bold 2>/dev/null)" attrUnderline="$(tput smul 2>/dev/null)" attrRed="$(tput setaf 1 2>/dev/null)" attrGreen="$(tput setaf 2 2>/dev/null)" attrYellow="$(tput setaf 3 2>/dev/null)" attrBlue="$(tput setaf 4 2>/dev/null)" attrMagenta="$(tput setaf 5 2>/dev/null)" attrCyan="$(tput setaf 6 2>/dev/null)" attrWhite="$(tput setaf 7 2>/dev/null)" attrNone="$(tput sgr0 2>/dev/null)" dateStamp="$(date +%Y%m%d-%H%M)" resultsArchive="result-${dateStamp}.tar.gz" startEpoch="$(date +%s)" for hostSpec in ${hostList}; do localTestDir="${workDir}/${hostSpec}" remoteBuildDir="test-${dateStamp}.$(date +%s).$$" buildHost="${hostSpec}" checkHost="" configureArguments="" xcFor="${hostSpec%:*}" xcRunOn="${hostSpec#*:}" if ! test "${xcFor}" = "${xcRunOn}"; then localTestDir="${workDir}/${xcFor}-${xcRunOn}" buildHost="" checkHost="${xcRunOn}" configureArguments="--host ${xcFor}" fi mkdir "${localTestDir}" printf "%s\n" "${hostSpec}" > "${localTestDir}/hostSpec" localBuildDir="${localTestDir}/XC" ( flock -x 3 export sourceArchive buildHost checkHost remoteBuildDir localBuildDir configureArguments recordCommand "${localTestDir}" "sh \"$0\" --testRunner" 3<&- exec >>"${localTestDir}/output.log" 2>&1 printf '*** %s\n' 'retrieving build and test artefacts' mkdir "${localTestDir}/tests" if test -n "${buildHost}"; then scp "${buildHost}:${remoteBuildDir}/BUILD/config.log" "${localTestDir}/" scp "${buildHost}:${remoteBuildDir}/BUILD/test-suite.log" "${localTestDir}/" scp "${buildHost}:${remoteBuildDir}/BUILD/tests/*" "${localTestDir}/tests/" elif test -n "${checkHost}"; then scp "${checkHost}:${remoteBuildDir}/BUILD/config.log" "${localTestDir}/" scp "${checkHost}:${remoteBuildDir}/BUILD/test-suite.log" "${localTestDir}/" scp "${checkHost}:${remoteBuildDir}/BUILD/tests/*" "${localTestDir}/tests/" fi printf '*** %s\n' 'removing build area' rm -rf "${localBuildDir}" if test -n "${buildHost}"; then ssh "${buildHost}" rm -rf "${remoteBuildDir}" elif test -n "${checkHost}"; then ssh "${checkHost}" rm -rf "${remoteBuildDir}" fi printf '\n' flock -u 3 ) > "${localTestDir}/framework-output.log" 2>&1 3>>"${localTestDir}/active" & done sleep 0.1 allTestHostDirs="$(find "${workDir}" -mindepth 1 -maxdepth 1 -name "[0-9A-Za-z_]*" -type d -printf "%f\n" | sort)" hostCount=0 for testHostDir in ${allTestHostDirs}; do hostCount=$((1+hostCount)); done exitedCount=0 overallStatus="" while test "${exitedCount}" -lt "${hostCount}"; do width="$(tput cols 2>/dev/null)" test -n "${width}" || width=80 currentEpoch="$(date +%s)" elapsedSeconds=$((currentEpoch-startEpoch)) { nameWidth=0 runningCount=0 failedCount=0 passedCount=0 exitedCount=0 overallStatus="" for testHostDir in ${allTestHostDirs}; do hostSpec="${testHostDir}" { read -r hostSpec < "${workDir}/${testHostDir}/hostSpec"; } 2>/dev/null test "${#hostSpec}" -gt "${nameWidth}" && nameWidth="${#hostSpec}" exec 3>>"${workDir}/${testHostDir}/active" flock -x -n 3 && exitedCount=$((1+exitedCount)) exec 3<&- test -e "${workDir}/${testHostDir}/ended" || runningCount=$((1+runningCount)) if test -e "${workDir}/${testHostDir}/failed"; then overallStatus="FAIL" failedCount=$((1+failedCount)) elif test -e "${workDir}/${testHostDir}/succeeded"; then test -z "${overallStatus}" && overallStatus="PASS" passedCount=$((1+passedCount)) fi done test -n "${overallStatus}" || overallStatus="----" printf "%sT+%04d - %s%s\n\n" "${attrUnderline}" "${elapsedSeconds}" "$(date '+%Y-%m-%d %H:%M:%S')" "${attrNone}" for testHostDir in ${allTestHostDirs}; do hostSpec="${testHostDir}" { read -r hostSpec < "${workDir}/${testHostDir}/hostSpec"; } 2>/dev/null lastStatusWord="-" lastStatusMessage="-" { read -r lastStatusWord lastStatusMessage < "${workDir}/${testHostDir}/last-status"; } 2>/dev/null lastLine="-" test -s "${workDir}/${testHostDir}/output.log" && lastLine="$(tail -n 1 "${workDir}/${testHostDir}/output.log" 2>/dev/null | expand)" testResult="----" test -e "${workDir}/${testHostDir}/failed" && testResult="FAIL" test -e "${workDir}/${testHostDir}/succeeded" && testResult="PASS" remainingWidth=$((width-nameWidth-20)) statusWidth=$((remainingWidth*2/3)) test "${statusWidth}" -gt 40 && statusWidth=40 lastLineWidth=$((remainingWidth-statusWidth)) printf " %s%${nameWidth}s%s " "${attrBold}${attrYellow}" "${hostSpec}" "${attrNone}" case "${testResult}" in "PASS") printf "%s%s%s" "${attrBold}${attrGreen}" "PASS" "${attrNone}" ;; "FAIL") printf "%s%s%s" "${attrBold}${attrRed}" "FAIL" "${attrNone}" ;; *) printf "%s" "----" esac case "${lastStatusWord}" in "(begin)"|"begin") printf " (%s%s%s) " "${attrBold}${attrMagenta}" "begin" "${attrNone}" ;; "(end)"|"end") printf " (%s%s%s) " "${attrBold}${attrMagenta}" "end" "${attrNone}" ;; "(notice)"|"notice") printf " (%s%s%s) " "${attrBold}${attrCyan}" "notice" "${attrNone}" ;; "(ok)"|"ok") printf " (%s%s%s) " "${attrBold}${attrGreen}" "ok" "${attrNone}" ;; "(warning)"|"warning") printf " (%s%s%s)" "${attrBold}${attrYellow}" "warning" "${attrNone}" ;; "(error)"|"error") printf " (%s%s%s) " "${attrBold}${attrRed}" "error" "${attrNone}" ;; *) printf " %7s " ""; lastStatusMessage="${lastStatusWord} ${lastStatusMessage}" ;; esac printf " %s%-${statusWidth}.${statusWidth}s%s" "${attrWhite}" "${lastStatusMessage}" "${attrNone}" printf " %s%-${lastLineWidth}.${lastLineWidth}s%s" "${attrBlue}" "${lastLine}" "${attrNone}" printf "\n" done printf "\n%s%s%s " "${attrBold}" "Overall status:" "${attrNone}" case "${overallStatus}" in "PASS") printf "%s%s%s" "${attrBold}${attrGreen}" "PASS" "${attrNone}" ;; "FAIL") printf "%s%s%s" "${attrBold}${attrRed}" "FAIL" "${attrNone}" ;; *) printf "%s" "----" esac printf " %s%s%s " "${attrBold}" "Running,Passed,Failed:" "${attrNone}" printf "%sR%d%s" "${attrBold}${attrMagenta}" "${runningCount}" "${attrNone}" printf ",%sP%d%s" "${attrBold}${attrGreen}" "${passedCount}" "${attrNone}" printf ",%sF%d%s" "${attrBold}${attrRed}" "${failedCount}" "${attrNone}" printf " = %d" "${hostCount}" printf "\n\n" } > "${workDir}/latest-status.txt" cat "${workDir}/latest-status.txt" sleep 1 done endEpoch="$(date +%s)" elapsedSeconds=$((endEpoch-startEpoch)) printf '%s\n' 'Generating results archive' tar czf "${resultsArchive}" -C "${workDir}" . printf '%s: %d%s\n' 'Total time taken' "${elapsedSeconds}" "s" printf '%s: %s\n' 'Results archive' "${resultsArchive}" test "${overallStatus}" = "PASS" || exit 1 pv-1.9.31/po/000077500000000000000000000000001474702661500126645ustar00rootroot00000000000000pv-1.9.31/po/LINGUAS000066400000000000000000000000301474702661500137020ustar00rootroot00000000000000cs de es fr pl pt ru tr pv-1.9.31/po/Makefile.in.in000066400000000000000000000461631474702661500153500ustar00rootroot00000000000000# Makefile for PO directory in any package using GNU gettext. # Copyright (C) 1995-2000 Ulrich Drepper # Copyright (C) 2000-2020 Free Software Foundation, Inc. # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. This file is offered as-is, # without any warranty. # # Origin: gettext-0.21 GETTEXT_MACRO_VERSION = 0.20 PACKAGE = @PACKAGE@ VERSION = @VERSION@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ SED = @SED@ SHELL = /bin/sh @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ datarootdir = @datarootdir@ datadir = @datadir@ localedir = @localedir@ gettextsrcdir = $(datadir)/gettext/po INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ # We use $(mkdir_p). # In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as # "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions, # @install_sh@ does not start with $(SHELL), so we add it. # In automake >= 1.10, @mkdir_p@ is derived from ${MKDIR_P}, which is defined # either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake # versions, $(mkinstalldirs) and $(install_sh) are unused. mkinstalldirs = $(SHELL) @install_sh@ -d install_sh = $(SHELL) @install_sh@ MKDIR_P = @MKDIR_P@ mkdir_p = @mkdir_p@ # When building gettext-tools, we prefer to use the built programs # rather than installed programs. However, we can't do that when we # are cross compiling. CROSS_COMPILING = @CROSS_COMPILING@ GMSGFMT_ = @GMSGFMT@ GMSGFMT_no = @GMSGFMT@ GMSGFMT_yes = @GMSGFMT_015@ GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT)) XGETTEXT_ = @XGETTEXT@ XGETTEXT_no = @XGETTEXT@ XGETTEXT_yes = @XGETTEXT_015@ XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT)) MSGMERGE = @MSGMERGE@ MSGMERGE_UPDATE = @MSGMERGE@ --update MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@ MSGINIT = msginit MSGCONV = msgconv MSGFILTER = msgfilter POFILES = @POFILES@ GMOFILES = @GMOFILES@ UPDATEPOFILES = @UPDATEPOFILES@ DUMMYPOFILES = @DUMMYPOFILES@ DISTFILES.common = Makefile.in.in remove-potcdate.sin \ $(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3) DISTFILES = $(DISTFILES.common) Makevars POTFILES.in \ $(POFILES) $(GMOFILES) \ $(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3) POTFILES = \ CATALOGS = @CATALOGS@ POFILESDEPS_ = $(srcdir)/$(DOMAIN).pot POFILESDEPS_yes = $(POFILESDEPS_) POFILESDEPS_no = POFILESDEPS = $(POFILESDEPS_$(PO_DEPENDS_ON_POT)) DISTFILESDEPS_ = update-po DISTFILESDEPS_yes = $(DISTFILESDEPS_) DISTFILESDEPS_no = DISTFILESDEPS = $(DISTFILESDEPS_$(DIST_DEPENDS_ON_UPDATE_PO)) # Makevars gets inserted here. (Don't remove this line!) all: all-@USE_NLS@ .SUFFIXES: .SUFFIXES: .po .gmo .sed .sin .nop .po-create .po-update # The .pot file, stamp-po, .po files, and .gmo files appear in release tarballs. # The GNU Coding Standards say in # : # "GNU distributions usually contain some files which are not source files # ... . Since these files normally appear in the source directory, they # should always appear in the source directory, not in the build directory. # So Makefile rules to update them should put the updated files in the # source directory." # Therefore we put these files in the source directory, not the build directory. # During .po -> .gmo conversion, take into account the most recent changes to # the .pot file. This eliminates the need to update the .po files when the # .pot file has changed, which would be troublesome if the .po files are put # under version control. $(GMOFILES): $(srcdir)/$(DOMAIN).pot .po.gmo: @lang=`echo $* | sed -e 's,.*/,,'`; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}rm -f $${lang}.gmo && $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $${lang}.po $(DOMAIN).pot && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.1po && rm -f $${lang}.1po"; \ cd $(srcdir) && \ rm -f $${lang}.gmo && \ $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $${lang}.po $(DOMAIN).pot && \ $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.1po && \ mv t-$${lang}.gmo $${lang}.gmo && \ rm -f $${lang}.1po .sin.sed: sed -e '/^#/d' $< > t-$@ mv t-$@ $@ all-yes: $(srcdir)/stamp-po all-no: # Ensure that the gettext macros and this Makefile.in.in are in sync. CHECK_MACRO_VERSION = \ test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \ || { echo "*** error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version $(GETTEXT_MACRO_VERSION) but the autoconf macros are from gettext version @GETTEXT_MACRO_VERSION@" 1>&2; \ exit 1; \ } # $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no # internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because # we don't want to bother translators with empty POT files). We assume that # LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty. # In this case, $(srcdir)/stamp-po is a nop (i.e. a phony target). # $(srcdir)/stamp-po is a timestamp denoting the last time at which the CATALOGS # have been loosely updated. Its purpose is that when a developer or translator # checks out the package from a version control system, and the $(DOMAIN).pot # file is not under version control, "make" will update the $(DOMAIN).pot and # the $(CATALOGS), but subsequent invocations of "make" will do nothing. This # timestamp would not be necessary if updating the $(CATALOGS) would always # touch them; however, the rule for $(POFILES) has been designed to not touch # files that don't need to be changed. $(srcdir)/stamp-po: $(srcdir)/$(DOMAIN).pot @$(CHECK_MACRO_VERSION) test ! -f $(srcdir)/$(DOMAIN).pot || \ test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) @test ! -f $(srcdir)/$(DOMAIN).pot || { \ echo "touch $(srcdir)/stamp-po" && \ echo timestamp > $(srcdir)/stamp-poT && \ mv $(srcdir)/stamp-poT $(srcdir)/stamp-po; \ } # Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', # otherwise packages like GCC can not be built if only parts of the source # have been downloaded. # This target rebuilds $(DOMAIN).pot; it is an expensive operation. # Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. # The determination of whether the package xyz is a GNU one is based on the # heuristic whether some file in the top level directory mentions "GNU xyz". # If GNU 'find' is available, we avoid grepping through monster files. $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed package_gnu="$(PACKAGE_GNU)"; \ test -n "$$package_gnu" || { \ if { if (LC_ALL=C find --version) 2>/dev/null | grep GNU >/dev/null; then \ LC_ALL=C find -L $(top_srcdir) -maxdepth 1 -type f -size -10000000c -exec grep -i 'GNU @PACKAGE@' /dev/null '{}' ';' 2>/dev/null; \ else \ LC_ALL=C grep -i 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null; \ fi; \ } | grep -v 'libtool:' >/dev/null; then \ package_gnu=yes; \ else \ package_gnu=no; \ fi; \ }; \ if test "$$package_gnu" = "yes"; then \ package_prefix='GNU '; \ else \ package_prefix=''; \ fi; \ if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \ msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \ else \ msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \ fi; \ case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ --add-comments=TRANSLATORS: \ --files-from=$(srcdir)/POTFILES.in \ --copyright-holder='$(COPYRIGHT_HOLDER)' \ --msgid-bugs-address="$$msgid_bugs_address" \ $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ ;; \ *) \ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ --add-comments=TRANSLATORS: \ --files-from=$(srcdir)/POTFILES.in \ --copyright-holder='$(COPYRIGHT_HOLDER)' \ --package-name="$${package_prefix}@PACKAGE@" \ --package-version='@VERSION@' \ --msgid-bugs-address="$$msgid_bugs_address" \ $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ ;; \ esac test ! -f $(DOMAIN).po || { \ if test -f $(srcdir)/$(DOMAIN).pot-header; then \ sed -e '1,/^#$$/d' < $(DOMAIN).po > $(DOMAIN).1po && \ cat $(srcdir)/$(DOMAIN).pot-header $(DOMAIN).1po > $(DOMAIN).po && \ rm -f $(DOMAIN).1po \ || exit 1; \ fi; \ if test -f $(srcdir)/$(DOMAIN).pot; then \ sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ else \ rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ fi; \ else \ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ fi; \ } # This rule has no dependencies: we don't need to update $(DOMAIN).pot at # every "make" invocation, only create it when it is missing. # Only "make $(DOMAIN).pot-update" or "make dist" will force an update. $(srcdir)/$(DOMAIN).pot: $(MAKE) $(DOMAIN).pot-update # This target rebuilds a PO file if $(DOMAIN).pot has changed. # Note that a PO file is not touched if it doesn't need to be changed. $(POFILES): $(POFILESDEPS) @test -f $(srcdir)/$(DOMAIN).pot || $(MAKE) $(srcdir)/$(DOMAIN).pot @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ if test -f "$(srcdir)/$${lang}.po"; then \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} --previous $${lang}.po $(DOMAIN).pot"; \ cd $(srcdir) \ && { case `$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].*) \ $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \ 0.1[6-7] | 0.1[6-7].*) \ $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --previous $${lang}.po $(DOMAIN).pot;; \ *) \ $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} --previous $${lang}.po $(DOMAIN).pot;; \ esac; \ }; \ else \ $(MAKE) $${lang}.po-create; \ fi install: install-exec install-data install-exec: install-data: install-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ for file in $(DISTFILES.common) Makevars.template; do \ $(INSTALL_DATA) $(srcdir)/$$file \ $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ for file in Makevars; do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ : ; \ fi install-data-no: all install-data-yes: all @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkdir_p) $(DESTDIR)$$dir; \ if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \ echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ if test -n "$$lc"; then \ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ for file in *; do \ if test -f $$file; then \ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ fi; \ done); \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ else \ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ :; \ else \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ fi; \ fi; \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \ fi; \ done; \ done install-strip: install installdirs: installdirs-exec installdirs-data installdirs-exec: installdirs-data: installdirs-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ else \ : ; \ fi installdirs-data-no: installdirs-data-yes: @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkdir_p) $(DESTDIR)$$dir; \ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ if test -n "$$lc"; then \ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ for file in *; do \ if test -f $$file; then \ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ fi; \ done); \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ else \ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ :; \ else \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ fi; \ fi; \ fi; \ done; \ done # Define this as empty until I found a useful application. installcheck: uninstall: uninstall-exec uninstall-data uninstall-exec: uninstall-data: uninstall-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ for file in $(DISTFILES.common) Makevars.template; do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ : ; \ fi uninstall-data-no: uninstall-data-yes: catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ done; \ done check: all info dvi ps pdf html tags TAGS ctags CTAGS ID: install-dvi install-ps install-pdf install-html: mostlyclean: rm -f remove-potcdate.sed rm -f $(srcdir)/stamp-poT rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po rm -fr *.o clean: mostlyclean distclean: clean rm -f Makefile Makefile.in POTFILES maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." rm -f $(srcdir)/$(DOMAIN).pot $(srcdir)/stamp-po $(GMOFILES) distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: test -z "$(DISTFILESDEPS)" || $(MAKE) $(DISTFILESDEPS) @$(MAKE) dist2 # This is a separate target because 'update-po' must be executed before. dist2: $(srcdir)/stamp-po $(DISTFILES) @dists="$(DISTFILES)"; \ if test "$(PACKAGE)" = "gettext-tools"; then \ dists="$$dists Makevars.template"; \ fi; \ if test -f $(srcdir)/$(DOMAIN).pot; then \ dists="$$dists $(DOMAIN).pot stamp-po"; \ else \ case $(XGETTEXT) in \ :) echo "Warning: Creating a tarball without '$(DOMAIN).pot', because a suitable 'xgettext' program was not found in PATH." 1>&2;; \ *) echo "Warning: Creating a tarball without '$(DOMAIN).pot', because 'xgettext' found no strings to extract. Check the contents of the POTFILES.in file and the XGETTEXT_OPTIONS in the Makevars file." 1>&2;; \ esac; \ fi; \ if test -f $(srcdir)/ChangeLog; then \ dists="$$dists ChangeLog"; \ fi; \ for i in 0 1 2 3 4 5 6 7 8 9; do \ if test -f $(srcdir)/ChangeLog.$$i; then \ dists="$$dists ChangeLog.$$i"; \ fi; \ done; \ if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \ for file in $$dists; do \ if test -f $$file; then \ cp -p $$file $(distdir) || exit 1; \ else \ cp -p $(srcdir)/$$file $(distdir) || exit 1; \ fi; \ done update-po: Makefile $(MAKE) $(DOMAIN).pot-update test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) $(MAKE) update-gmo # General rule for creating PO files. .nop.po-create: @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \ echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \ exit 1 # General rule for updating PO files. .nop.po-update: @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ if test "$(PACKAGE)" = "gettext-tools" && test "$(CROSS_COMPILING)" != "yes"; then PATH=`pwd`/../src:$$PATH; fi; \ tmpdir=`pwd`; \ echo "$$lang:"; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}$(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang --previous $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ cd $(srcdir); \ if { case `$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].*) \ $(MSGMERGE) $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ 0.1[6-7] | 0.1[6-7].*) \ $(MSGMERGE) $(MSGMERGE_OPTIONS) --previous -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ *) \ $(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang --previous -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ esac; \ }; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ exit 1; \ fi; \ fi; \ else \ echo "msgmerge for $$lang.po failed!" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ fi $(DUMMYPOFILES): update-gmo: Makefile $(GMOFILES) @: # Recreate Makefile by invoking config.status. Explicitly invoke the shell, # because execution permission bits may not work on the current file system. # Use @SHELL@, which is the shell determined by autoconf for the use by its # scripts, not $(SHELL) which is hardwired to /bin/sh and may be deficient. Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@ cd $(top_builddir) \ && @SHELL@ ./config.status $(subdir)/$@.in po-directories force: # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: pv-1.9.31/po/Makevars000066400000000000000000000067311474702661500143670ustar00rootroot00000000000000# Makefile variables for PO directory in any package using GNU gettext. # # Copyright (C) 2003-2019 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation gives # unlimited permission to use, copy, distribute, and modify it. # Usually the message domain is the same as the package name. DOMAIN = $(PACKAGE) # These two variables depend on the location of this directory. subdir = po top_builddir = .. # These options get passed to xgettext. XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ # This is the copyright holder that gets inserted into the header of the # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding # package. (Note that the msgstr strings, extracted from the package's # sources, belong to the copyright holder of the package.) Translators are # expected to transfer the copyright for their translations to this person # or entity, or to disclaim their copyright. The empty string stands for # the public domain; in this case the translators are expected to disclaim # their copyright. COPYRIGHT_HOLDER = Andrew Wood # This tells whether or not to prepend "GNU " prefix to the package # name that gets inserted into the header of the $(DOMAIN).pot file. # Possible values are "yes", "no", or empty. If it is empty, try to # detect it automatically by scanning the files in $(top_srcdir) for # "GNU packagename" string. PACKAGE_GNU = # This is the email address or URL to which the translators shall report # bugs in the untranslated strings: # - Strings which are not entire sentences, see the maintainer guidelines # in the GNU gettext documentation, section 'Preparing Strings'. # - Strings which use unclear terms or require additional context to be # understood. # - Strings which make invalid assumptions about notation of date, time or # money. # - Pluralisation problems. # - Incorrect English spelling. # - Incorrect formatting. # It can be your email address, or a mailing list address where translators # can write to without being subscribed, or the URL of a web page through # which the translators can contact you. MSGID_BUGS_ADDRESS = # This is the list of locale categories, beyond LC_MESSAGES, for which the # message catalogs shall be used. It is usually empty. EXTRA_LOCALE_CATEGORIES = # This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt' # context. Possible values are "yes" and "no". Set this to yes if the # package uses functions taking also a message context, like pgettext(), or # if in $(XGETTEXT_OPTIONS) you define keywords with a context argument. USE_MSGCTXT = no # These options get passed to msgmerge. # Useful options are in particular: # --previous to keep previous msgids of translated messages, # --quiet to reduce the verbosity. MSGMERGE_OPTIONS = # These options get passed to msginit. # If you want to disable line wrapping when writing PO files, add # --no-wrap to MSGMERGE_OPTIONS, XGETTEXT_OPTIONS, and # MSGINIT_OPTIONS. MSGINIT_OPTIONS = # This tells whether or not to regenerate a PO file when $(DOMAIN).pot # has changed. Possible values are "yes" and "no". Set this to no if # the POT file is checked in the repository and the version control # program ignores timestamps. PO_DEPENDS_ON_POT = yes # This tells whether or not to forcibly update $(DOMAIN).pot and # regenerate PO files on "make dist". Possible values are "yes" and # "no". Set this to no if the POT file and PO files are maintained # externally. DIST_DEPENDS_ON_UPDATE_PO = yes pv-1.9.31/po/POTFILES.in000066400000000000000000000011741474702661500144440ustar00rootroot00000000000000src/main/debug.c src/main/help.c src/main/main.c src/main/options.c src/main/remote.c src/main/version.c src/pv/calc.c src/pv/cursor.c src/pv/display.c src/pv/elapsedtime.c src/pv/file.c src/pv/format/averagerate.c src/pv/format/barstyle.c src/pv/format/bufferpercent.c src/pv/format/bytes.c src/pv/format/eta.c src/pv/format/fineta.c src/pv/format/lastwritten.c src/pv/format/name.c src/pv/format/previousline.c src/pv/format/progressbar.c src/pv/format/rate.c src/pv/format/sgr.c src/pv/format/timer.c src/pv/loop.c src/pv/number.c src/pv/proctitle.c src/pv/signal.c src/pv/state.c src/pv/string.c src/pv/transfer.c src/pv/watchpid.c pv-1.9.31/po/Rules-quot000066400000000000000000000045331474702661500146740ustar00rootroot00000000000000# Special Makefile rules for English message catalogs with quotation marks. # # Copyright (C) 2001-2017 Free Software Foundation, Inc. # This file, Rules-quot, and its auxiliary files (listed under # DISTFILES.common.extra1) are free software; the Free Software Foundation # gives unlimited permission to use, copy, distribute, and modify them. DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot .SUFFIXES: .insert-header .po-update-en en@quot.po-create: $(MAKE) en@quot.po-update en@boldquot.po-create: $(MAKE) en@boldquot.po-update en@quot.po-update: en@quot.po-update-en en@boldquot.po-update: en@boldquot.po-update-en .insert-header.po-update-en: @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \ if test "$(PACKAGE)" = "gettext-tools" && test "$(CROSS_COMPILING)" != "yes"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \ tmpdir=`pwd`; \ echo "$$lang:"; \ ll=`echo $$lang | sed -e 's/@.*//'`; \ LC_ALL=C; export LC_ALL; \ cd $(srcdir); \ if $(MSGINIT) $(MSGINIT_OPTIONS) -i $(DOMAIN).pot --no-translator -l $$lang -o - 2>/dev/null \ | $(SED) -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | \ { case `$(MSGFILTER) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-8] | 0.1[0-8].*) \ $(MSGFILTER) $(SED) -f `echo $$lang | sed -e 's/.*@//'`.sed \ ;; \ *) \ $(MSGFILTER) `echo $$lang | sed -e 's/.*@//'` \ ;; \ esac } 2>/dev/null > $$tmpdir/$$lang.new.po \ ; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ exit 1; \ fi; \ fi; \ else \ echo "creation of $$lang.po failed!" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ fi en@quot.insert-header: insert-header.sin sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header en@boldquot.insert-header: insert-header.sin sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header mostlyclean: mostlyclean-quot mostlyclean-quot: rm -f *.insert-header pv-1.9.31/po/boldquot.sed000066400000000000000000000003311474702661500152070ustar00rootroot00000000000000s/"\([^"]*\)"/“\1â€/g s/`\([^`']*\)'/‘\1’/g s/ '\([^`']*\)' / ‘\1’ /g s/ '\([^`']*\)'$/ ‘\1’/g s/^'\([^`']*\)' /‘\1’ /g s/“â€/""/g s/“/“/g s/â€/â€/g s/‘/‘/g s/’/’/g pv-1.9.31/po/cs.gmo000066400000000000000000000255071474702661500140060ustar00rootroot00000000000000Þ•­ À Á É Ð Ø Û Ý á Lç 4 8 = A H ;O ‹  ” ˜ ¡ ¿ Ð 'Õ ý  5 B< % !¥ Ç ä #ê ( 7 9 = 4V <‹ PÈ 88R‹*¨-Ó,-.\{(!¹Û÷,DXw!‘³Ðäÿ%3#Y&}¤¾Øë'ú&"Icw)Œ¶"Ó2ö)"C'f/Ž*¾%é#"7Zp ‚ަ%¹ßû4'Lt”+¦Ò ò)=O!g%‰¯Éá-ù4'\u”'¯×ö#08i ‚&¶È¥Ú€ ˆ“›ž ¤O©ùý@W^dh'q™«/°àäGèA0(r%›!Áã.ê0JL%PFvJ½hLqH¾('(P0y'ª.Ò 4 .P % )¥ &Ï ö !)/!Y!'n!,–!*Ã!4î!#"&" @",a""Ž"C±"$õ"##># S#3`#=”#(Ò#û#$/($&X$1$3±$å$#%")%DL%)‘%'»%ã%)ç%+&=&V&j&z&–&.®&"Ý&*'#+''O'&w'ž'$²' ×'!ø'.(I(d(!z()œ(!Æ(è(û( )72)j)!Š)(¬)*Õ)&**'*(R*;{*#·* Û*9é*#+5+._WN /w{(3R">m[pq ?KhU LO2;AfIC@Z)YB#S,&yPj~=a'vo0 9x\8H!`uMsr}i<Q7JbtDn+kz6cdE 1T4V%F]^eX:$5-l*Gg|(input)(none)(stdin)/sBB/sBYTESConcatenate FILE(s), or standard input, to standard output, with monitoring.ETAFILEFINFORMATHEIGHTLicense: GPLv3+ NAMENUMPIDPID[:FD]Please report any bugs to: %sProject web siteRATESA_SIGINFO not supported on this systemSECSIZEThere is NO WARRANTY, to the extent permitted by law.This is free software: you are free to change and redistribute it.Try `%s --help' for more information.Try `%s -h' for more information.Usage: %s [OPTION] [FILE]...WIDTHassume terminal is HEIGHT rows highassume terminal is WIDTH characters widebb/sbuffer allocation failedcannot transfer files when watching file descriptorscannot use cursor positioning when watching file descriptorscannot use line mode or transfer modifier options when watching file descriptorscannot use remote control when watching file descriptorscompute average rate over past SEC seconds (default 30s)count lines instead of bytesdiscard input instead of writing to outputdisplay nothing until SEC seconds have passeddisplay nothing until first byte transferreddo not output any transfer information at allfailed to clear interval timerfailed to close filefailed to determine size of block devicefailed to generate sysfs filenamefailed to get terminal namefailed to open block devicefailed to open lock filefailed to open terminalfailed to read filefailed to read sysfs size filefailed to seek past errorfailed to seek to start of outputfailed to set interval timerfailed to stat filefailed to stat output filefdfile is not seekablefile list allocation failedflush cache to disk after every writehistory structure allocation failedif size unknown, show rate vs max rateinput file is output fileinteger argument expectedinvalid process IDis a directorylimit transfer to RATE bytes per secondline position buffer allocation failedlines are null-terminatedlock attempt failedmessage not receivednever use splice(), always use read/writeno transfer buffer allocatednot a regular file or block devicenot available on systems without /proc/self/fdinfonumeric argument expectedoption structure allocation failedoption structure argv allocation failedoutput even if standard error is not a terminaloutput percentages, not visual informationoutput transfer statistics at the endpidprefix visual information with NAMEprocess ID or pid:fd pair expectedrate min/avg/max/mdevrate not measuredread failedsave process ID in FILEselect call failedset estimated data size to SIZE bytesset output format to FORMATshow NUM bytes last writtenshow absolute estimated time of arrival (completion)show data transfer average rate countershow data transfer rate countershow elapsed timeshow estimated time of arrival (completion)show number of bits transferredshow number of bytes transferredshow percentage of transfer buffer in useshow progress barshow this help and exitshow version information and exitskip errors in BYTES blocks at a timeskip read errors in inputskipped past read errorstate allocation failedstop after --size bytes have been transferredtreat suffixes as multiples of 1000 rather than 1024update every SEC secondsupdate settings of process PIDuse a buffer size of BYTESuse cursor positioning escape sequencesuse direct I/O to bypass cachewarning: read errors detectedwatch file FD opened by process PIDwrite all input to FILE before writing to outputwrite debug logs to FILEwrite failedwrite output to FILE instead of stdoutyzafpnum KMGTPEZYyzafpnum kMGTPEZYReport-Msgid-Bugs-To: pv@ivarch.com PO-Revision-Date: 2024-10-13 20:43+0000 Last-Translator: mmatous Language-Team: Czech Language: cs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2; X-Generator: Weblate 5.7.2 (vstup)(žádný)(stdin)/sBB/sBAJTSpoj SOUBOR(y) nebo standardní vstup na standardního výstup, s monitoringem.ETASOUBORFINFORMÃTVÃÅ Licence: GPLv3+ JMÉNOÄŒÃSPIDPID[:DS]Prosím, hlaÅ¡te veÅ¡keré chyby na: %sStránka projektuRYCHSA_SIGINFO není na tomto systému podporovánoSEKVELNa program se nevztahuje ŽÃDNà ZÃRUKA, v míře povolené zákonem.Toto je svobodný software; můžete ho volnÄ› mÄ›nit a šířit.Zkuste `%s --help' pro více informací.Zkuste `%s --h' pro více informací.Použití: %s [VOLBY] [SOUBOR]...Å ÃŘpÅ™edpokládej výšku terminálu VÃÅ  znakůpÅ™edpokládej šířku terminálu Å ÃŘ znakůbb/sselhala alokace vyrovnávací pamÄ›tipÅ™i sledování deskriptorů souborů nelze použít pÅ™enos souborůpÅ™i sledování deskriptorů souborů nelze pozicování kurzoru použítpÅ™i sledování deskriptorů souborů nelze použít řádkový mód nebo volby pro modifikaci pÅ™enosupÅ™i sledování deskriptorů souborů nelze použít vzdálené ovládánípoÄítej průmÄ›rnou rychlost za posledních SEK sekund (výchozí: 30)poÄítej řádky místo bajtůzahoÄ vstup namísto zápisu na výstupnic nevypisuj, dokud neuplyne SEK sekundnic nevypisuj, dokud není pÅ™enesen první bytenevypisuj žádné informace o pÅ™enosuselhalo vynulování intervalového ÄasovaÄeselhalo zavÅ™ení souboruselhalo zjiÅ¡tÄ›ní velikosti blokového zařízeníselhalo vytváření jména pro soubor v sysfsselhalo zjiÅ¡tÄ›ní názvu termináluselhalo otevÅ™ení blokového zařízeníselhalo otevÅ™ení zámkového souboruselhalo otevÅ™ení termináluselhalo Ätení ze souboruselhalo Ätení velikosti souboru v sysfsselhal skok za chybuselhalo posunutí za zaÄátek výstupuselhalo nastavení intervalového ÄasovaÄenebylo možné zjistit informace o souboruselhalo zjiÅ¡tÄ›ní informací o výstupním souborudssouborem nelze procházetselhala alokace seznamu souborůpo každém zápisu vyprázdni cache na diskselhala alokace struktury historiepokud je velikost neznámá, ukaž rychlost vs maximální rychlostvstupní soubor je výstupní souboroÄekáván celoÄíselný argumentneplatné ID procesuje adresářomez pÅ™enosovou rychlost na RYCH bajtů za sekunduselhala alokace vyrovnávací pamÄ›ti pro pozici v řádcíchřádky jsou zakonÄené nulovým znakemselhal pokus o uzamÄenízpráva nepÅ™ijatanepoužívej splice(), vždy použij read/writevyrovnávací paměť není alokovánanení obyÄejný soubor nebo blokové zařízenínení dostupné na systémech bez /proc/self/fdinfooÄekáván Äíselný argumentselhala alokace struktury pro volbyselhala alokace struktury pro argvvypisuj výstup i pokud standardní chybový výstup není terminálvypisuj procenta, ne vizuální informacepo dokonÄení vypiÅ¡ údaje o pÅ™enosupidpÅ™idej JMÉNO pÅ™ed vizuální informaceoÄekáváno ID procesu nebo dvojice PID:DSrychlost min/avg/max/stdrychlost neměřenaÄtení selhaloulož id procesu do SOUBORuselhalo volání selectnastav oÄekávanou velikost dat na VEL bajtůnastav formát výstupu na FORMÃTzobraz ÄŒÃS posledních zapsaných bajtůukaž pÅ™ibližný Äas dokonÄeníukaž průmÄ›rnou rychlost pÅ™enosu datukaž okamžitou rychlost pÅ™enosu datukaž ubÄ›hlý Äasukaž pÅ™ibližný zbývající Äasukaž poÄet pÅ™enesených bitůukaž poÄet pÅ™enesených bajtůukaž procento využité vyrovnávací pamÄ›tiukaž indikátor průbÄ›huukaž pomoc a skonÄiukaž informace o verzi a skonÄipÅ™eskakuj chyby v blocích BAJTů narázignoruj chyby pÅ™i Ätení vstupuchyba pÅ™eskoÄenaselhala alokace stavuzastav po pÅ™enosu --size bajtůzacházej se suffixy jako s násobky 1000 namísto 1024aktualizuj každých SEK sekundaktualizuj nastavení procesu PIDpoužij vyrovnávací pamÄ›t BAJT bajtůpozicuj kurzor pomocí řídících znakůpoužij přímý V/V k obejítí cachevarování: detekovány chyby pÅ™i Ätenísleduj soubor DS otevÅ™ený procesem PIDzapiÅ¡ veÅ¡kerý vstup do SOUBORu pÅ™ed výpisem na výstupzapiÅ¡ ladící záznamy do SOUBORuzápis selhalzapiÅ¡ výstup do SOUBORu namísto standardního výstupuyzafpnum KMGTPEZYyzafpnum kMGTPEZYpv-1.9.31/po/cs.po000066400000000000000000000353141474702661500136370ustar00rootroot00000000000000msgid "" msgstr "" "Report-Msgid-Bugs-To: pv@ivarch.com\n" "POT-Creation-Date: 2025-01-28 21:21+0000\n" "PO-Revision-Date: 2024-10-13 20:43+0000\n" "Last-Translator: mmatous \n" "Language-Team: Czech \n" "Language: cs\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" "X-Generator: Weblate 5.7.2\n" #: src/main/help.c:236 msgid "show progress bar" msgstr "ukaž indikátor průbÄ›hu" #: src/main/help.c:239 msgid "show elapsed time" msgstr "ukaž ubÄ›hlý Äas" #: src/main/help.c:242 msgid "show estimated time of arrival (completion)" msgstr "ukaž pÅ™ibližný zbývající Äas" #: src/main/help.c:245 msgid "show absolute estimated time of arrival (completion)" msgstr "ukaž pÅ™ibližný Äas dokonÄení" #: src/main/help.c:248 msgid "show data transfer rate counter" msgstr "ukaž okamžitou rychlost pÅ™enosu dat" #: src/main/help.c:251 msgid "show data transfer average rate counter" msgstr "ukaž průmÄ›rnou rychlost pÅ™enosu dat" #: src/main/help.c:254 msgid "show number of bytes transferred" msgstr "ukaž poÄet pÅ™enesených bajtů" #: src/main/help.c:257 msgid "show percentage of transfer buffer in use" msgstr "ukaž procento využité vyrovnávací pamÄ›ti" #: src/main/help.c:259 msgid "NUM" msgstr "ÄŒÃS" #: src/main/help.c:260 msgid "show NUM bytes last written" msgstr "zobraz ÄŒÃS posledních zapsaných bajtů" #: src/main/help.c:262 msgid "FORMAT" msgstr "FORMÃT" #: src/main/help.c:263 msgid "set output format to FORMAT" msgstr "nastav formát výstupu na FORMÃT" #: src/main/help.c:266 msgid "output percentages, not visual information" msgstr "vypisuj procenta, ne vizuální informace" #: src/main/help.c:269 msgid "do not output any transfer information at all" msgstr "nevypisuj žádné informace o pÅ™enosu" #: src/main/help.c:273 msgid "show number of bits transferred" msgstr "ukaž poÄet pÅ™enesených bitů" #: src/main/help.c:276 msgid "treat suffixes as multiples of 1000 rather than 1024" msgstr "zacházej se suffixy jako s násobky 1000 namísto 1024" #: src/main/help.c:279 msgid "display nothing until first byte transferred" msgstr "nic nevypisuj, dokud není pÅ™enesen první byte" #: src/main/help.c:281 src/main/help.c:296 src/main/help.c:299 msgid "SEC" msgstr "SEK" #: src/main/help.c:282 msgid "display nothing until SEC seconds have passed" msgstr "nic nevypisuj, dokud neuplyne SEK sekund" #: src/main/help.c:284 msgid "SIZE" msgstr "VEL" #: src/main/help.c:285 msgid "set estimated data size to SIZE bytes" msgstr "nastav oÄekávanou velikost dat na VEL bajtů" #: src/main/help.c:288 msgid "if size unknown, show rate vs max rate" msgstr "pokud je velikost neznámá, ukaž rychlost vs maximální rychlost" #: src/main/help.c:291 msgid "count lines instead of bytes" msgstr "poÄítej řádky místo bajtů" #: src/main/help.c:294 msgid "lines are null-terminated" msgstr "řádky jsou zakonÄené nulovým znakem" #: src/main/help.c:297 msgid "update every SEC seconds" msgstr "aktualizuj každých SEK sekund" #: src/main/help.c:300 msgid "compute average rate over past SEC seconds (default 30s)" msgstr "poÄítej průmÄ›rnou rychlost za posledních SEK sekund (výchozí: 30)" #: src/main/help.c:302 msgid "WIDTH" msgstr "Å ÃŘ" #: src/main/help.c:303 msgid "assume terminal is WIDTH characters wide" msgstr "pÅ™edpokládej šířku terminálu Å ÃŘ znaků" #: src/main/help.c:305 msgid "HEIGHT" msgstr "VÃÅ " #: src/main/help.c:306 msgid "assume terminal is HEIGHT rows high" msgstr "pÅ™edpokládej výšku terminálu VÃÅ  znaků" #: src/main/help.c:308 msgid "NAME" msgstr "JMÉNO" #: src/main/help.c:309 msgid "prefix visual information with NAME" msgstr "pÅ™idej JMÉNO pÅ™ed vizuální informace" #: src/main/help.c:311 msgid "STYLE" msgstr "" #: src/main/help.c:312 msgid "set default bar style to NAME" msgstr "" #: src/main/help.c:314 msgid "SPEC" msgstr "" #: src/main/help.c:315 msgid "also send progress to SPEC" msgstr "" #: src/main/help.c:318 msgid "output transfer statistics at the end" msgstr "po dokonÄení vypiÅ¡ údaje o pÅ™enosu" #: src/main/help.c:321 msgid "output even if standard error is not a terminal" msgstr "vypisuj výstup i pokud standardní chybový výstup není terminál" #: src/main/help.c:324 msgid "use cursor positioning escape sequences" msgstr "pozicuj kurzor pomocí řídících znaků" #: src/main/help.c:327 src/main/help.c:357 src/main/help.c:369 #: src/main/help.c:379 msgid "FILE" msgstr "SOUBOR" #: src/main/help.c:328 msgid "write output to FILE instead of stdout" msgstr "zapiÅ¡ výstup do SOUBORu namísto standardního výstupu" #: src/main/help.c:330 msgid "RATE" msgstr "RYCH" #: src/main/help.c:331 msgid "limit transfer to RATE bytes per second" msgstr "omez pÅ™enosovou rychlost na RYCH bajtů za sekundu" #: src/main/help.c:333 src/main/help.c:342 msgid "BYTES" msgstr "BAJT" #: src/main/help.c:334 msgid "use a buffer size of BYTES" msgstr "použij vyrovnávací pamÄ›t BAJT bajtů" #: src/main/help.c:337 msgid "never use splice(), always use read/write" msgstr "nepoužívej splice(), vždy použij read/write" #: src/main/help.c:340 msgid "skip read errors in input" msgstr "ignoruj chyby pÅ™i Ätení vstupu" #: src/main/help.c:343 msgid "skip errors in BYTES blocks at a time" msgstr "pÅ™eskakuj chyby v blocích BAJTů naráz" #: src/main/help.c:346 msgid "stop after --size bytes have been transferred" msgstr "zastav po pÅ™enosu --size bajtů" #: src/main/help.c:349 msgid "flush cache to disk after every write" msgstr "po každém zápisu vyprázdni cache na disk" #: src/main/help.c:352 msgid "use direct I/O to bypass cache" msgstr "použij přímý V/V k obejítí cache" #: src/main/help.c:355 msgid "discard input instead of writing to output" msgstr "zahoÄ vstup namísto zápisu na výstup" #: src/main/help.c:358 msgid "write all input to FILE before writing to output" msgstr "zapiÅ¡ veÅ¡kerý vstup do SOUBORu pÅ™ed výpisem na výstup" #: src/main/help.c:360 msgid "PID[:FD]" msgstr "PID[:DS]" #: src/main/help.c:361 msgid "watch file FD opened by process PID" msgstr "sleduj soubor DS otevÅ™ený procesem PID" #: src/main/help.c:364 msgid "PID" msgstr "PID" #: src/main/help.c:365 msgid "update settings of process PID" msgstr "aktualizuj nastavení procesu PID" #: src/main/help.c:370 msgid "save process ID in FILE" msgstr "ulož id procesu do SOUBORu" #: src/main/help.c:373 msgid "show this help and exit" msgstr "ukaž pomoc a skonÄi" #: src/main/help.c:376 msgid "show version information and exit" msgstr "ukaž informace o verzi a skonÄi" #: src/main/help.c:380 msgid "write debug logs to FILE" msgstr "zapiÅ¡ ladící záznamy do SOUBORu" #: src/main/help.c:406 #, c-format msgid "Usage: %s [OPTION] [FILE]..." msgstr "Použití: %s [VOLBY] [SOUBOR]..." #: src/main/help.c:417 msgid "" "Concatenate FILE(s), or standard input, to standard output, with monitoring." msgstr "" "Spoj SOUBOR(y) nebo standardní vstup na standardního výstup, s monitoringem." #: src/main/help.c:555 msgid "Supported format sequences:" msgstr "" #: src/main/help.c:569 #, c-format msgid "Please report any bugs to: %s" msgstr "Prosím, hlaÅ¡te veÅ¡keré chyby na: %s" #: src/main/main.c:232 msgid "(input)" msgstr "(vstup)" #: src/main/main.c:328 msgid "state allocation failed" msgstr "selhala alokace stavu" #: src/main/options.c:144 src/pv/file.c:324 msgid "failed to stat file" msgstr "nebylo možné zjistit informace o souboru" #: src/main/options.c:158 msgid "is a directory" msgstr "je adresář" #: src/main/options.c:187 msgid "failed to generate sysfs filename" msgstr "selhalo vytváření jména pro soubor v sysfs" #: src/main/options.c:209 msgid "failed to read sysfs size file" msgstr "selhalo Ätení velikosti souboru v sysfs" #: src/main/options.c:229 msgid "failed to open block device" msgstr "selhalo otevÅ™ení blokového zařízení" #: src/main/options.c:239 msgid "failed to determine size of block device" msgstr "selhalo zjiÅ¡tÄ›ní velikosti blokového zařízení" #: src/main/options.c:345 msgid "option structure allocation failed" msgstr "selhala alokace struktury pro volby" #: src/main/options.c:364 msgid "option structure argv allocation failed" msgstr "selhala alokace struktury pro argv" #: src/main/options.c:417 msgid "numeric value not understood" msgstr "" #: src/main/options.c:435 msgid "integer argument expected" msgstr "oÄekáván celoÄíselný argument" #: src/main/options.c:447 msgid "numeric argument expected" msgstr "oÄekáván Äíselný argument" #: src/main/options.c:458 msgid "process ID or pid:fd pair expected" msgstr "oÄekáváno ID procesu nebo dvojice PID:DS" #: src/main/options.c:465 msgid "invalid process ID" msgstr "neplatné ID procesu" #: src/main/options.c:698 #, c-format msgid "Try `%s --help' for more information." msgstr "Zkuste `%s --help' pro více informací." #: src/main/options.c:700 #, c-format msgid "Try `%s -h' for more information." msgstr "Zkuste `%s --h' pro více informací." #: src/main/options.c:731 msgid "" "cannot use line mode or transfer modifier options when watching file " "descriptors" msgstr "" "pÅ™i sledování deskriptorů souborů nelze použít řádkový mód nebo volby pro " "modifikaci pÅ™enosu" #: src/main/options.c:740 msgid "cannot use cursor positioning when watching file descriptors" msgstr "pÅ™i sledování deskriptorů souborů nelze pozicování kurzoru použít" #: src/main/options.c:749 msgid "cannot use remote control when watching file descriptors" msgstr "pÅ™i sledování deskriptorů souborů nelze použít vzdálené ovládání" #: src/main/options.c:758 msgid "cannot transfer files when watching file descriptors" msgstr "pÅ™i sledování deskriptorů souborů nelze použít pÅ™enos souborů" #: src/main/options.c:773 msgid "not available on systems without /proc/self/fdinfo" msgstr "není dostupné na systémech bez /proc/self/fdinfo" #: src/main/remote.c:309 msgid "message not received" msgstr "zpráva nepÅ™ijata" #: src/main/remote.c:440 msgid "SA_SIGINFO not supported on this system" msgstr "SA_SIGINFO není na tomto systému podporováno" #: src/main/version.c:28 msgid "License: GPLv3+ " msgstr "Licence: GPLv3+ " #: src/main/version.c:29 msgid "This is free software: you are free to change and redistribute it." msgstr "Toto je svobodný software; můžete ho volnÄ› mÄ›nit a šířit." #: src/main/version.c:30 msgid "There is NO WARRANTY, to the extent permitted by law." msgstr "Na program se nevztahuje ŽÃDNà ZÃRUKA, v míře povolené zákonem." #: src/main/version.c:32 msgid "Project web site" msgstr "Stránka projektu" #: src/pv/cursor.c:61 msgid "failed to get terminal name" msgstr "selhalo zjiÅ¡tÄ›ní názvu terminálu" #: src/pv/cursor.c:106 msgid "failed to open lock file" msgstr "selhalo otevÅ™ení zámkového souboru" #: src/pv/cursor.c:139 msgid "lock attempt failed" msgstr "selhal pokus o uzamÄení" #: src/pv/cursor.c:400 msgid "failed to open terminal" msgstr "selhalo otevÅ™ení terminálu" #: src/pv/display.c:249 msgid "yzafpnum kMGTPEZY" msgstr "yzafpnum kMGTPEZY" #: src/pv/display.c:267 msgid "yzafpnum KMGTPEZY" msgstr "yzafpnum KMGTPEZY" #: src/pv/display.c:989 src/pv/transfer.c:1056 msgid "buffer allocation failed" msgstr "selhala alokace vyrovnávací pamÄ›ti" #: src/pv/file.c:149 msgid "failed to seek to start of output" msgstr "selhalo posunutí za zaÄátek výstupu" #: src/pv/file.c:294 msgid "failed to close file" msgstr "selhalo zavÅ™ení souboru" #: src/pv/file.c:317 msgid "failed to read file" msgstr "selhalo Ätení ze souboru" #: src/pv/file.c:332 msgid "failed to stat output file" msgstr "selhalo zjiÅ¡tÄ›ní informací o výstupním souboru" #: src/pv/file.c:354 msgid "input file is output file" msgstr "vstupní soubor je výstupní soubor" #: src/pv/file.c:412 msgid "(none)" msgstr "(žádný)" #: src/pv/file.c:414 msgid "(stdin)" msgstr "(stdin)" #: src/pv/format/averagerate.c:34 src/pv/format/progressbar.c:93 #: src/pv/format/rate.c:37 src/pv/loop.c:551 msgid "b/s" msgstr "b/s" #: src/pv/format/averagerate.c:38 src/pv/format/progressbar.c:97 #: src/pv/format/rate.c:41 msgid "/s" msgstr "/s" #: src/pv/format/averagerate.c:38 src/pv/format/progressbar.c:97 #: src/pv/format/rate.c:41 src/pv/loop.c:551 msgid "B/s" msgstr "B/s" #: src/pv/format/bytes.c:37 msgid "b" msgstr "b" #: src/pv/format/bytes.c:41 src/pv/transfer.c:594 msgid "B" msgstr "B" #: src/pv/format/eta.c:53 src/pv/format/eta.c:57 msgid "ETA" msgstr "ETA" #: src/pv/format/fineta.c:81 msgid "FIN" msgstr "FIN" #: src/pv/loop.c:550 msgid "rate min/avg/max/mdev" msgstr "rychlost min/avg/max/std" #: src/pv/loop.c:562 msgid "rate not measured" msgstr "rychlost neměřena" #: src/pv/loop.c:772 src/pv/loop.c:823 src/pv/loop.c:876 src/pv/watchpid.c:99 #: src/pv/watchpid.c:109 src/pv/watchpid.c:120 src/pv/watchpid.c:128 #: src/pv/watchpid.c:165 src/pv/watchpid.c:184 src/pv/watchpid.c:192 #: src/pv/watchpid.c:202 src/pv/watchpid.c:300 src/pv/watchpid.c:308 #: src/pv/watchpid.c:385 src/pv/watchpid.c:406 msgid "pid" msgstr "pid" #: src/pv/state.c:40 msgid "history structure allocation failed" msgstr "selhala alokace struktury historie" #: src/pv/state.c:617 src/pv/state.c:628 msgid "file list allocation failed" msgstr "selhala alokace seznamu souborů" #: src/pv/transfer.c:463 msgid "read failed" msgstr "Ätení selhalo" #: src/pv/transfer.c:479 msgid "warning: read errors detected" msgstr "varování: detekovány chyby pÅ™i Ätení" #: src/pv/transfer.c:495 msgid "file is not seekable" msgstr "souborem nelze procházet" #: src/pv/transfer.c:573 msgid "failed to seek past error" msgstr "selhal skok za chybu" #: src/pv/transfer.c:593 msgid "skipped past read error" msgstr "chyba pÅ™eskoÄena" #: src/pv/transfer.c:634 msgid "no transfer buffer allocated" msgstr "vyrovnávací paměť není alokována" #: src/pv/transfer.c:676 msgid "failed to set interval timer" msgstr "selhalo nastavení intervalového ÄasovaÄe" #: src/pv/transfer.c:702 msgid "failed to clear interval timer" msgstr "selhalo vynulování intervalového ÄasovaÄe" #: src/pv/transfer.c:744 msgid "line position buffer allocation failed" msgstr "selhala alokace vyrovnávací pamÄ›ti pro pozici v řádcích" #: src/pv/transfer.c:917 msgid "write failed" msgstr "zápis selhal" #: src/pv/transfer.c:1154 msgid "select call failed" msgstr "selhalo volání select" #: src/pv/watchpid.c:109 src/pv/watchpid.c:121 src/pv/watchpid.c:130 #: src/pv/watchpid.c:184 src/pv/watchpid.c:193 src/pv/watchpid.c:204 msgid "fd" msgstr "ds" #: src/pv/watchpid.c:130 src/pv/watchpid.c:204 msgid "not a regular file or block device" msgstr "není obyÄejný soubor nebo blokové zařízení" pv-1.9.31/po/de.gmo000066400000000000000000000307371474702661500137720ustar00rootroot00000000000000Þ•…D³l8 9 A H P S U Y L_ ¬ ° µ ¹ À ;Ç      7 H 'M u y ~ ƒ ‰ 5¥ BÛ % !D f ƒ ‰ #¤ (È ñ ó ÷ 4<EP‚8Ó8 E*b-,»-è5(J!s•±Íæþ1!KmŠž¹¼Ñ%í#&7^x’¥'´&Ü1)Fp"2°ãý"'=/e*•%Àæ#ê"1G Ye}%®Ôð4 'Ai‰+›Ç ç)2D!\%~¤¾Ö-î4Qj‰'¤Ìë# 0-^ w&„«½Ï âìôüÿl x|‚Š‘:—Ò×Ûß%è  4# X \ e j o @† HÇ +!',.[,)Š,"´,-×,:--@-n--(¬-'Õ-(ý-B&.i.~.&›.)Â.(ì.&/-gMXh7Fz~L)W{%mR4U 2Ib[€a(to(input)(none)(stdin)/sBB/sBYTESConcatenate FILE(s), or standard input, to standard output, with monitoring.ETAFILEFINFORMATHEIGHTLicense: GPLv3+ NAMENUMPIDPID[:FD]Please report any bugs to: %sProject web siteRATESA_SIGINFO not supported on this systemSECSIZESPECSTYLESupported format sequences:There is NO WARRANTY, to the extent permitted by law.This is free software: you are free to change and redistribute it.Try `%s --help' for more information.Try `%s -h' for more information.Usage: %s [OPTION] [FILE]...WIDTHalso send progress to SPECassume terminal is HEIGHT rows highassume terminal is WIDTH characters widebb/sbuffer allocation failedcannot transfer files when watching file descriptorscannot use cursor positioning when watching file descriptorscannot use line mode or transfer modifier options when watching file descriptorscannot use remote control when watching file descriptorscompute average rate over past SEC seconds (default 30s)count lines instead of bytesdiscard input instead of writing to outputdisplay nothing until SEC seconds have passeddisplay nothing until first byte transferreddo not output any transfer information at allfailed to clear interval timerfailed to close filefailed to determine size of block devicefailed to generate sysfs filenamefailed to get terminal namefailed to open block devicefailed to open lock filefailed to open terminalfailed to read filefailed to read sysfs size filefailed to seek past errorfailed to seek to start of outputfailed to set interval timerfailed to stat filefailed to stat output filefdfile is not seekablefile list allocation failedflush cache to disk after every writehistory structure allocation failedif size unknown, show rate vs max rateinput file is output fileinteger argument expectedinvalid process IDis a directorylimit transfer to RATE bytes per secondline position buffer allocation failedlines are null-terminatedlock attempt failedmessage not receivednever use splice(), always use read/writeno transfer buffer allocatednot a regular file or block devicenot available on systems without /proc/self/fdinfonumeric argument expectednumeric value not understoodoption structure allocation failedoption structure argv allocation failedoutput even if standard error is not a terminaloutput percentages, not visual informationoutput transfer statistics at the endpidprefix visual information with NAMEprocess ID or pid:fd pair expectedrate min/avg/max/mdevrate not measuredread failedsave process ID in FILEselect call failedset default bar style to NAMEset estimated data size to SIZE bytesset output format to FORMATshow NUM bytes last writtenshow absolute estimated time of arrival (completion)show data transfer average rate countershow data transfer rate countershow elapsed timeshow estimated time of arrival (completion)show number of bits transferredshow number of bytes transferredshow percentage of transfer buffer in useshow progress barshow this help and exitshow version information and exitskip errors in BYTES blocks at a timeskip read errors in inputskipped past read errorstate allocation failedstop after --size bytes have been transferredtreat suffixes as multiples of 1000 rather than 1024update every SEC secondsupdate settings of process PIDuse a buffer size of BYTESuse cursor positioning escape sequencesuse direct I/O to bypass cachewarning: read errors detectedwatch file FD opened by process PIDwrite all input to FILE before writing to outputwrite debug logs to FILEwrite failedwrite output to FILE instead of stdoutyzafpnum KMGTPEZYyzafpnum kMGTPEZYReport-Msgid-Bugs-To: pv@ivarch.com PO-Revision-Date: 2025-01-14 20:39+0000 Last-Translator: Benny Language-Team: German Language: de Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=n != 1; X-Generator: Weblate 5.9.2 Date: 1999-06-01 15:18:29+0100 From: Andrew Wood Xgettext-Options: --default-domain=pkgbuild --directory=./.pkgdir --add-comments --keyword=_ --keyword=N_ Files: src/getopt/getopt.c src/getopt/getopt1.c src/version.c src/main/init.c src/main/help.c src/main/xpmptr.c src/guts/load.c src/guts/stop.c src/guts/configure.c src/guts/make.c src/guts/install.c src/guts/prefs.c src/ui/generate.c src/ui/main.c src/ui/xpm.c src/ui/status.c src/ui/activate.c src/ui/handlers/main.c src/ui/handlers/package.c src/ui/handlers/prefs.c src/ui/handlers/dirsel.c src/ui/handlers/popup.c src/ui/handlers/help.c src/ui/textout.c src/ui/report.c src/ui/callback.c src/nls/intl/bindtextdom.c src/nls/intl/dcgettext.c src/nls/intl/dgettext.c src/nls/intl/finddomain.c src/nls/intl/gettext.c src/nls/intl/loadmsgcat.c src/nls/intl/localealias.c src/nls/intl/textdomain.c src/nls/intl-cat/cat-compat.c src/nls/intl-gett/intl-compat.c (eingabe)(keine)(stdin)/sBB/sBYTESVerbindet DATEI(en) oder den Standard-Eingabe-Kanal mit dem Standard-Ausgabe-Kanal und misst den Datenstrom.ETADATEIEndzeitFORMATHÖHELizenz: GPLv3+ NAMENUMPIDPID[:FD]Bitte senden Sie Fehlerberichte an %sProjekt-WebsiteRATESA_SIGINFO wird auf diesem System nicht unterstütztSEKGRÖẞESTILStilunterstützte Formate:Es besteht KEINE GARANTIE, soweit dies gesetzlich zulässig ist.Dies ist freie Software: Sie dürfen sie verändern und weiterverteilen.`%s --help' zeigt weitere Informationen an.`%s -h' zeigt weitere Informationen an.Aufruf: %s [OPTION] [DATEI]...BREITEFortschritt auch an SPEC sendensetze Terminal-Höhe auf HÖHE Zeichensetze Terminal-Breite auf BREITE Zeichenbb/sSpeicherzuweisung für den Puffer fehlgeschlagenBeim Beobachten von Dateideskriptoren können Dateien nicht übertragen werdenBeim Beobachten von Dateideskriptoren kann Cursor-Positionierung nicht verwendet werdenBeim Beobachten von Dateideskriptoren können keine Optionen für den Zeilenmodus oder den Übertragungsmodifikator verwendet werdenBeim Beobachten von Dateideskriptoren kann die Fernbedienung nicht verwenden werdenberechne die durchschnittliche Übertragungsrate über die letzten SEK Sekunden (Standard 30s)zähle Zeilen anstelle von Bytesverwirf die Eingabe anstatt in die Ausgabe zu schreibennichts anzeigen ehe SEK Sekunden vergangen sindkeine Ausgabe bevor das erste Byte übertragen wurdesämtliche Transferinformationen unterdrückenkonnte Intervall-Timer nicht löschenkonnte Datei nicht schließenkonnte Größe des Blockgeräts nicht ermittelnkonnte Sysfs-Dateinamen nicht erzeugenkonnte Terminalname nicht lesenkonnte Blockgerät nicht öffnenkonnte Sperrdatei nicht öffnenkonnte Terminal nicht öffnenkonnte Datei nicht lesenkonnte Größe der Sysfs-Datei nicht lesenkonnte den Fehler nicht überwindenKonnte nicht zum Anfang der Ausgabe springenkonnte Intervall-Timer nicht setzenkonnte Dateiinformationen nicht lesenkonnte Dateiinformationen für Ausgabe-Datei nicht lesenfdDatei ist nicht durchsuchbarSpeicherzuweisung für die Dateiliste fehlgeschlagenschreibe den Cache nach jedem Schreibvorgang auf die FestplatteSpeicherzuweisung für `history' fehlgeschlagenzeige Rate vs maximale Rate, falls die größe unbekannt istEingabe-Datei ist Ausgabe-DateiGanzzahliges Argument erwartetungültige Prozess-IDist ein Verzeichnisbeschränke die Transferrate auf RATE Byte pro SekundeZuweisung des Zeilenpuffers fehlgeschlagenZeilen sind nullterminiertSperrversuch fehlgeschlagenNachricht nicht empfangenanstelle von splice() immer read/write benutzenSpeicherzuweisung für den Transferpuffer fehlgeschlagenist weder eine normale Datei noch ein BlockgerätNicht verfügbar auf Systemen ohne /proc/self/fdinfonumerisches Argument erwartetnumerischen Wert nicht verstandenSpeicherzuweisung für `option' fehlgeschlagenSpeicherzuweisung für `argv' der Option fehlgeschlagenAusgabe auch dann erzwingen, wenn der Fehlerausgabe-Kanal kein Terminal istAusgabe von Prozent-Angaben statt visueller DarstellungÜbertragungsstatistiken am Ende ausgebenpidsetze den NAMEn für visuelle DarstellungProzess-ID oder PID:FD-Paar erwartetRate min/mittel/max/abweichungÜbertragungsrate nicht gemessenread-Aufruf fehlgeschlagenProzess-ID in DATEI speichernselect-Aufruf fehlgeschlagensetze die voreingestellte Darstellung auf NAMEsetze erwartete Datenlänge auf SIZE Bytesetze das Ausgabeformat auf FORMATNUM zeige die zuletzt geschriebenen NUM Byteszeige die absolute geschätzte Zeit bis zur Fertigstellungzeige die durchschnittliche Übertragungsratezeige die Datentransferrate anzeige die verstrichene Zeit anzeige die erwartete Zeit bis zum Ende anzeige die Anzahl der übertragenen Bitszeige die Anzahl der übertragenen Byteszeige, wie viel Prozent des Übertragungsbuffers in Benutzung sindFortschritts-Anzeigezeige diese Hilfe und beendezeige Versionsinformationen und beendebei Fehlern BYTES am Stück überspringenLesefehler in der Eingabe nicht beachtenüber den Lesefehler hinaus verschobenSpeicherzuweisung für `state' fehlgeschlagenanhalten, nachdem --size Bytes übertragen wurdenbehandle Endungen als Vielfache von 1000 statt von 1024aktualisiere Ausgabe nach SEK Sekunden IntervallEinstellungen der Prozess-PID updatenbenutze einen Puffer in der Größe von BYTESbenutze Escape-Sequenzen zur Cursor-Positionierungverwende direkte E/A, um den Cache zu umgehenwarnung: lesefehler erkanntdie vom Prozess PID geöffnete Datei FD beobachtenAusgabe nach FILE schrieben bevor sie ausgegeben wirdschreibe Debug-Protokolle in DATEIwrite-Aufruf fehlgeschlagenschreibe die Ausgabe in DATEI statt in die Standardausgabeyzafpnµm KMGTPEZYyzafpnµm kMGTPEZYpv-1.9.31/po/de.po000066400000000000000000000402611474702661500136170ustar00rootroot00000000000000msgid "" msgstr "" "Report-Msgid-Bugs-To: pv@ivarch.com\n" "POT-Creation-Date: 2025-01-28 21:21+0000\n" "PO-Revision-Date: 2025-01-14 20:39+0000\n" "Last-Translator: Benny \n" "Language-Team: German \n" "Language: de\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" "X-Generator: Weblate 5.9.2\n" "Date: 1999-06-01 15:18:29+0100\n" "From: Andrew Wood \n" "Xgettext-Options: --default-domain=pkgbuild --directory=./.pkgdir --add-" "comments --keyword=_ --keyword=N_\n" "Files: src/getopt/getopt.c src/getopt/getopt1.c src/version.c src/main/init." "c src/main/help.c src/main/xpmptr.c src/guts/load.c src/guts/stop.c src/guts/" "configure.c src/guts/make.c src/guts/install.c src/guts/prefs.c src/ui/" "generate.c src/ui/main.c src/ui/xpm.c src/ui/status.c src/ui/activate.c src/" "ui/handlers/main.c src/ui/handlers/package.c src/ui/handlers/prefs.c src/ui/" "handlers/dirsel.c src/ui/handlers/popup.c src/ui/handlers/help.c src/ui/" "textout.c src/ui/report.c src/ui/callback.c src/nls/intl/bindtextdom.c src/" "nls/intl/dcgettext.c src/nls/intl/dgettext.c src/nls/intl/finddomain.c src/" "nls/intl/gettext.c src/nls/intl/loadmsgcat.c src/nls/intl/localealias.c src/" "nls/intl/textdomain.c src/nls/intl-cat/cat-compat.c src/nls/intl-gett/intl-" "compat.c\n" #: src/main/help.c:236 msgid "show progress bar" msgstr "Fortschritts-Anzeige" #: src/main/help.c:239 msgid "show elapsed time" msgstr "zeige die verstrichene Zeit an" #: src/main/help.c:242 msgid "show estimated time of arrival (completion)" msgstr "zeige die erwartete Zeit bis zum Ende an" #: src/main/help.c:245 msgid "show absolute estimated time of arrival (completion)" msgstr "zeige die absolute geschätzte Zeit bis zur Fertigstellung" #: src/main/help.c:248 msgid "show data transfer rate counter" msgstr "zeige die Datentransferrate an" #: src/main/help.c:251 msgid "show data transfer average rate counter" msgstr "zeige die durchschnittliche Übertragungsrate" #: src/main/help.c:254 msgid "show number of bytes transferred" msgstr "zeige die Anzahl der übertragenen Bytes" #: src/main/help.c:257 msgid "show percentage of transfer buffer in use" msgstr "zeige, wie viel Prozent des Übertragungsbuffers in Benutzung sind" #: src/main/help.c:259 msgid "NUM" msgstr "NUM" #: src/main/help.c:260 msgid "show NUM bytes last written" msgstr "NUM zeige die zuletzt geschriebenen NUM Bytes" #: src/main/help.c:262 msgid "FORMAT" msgstr "FORMAT" #: src/main/help.c:263 msgid "set output format to FORMAT" msgstr "setze das Ausgabeformat auf FORMAT" #: src/main/help.c:266 msgid "output percentages, not visual information" msgstr "Ausgabe von Prozent-Angaben statt visueller Darstellung" #: src/main/help.c:269 msgid "do not output any transfer information at all" msgstr "sämtliche Transferinformationen unterdrücken" #: src/main/help.c:273 msgid "show number of bits transferred" msgstr "zeige die Anzahl der übertragenen Bits" #: src/main/help.c:276 msgid "treat suffixes as multiples of 1000 rather than 1024" msgstr "behandle Endungen als Vielfache von 1000 statt von 1024" #: src/main/help.c:279 msgid "display nothing until first byte transferred" msgstr "keine Ausgabe bevor das erste Byte übertragen wurde" #: src/main/help.c:281 src/main/help.c:296 src/main/help.c:299 msgid "SEC" msgstr "SEK" #: src/main/help.c:282 msgid "display nothing until SEC seconds have passed" msgstr "nichts anzeigen ehe SEK Sekunden vergangen sind" #: src/main/help.c:284 msgid "SIZE" msgstr "GRÖẞE" #: src/main/help.c:285 msgid "set estimated data size to SIZE bytes" msgstr "setze erwartete Datenlänge auf SIZE Byte" #: src/main/help.c:288 msgid "if size unknown, show rate vs max rate" msgstr "zeige Rate vs maximale Rate, falls die größe unbekannt ist" #: src/main/help.c:291 msgid "count lines instead of bytes" msgstr "zähle Zeilen anstelle von Bytes" #: src/main/help.c:294 msgid "lines are null-terminated" msgstr "Zeilen sind nullterminiert" #: src/main/help.c:297 msgid "update every SEC seconds" msgstr "aktualisiere Ausgabe nach SEK Sekunden Intervall" #: src/main/help.c:300 msgid "compute average rate over past SEC seconds (default 30s)" msgstr "" "berechne die durchschnittliche Übertragungsrate über die letzten SEK " "Sekunden (Standard 30s)" #: src/main/help.c:302 msgid "WIDTH" msgstr "BREITE" #: src/main/help.c:303 msgid "assume terminal is WIDTH characters wide" msgstr "setze Terminal-Breite auf BREITE Zeichen" #: src/main/help.c:305 msgid "HEIGHT" msgstr "HÖHE" #: src/main/help.c:306 msgid "assume terminal is HEIGHT rows high" msgstr "setze Terminal-Höhe auf HÖHE Zeichen" #: src/main/help.c:308 msgid "NAME" msgstr "NAME" #: src/main/help.c:309 msgid "prefix visual information with NAME" msgstr "setze den NAMEn für visuelle Darstellung" #: src/main/help.c:311 msgid "STYLE" msgstr "Stil" #: src/main/help.c:312 msgid "set default bar style to NAME" msgstr "setze die voreingestellte Darstellung auf NAME" #: src/main/help.c:314 msgid "SPEC" msgstr "STIL" #: src/main/help.c:315 msgid "also send progress to SPEC" msgstr "Fortschritt auch an SPEC senden" #: src/main/help.c:318 msgid "output transfer statistics at the end" msgstr "Übertragungsstatistiken am Ende ausgeben" #: src/main/help.c:321 msgid "output even if standard error is not a terminal" msgstr "" "Ausgabe auch dann erzwingen, wenn der Fehlerausgabe-Kanal kein Terminal ist" #: src/main/help.c:324 msgid "use cursor positioning escape sequences" msgstr "benutze Escape-Sequenzen zur Cursor-Positionierung" #: src/main/help.c:327 src/main/help.c:357 src/main/help.c:369 #: src/main/help.c:379 msgid "FILE" msgstr "DATEI" #: src/main/help.c:328 msgid "write output to FILE instead of stdout" msgstr "schreibe die Ausgabe in DATEI statt in die Standardausgabe" #: src/main/help.c:330 msgid "RATE" msgstr "RATE" #: src/main/help.c:331 msgid "limit transfer to RATE bytes per second" msgstr "beschränke die Transferrate auf RATE Byte pro Sekunde" #: src/main/help.c:333 src/main/help.c:342 msgid "BYTES" msgstr "BYTES" #: src/main/help.c:334 msgid "use a buffer size of BYTES" msgstr "benutze einen Puffer in der Größe von BYTES" #: src/main/help.c:337 msgid "never use splice(), always use read/write" msgstr "anstelle von splice() immer read/write benutzen" #: src/main/help.c:340 msgid "skip read errors in input" msgstr "Lesefehler in der Eingabe nicht beachten" #: src/main/help.c:343 msgid "skip errors in BYTES blocks at a time" msgstr "bei Fehlern BYTES am Stück überspringen" #: src/main/help.c:346 msgid "stop after --size bytes have been transferred" msgstr "anhalten, nachdem --size Bytes übertragen wurden" #: src/main/help.c:349 msgid "flush cache to disk after every write" msgstr "schreibe den Cache nach jedem Schreibvorgang auf die Festplatte" #: src/main/help.c:352 msgid "use direct I/O to bypass cache" msgstr "verwende direkte E/A, um den Cache zu umgehen" #: src/main/help.c:355 msgid "discard input instead of writing to output" msgstr "verwirf die Eingabe anstatt in die Ausgabe zu schreiben" #: src/main/help.c:358 msgid "write all input to FILE before writing to output" msgstr "Ausgabe nach FILE schrieben bevor sie ausgegeben wird" #: src/main/help.c:360 msgid "PID[:FD]" msgstr "PID[:FD]" #: src/main/help.c:361 msgid "watch file FD opened by process PID" msgstr "die vom Prozess PID geöffnete Datei FD beobachten" #: src/main/help.c:364 msgid "PID" msgstr "PID" #: src/main/help.c:365 msgid "update settings of process PID" msgstr "Einstellungen der Prozess-PID updaten" #: src/main/help.c:370 msgid "save process ID in FILE" msgstr "Prozess-ID in DATEI speichern" #: src/main/help.c:373 msgid "show this help and exit" msgstr "zeige diese Hilfe und beende" #: src/main/help.c:376 msgid "show version information and exit" msgstr "zeige Versionsinformationen und beende" #: src/main/help.c:380 msgid "write debug logs to FILE" msgstr "schreibe Debug-Protokolle in DATEI" #: src/main/help.c:406 #, c-format msgid "Usage: %s [OPTION] [FILE]..." msgstr "Aufruf: %s [OPTION] [DATEI]..." #: src/main/help.c:417 msgid "" "Concatenate FILE(s), or standard input, to standard output, with monitoring." msgstr "" "Verbindet DATEI(en) oder den Standard-Eingabe-Kanal mit dem Standard-Ausgabe-" "Kanal und misst den Datenstrom." #: src/main/help.c:555 msgid "Supported format sequences:" msgstr "unterstützte Formate:" #: src/main/help.c:569 #, c-format msgid "Please report any bugs to: %s" msgstr "Bitte senden Sie Fehlerberichte an %s" #: src/main/main.c:232 msgid "(input)" msgstr "(eingabe)" #: src/main/main.c:328 msgid "state allocation failed" msgstr "Speicherzuweisung für `state' fehlgeschlagen" #: src/main/options.c:144 src/pv/file.c:324 msgid "failed to stat file" msgstr "konnte Dateiinformationen nicht lesen" #: src/main/options.c:158 msgid "is a directory" msgstr "ist ein Verzeichnis" #: src/main/options.c:187 msgid "failed to generate sysfs filename" msgstr "konnte Sysfs-Dateinamen nicht erzeugen" #: src/main/options.c:209 msgid "failed to read sysfs size file" msgstr "konnte Größe der Sysfs-Datei nicht lesen" #: src/main/options.c:229 msgid "failed to open block device" msgstr "konnte Blockgerät nicht öffnen" #: src/main/options.c:239 msgid "failed to determine size of block device" msgstr "konnte Größe des Blockgeräts nicht ermitteln" #: src/main/options.c:345 msgid "option structure allocation failed" msgstr "Speicherzuweisung für `option' fehlgeschlagen" #: src/main/options.c:364 msgid "option structure argv allocation failed" msgstr "Speicherzuweisung für `argv' der Option fehlgeschlagen" #: src/main/options.c:417 msgid "numeric value not understood" msgstr "numerischen Wert nicht verstanden" #: src/main/options.c:435 msgid "integer argument expected" msgstr "Ganzzahliges Argument erwartet" #: src/main/options.c:447 msgid "numeric argument expected" msgstr "numerisches Argument erwartet" #: src/main/options.c:458 msgid "process ID or pid:fd pair expected" msgstr "Prozess-ID oder PID:FD-Paar erwartet" #: src/main/options.c:465 msgid "invalid process ID" msgstr "ungültige Prozess-ID" #: src/main/options.c:698 #, c-format msgid "Try `%s --help' for more information." msgstr "`%s --help' zeigt weitere Informationen an." #: src/main/options.c:700 #, c-format msgid "Try `%s -h' for more information." msgstr "`%s -h' zeigt weitere Informationen an." #: src/main/options.c:731 msgid "" "cannot use line mode or transfer modifier options when watching file " "descriptors" msgstr "" "Beim Beobachten von Dateideskriptoren können keine Optionen für den " "Zeilenmodus oder den Übertragungsmodifikator verwendet werden" #: src/main/options.c:740 msgid "cannot use cursor positioning when watching file descriptors" msgstr "" "Beim Beobachten von Dateideskriptoren kann Cursor-Positionierung nicht " "verwendet werden" #: src/main/options.c:749 msgid "cannot use remote control when watching file descriptors" msgstr "" "Beim Beobachten von Dateideskriptoren kann die Fernbedienung nicht verwenden " "werden" #: src/main/options.c:758 msgid "cannot transfer files when watching file descriptors" msgstr "" "Beim Beobachten von Dateideskriptoren können Dateien nicht übertragen werden" #: src/main/options.c:773 msgid "not available on systems without /proc/self/fdinfo" msgstr "Nicht verfügbar auf Systemen ohne /proc/self/fdinfo" #: src/main/remote.c:309 msgid "message not received" msgstr "Nachricht nicht empfangen" #: src/main/remote.c:440 msgid "SA_SIGINFO not supported on this system" msgstr "SA_SIGINFO wird auf diesem System nicht unterstützt" #: src/main/version.c:28 msgid "License: GPLv3+ " msgstr "Lizenz: GPLv3+ " #: src/main/version.c:29 msgid "This is free software: you are free to change and redistribute it." msgstr "Dies ist freie Software: Sie dürfen sie verändern und weiterverteilen." #: src/main/version.c:30 msgid "There is NO WARRANTY, to the extent permitted by law." msgstr "Es besteht KEINE GARANTIE, soweit dies gesetzlich zulässig ist." #: src/main/version.c:32 msgid "Project web site" msgstr "Projekt-Website" #: src/pv/cursor.c:61 msgid "failed to get terminal name" msgstr "konnte Terminalname nicht lesen" #: src/pv/cursor.c:106 msgid "failed to open lock file" msgstr "konnte Sperrdatei nicht öffnen" #: src/pv/cursor.c:139 msgid "lock attempt failed" msgstr "Sperrversuch fehlgeschlagen" #: src/pv/cursor.c:400 msgid "failed to open terminal" msgstr "konnte Terminal nicht öffnen" #: src/pv/display.c:249 msgid "yzafpnum kMGTPEZY" msgstr "yzafpnµm kMGTPEZY" #: src/pv/display.c:267 msgid "yzafpnum KMGTPEZY" msgstr "yzafpnµm KMGTPEZY" #: src/pv/display.c:989 src/pv/transfer.c:1056 msgid "buffer allocation failed" msgstr "Speicherzuweisung für den Puffer fehlgeschlagen" #: src/pv/file.c:149 msgid "failed to seek to start of output" msgstr "Konnte nicht zum Anfang der Ausgabe springen" #: src/pv/file.c:294 msgid "failed to close file" msgstr "konnte Datei nicht schließen" #: src/pv/file.c:317 msgid "failed to read file" msgstr "konnte Datei nicht lesen" #: src/pv/file.c:332 msgid "failed to stat output file" msgstr "konnte Dateiinformationen für Ausgabe-Datei nicht lesen" #: src/pv/file.c:354 msgid "input file is output file" msgstr "Eingabe-Datei ist Ausgabe-Datei" #: src/pv/file.c:412 msgid "(none)" msgstr "(keine)" #: src/pv/file.c:414 msgid "(stdin)" msgstr "(stdin)" #: src/pv/format/averagerate.c:34 src/pv/format/progressbar.c:93 #: src/pv/format/rate.c:37 src/pv/loop.c:551 msgid "b/s" msgstr "b/s" #: src/pv/format/averagerate.c:38 src/pv/format/progressbar.c:97 #: src/pv/format/rate.c:41 msgid "/s" msgstr "/s" #: src/pv/format/averagerate.c:38 src/pv/format/progressbar.c:97 #: src/pv/format/rate.c:41 src/pv/loop.c:551 msgid "B/s" msgstr "B/s" #: src/pv/format/bytes.c:37 msgid "b" msgstr "b" #: src/pv/format/bytes.c:41 src/pv/transfer.c:594 msgid "B" msgstr "B" #: src/pv/format/eta.c:53 src/pv/format/eta.c:57 msgid "ETA" msgstr "ETA" #: src/pv/format/fineta.c:81 msgid "FIN" msgstr "Endzeit" #: src/pv/loop.c:550 msgid "rate min/avg/max/mdev" msgstr "Rate min/mittel/max/abweichung" #: src/pv/loop.c:562 msgid "rate not measured" msgstr "Übertragungsrate nicht gemessen" #: src/pv/loop.c:772 src/pv/loop.c:823 src/pv/loop.c:876 src/pv/watchpid.c:99 #: src/pv/watchpid.c:109 src/pv/watchpid.c:120 src/pv/watchpid.c:128 #: src/pv/watchpid.c:165 src/pv/watchpid.c:184 src/pv/watchpid.c:192 #: src/pv/watchpid.c:202 src/pv/watchpid.c:300 src/pv/watchpid.c:308 #: src/pv/watchpid.c:385 src/pv/watchpid.c:406 msgid "pid" msgstr "pid" #: src/pv/state.c:40 msgid "history structure allocation failed" msgstr "Speicherzuweisung für `history' fehlgeschlagen" #: src/pv/state.c:617 src/pv/state.c:628 msgid "file list allocation failed" msgstr "Speicherzuweisung für die Dateiliste fehlgeschlagen" #: src/pv/transfer.c:463 msgid "read failed" msgstr "read-Aufruf fehlgeschlagen" #: src/pv/transfer.c:479 msgid "warning: read errors detected" msgstr "warnung: lesefehler erkannt" #: src/pv/transfer.c:495 msgid "file is not seekable" msgstr "Datei ist nicht durchsuchbar" #: src/pv/transfer.c:573 msgid "failed to seek past error" msgstr "konnte den Fehler nicht überwinden" #: src/pv/transfer.c:593 msgid "skipped past read error" msgstr "über den Lesefehler hinaus verschoben" #: src/pv/transfer.c:634 msgid "no transfer buffer allocated" msgstr "Speicherzuweisung für den Transferpuffer fehlgeschlagen" #: src/pv/transfer.c:676 msgid "failed to set interval timer" msgstr "konnte Intervall-Timer nicht setzen" #: src/pv/transfer.c:702 msgid "failed to clear interval timer" msgstr "konnte Intervall-Timer nicht löschen" #: src/pv/transfer.c:744 msgid "line position buffer allocation failed" msgstr "Zuweisung des Zeilenpuffers fehlgeschlagen" #: src/pv/transfer.c:917 msgid "write failed" msgstr "write-Aufruf fehlgeschlagen" #: src/pv/transfer.c:1154 msgid "select call failed" msgstr "select-Aufruf fehlgeschlagen" #: src/pv/watchpid.c:109 src/pv/watchpid.c:121 src/pv/watchpid.c:130 #: src/pv/watchpid.c:184 src/pv/watchpid.c:193 src/pv/watchpid.c:204 msgid "fd" msgstr "fd" #: src/pv/watchpid.c:130 src/pv/watchpid.c:204 msgid "not a regular file or block device" msgstr "ist weder eine normale Datei noch ein Blockgerät" pv-1.9.31/po/en@boldquot.header000066400000000000000000000024721474702661500163170ustar00rootroot00000000000000# All this catalog "translates" are quotation characters. # The msgids must be ASCII and therefore cannot contain real quotation # characters, only substitutes like grave accent (0x60), apostrophe (0x27) # and double quote (0x22). These substitutes look strange; see # https://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html # # This catalog translates grave accent (0x60) and apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019). # It also translates pairs of apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019) # and pairs of quotation mark (0x22) to # left double quotation mark (U+201C) and right double quotation mark (U+201D). # # When output to an UTF-8 terminal, the quotation characters appear perfectly. # When output to an ISO-8859-1 terminal, the single quotation marks are # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to # grave/acute accent (by libiconv), and the double quotation marks are # transliterated to 0x22. # When output to an ASCII terminal, the single quotation marks are # transliterated to apostrophes, and the double quotation marks are # transliterated to 0x22. # # This catalog furthermore displays the text between the quotation marks in # bold face, assuming the VT100/XTerm escape sequences. # pv-1.9.31/po/en@quot.header000066400000000000000000000022641474702661500154550ustar00rootroot00000000000000# All this catalog "translates" are quotation characters. # The msgids must be ASCII and therefore cannot contain real quotation # characters, only substitutes like grave accent (0x60), apostrophe (0x27) # and double quote (0x22). These substitutes look strange; see # https://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html # # This catalog translates grave accent (0x60) and apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019). # It also translates pairs of apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019) # and pairs of quotation mark (0x22) to # left double quotation mark (U+201C) and right double quotation mark (U+201D). # # When output to an UTF-8 terminal, the quotation characters appear perfectly. # When output to an ISO-8859-1 terminal, the single quotation marks are # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to # grave/acute accent (by libiconv), and the double quotation marks are # transliterated to 0x22. # When output to an ASCII terminal, the single quotation marks are # transliterated to apostrophes, and the double quotation marks are # transliterated to 0x22. # pv-1.9.31/po/es.gmo000066400000000000000000000003051474702661500137750ustar00rootroot00000000000000Þ•$,8‹9Report-Msgid-Bugs-To: pv@ivarch.com Language: es MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit pv-1.9.31/po/es.po000066400000000000000000000245141474702661500136410ustar00rootroot00000000000000msgid "" msgstr "" "Report-Msgid-Bugs-To: pv@ivarch.com\n" "POT-Creation-Date: 2025-01-28 21:21+0000\n" "Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: src/main/help.c:236 msgid "show progress bar" msgstr "" #: src/main/help.c:239 msgid "show elapsed time" msgstr "" #: src/main/help.c:242 msgid "show estimated time of arrival (completion)" msgstr "" #: src/main/help.c:245 msgid "show absolute estimated time of arrival (completion)" msgstr "" #: src/main/help.c:248 msgid "show data transfer rate counter" msgstr "" #: src/main/help.c:251 msgid "show data transfer average rate counter" msgstr "" #: src/main/help.c:254 msgid "show number of bytes transferred" msgstr "" #: src/main/help.c:257 msgid "show percentage of transfer buffer in use" msgstr "" #: src/main/help.c:259 msgid "NUM" msgstr "" #: src/main/help.c:260 msgid "show NUM bytes last written" msgstr "" #: src/main/help.c:262 msgid "FORMAT" msgstr "" #: src/main/help.c:263 msgid "set output format to FORMAT" msgstr "" #: src/main/help.c:266 msgid "output percentages, not visual information" msgstr "" #: src/main/help.c:269 msgid "do not output any transfer information at all" msgstr "" #: src/main/help.c:273 msgid "show number of bits transferred" msgstr "" #: src/main/help.c:276 msgid "treat suffixes as multiples of 1000 rather than 1024" msgstr "" #: src/main/help.c:279 msgid "display nothing until first byte transferred" msgstr "" #: src/main/help.c:281 src/main/help.c:296 src/main/help.c:299 msgid "SEC" msgstr "" #: src/main/help.c:282 msgid "display nothing until SEC seconds have passed" msgstr "" #: src/main/help.c:284 msgid "SIZE" msgstr "" #: src/main/help.c:285 msgid "set estimated data size to SIZE bytes" msgstr "" #: src/main/help.c:288 msgid "if size unknown, show rate vs max rate" msgstr "" #: src/main/help.c:291 msgid "count lines instead of bytes" msgstr "" #: src/main/help.c:294 msgid "lines are null-terminated" msgstr "" #: src/main/help.c:297 msgid "update every SEC seconds" msgstr "" #: src/main/help.c:300 msgid "compute average rate over past SEC seconds (default 30s)" msgstr "" #: src/main/help.c:302 msgid "WIDTH" msgstr "" #: src/main/help.c:303 msgid "assume terminal is WIDTH characters wide" msgstr "" #: src/main/help.c:305 msgid "HEIGHT" msgstr "" #: src/main/help.c:306 msgid "assume terminal is HEIGHT rows high" msgstr "" #: src/main/help.c:308 msgid "NAME" msgstr "" #: src/main/help.c:309 msgid "prefix visual information with NAME" msgstr "" #: src/main/help.c:311 msgid "STYLE" msgstr "" #: src/main/help.c:312 msgid "set default bar style to NAME" msgstr "" #: src/main/help.c:314 msgid "SPEC" msgstr "" #: src/main/help.c:315 msgid "also send progress to SPEC" msgstr "" #: src/main/help.c:318 msgid "output transfer statistics at the end" msgstr "" #: src/main/help.c:321 msgid "output even if standard error is not a terminal" msgstr "" #: src/main/help.c:324 msgid "use cursor positioning escape sequences" msgstr "" #: src/main/help.c:327 src/main/help.c:357 src/main/help.c:369 #: src/main/help.c:379 msgid "FILE" msgstr "" #: src/main/help.c:328 msgid "write output to FILE instead of stdout" msgstr "" #: src/main/help.c:330 msgid "RATE" msgstr "" #: src/main/help.c:331 msgid "limit transfer to RATE bytes per second" msgstr "" #: src/main/help.c:333 src/main/help.c:342 msgid "BYTES" msgstr "" #: src/main/help.c:334 msgid "use a buffer size of BYTES" msgstr "" #: src/main/help.c:337 msgid "never use splice(), always use read/write" msgstr "" #: src/main/help.c:340 msgid "skip read errors in input" msgstr "" #: src/main/help.c:343 msgid "skip errors in BYTES blocks at a time" msgstr "" #: src/main/help.c:346 msgid "stop after --size bytes have been transferred" msgstr "" #: src/main/help.c:349 msgid "flush cache to disk after every write" msgstr "" #: src/main/help.c:352 msgid "use direct I/O to bypass cache" msgstr "" #: src/main/help.c:355 msgid "discard input instead of writing to output" msgstr "" #: src/main/help.c:358 msgid "write all input to FILE before writing to output" msgstr "" #: src/main/help.c:360 msgid "PID[:FD]" msgstr "" #: src/main/help.c:361 msgid "watch file FD opened by process PID" msgstr "" #: src/main/help.c:364 msgid "PID" msgstr "" #: src/main/help.c:365 msgid "update settings of process PID" msgstr "" #: src/main/help.c:370 msgid "save process ID in FILE" msgstr "" #: src/main/help.c:373 msgid "show this help and exit" msgstr "" #: src/main/help.c:376 msgid "show version information and exit" msgstr "" #: src/main/help.c:380 msgid "write debug logs to FILE" msgstr "" #: src/main/help.c:406 #, c-format msgid "Usage: %s [OPTION] [FILE]..." msgstr "" #: src/main/help.c:417 msgid "" "Concatenate FILE(s), or standard input, to standard output, with monitoring." msgstr "" #: src/main/help.c:555 msgid "Supported format sequences:" msgstr "" #: src/main/help.c:569 #, c-format msgid "Please report any bugs to: %s" msgstr "" #: src/main/main.c:232 msgid "(input)" msgstr "" #: src/main/main.c:328 msgid "state allocation failed" msgstr "" #: src/main/options.c:144 src/pv/file.c:324 msgid "failed to stat file" msgstr "" #: src/main/options.c:158 msgid "is a directory" msgstr "" #: src/main/options.c:187 msgid "failed to generate sysfs filename" msgstr "" #: src/main/options.c:209 msgid "failed to read sysfs size file" msgstr "" #: src/main/options.c:229 msgid "failed to open block device" msgstr "" #: src/main/options.c:239 msgid "failed to determine size of block device" msgstr "" #: src/main/options.c:345 msgid "option structure allocation failed" msgstr "" #: src/main/options.c:364 msgid "option structure argv allocation failed" msgstr "" #: src/main/options.c:417 msgid "numeric value not understood" msgstr "" #: src/main/options.c:435 msgid "integer argument expected" msgstr "" #: src/main/options.c:447 msgid "numeric argument expected" msgstr "" #: src/main/options.c:458 msgid "process ID or pid:fd pair expected" msgstr "" #: src/main/options.c:465 msgid "invalid process ID" msgstr "" #: src/main/options.c:698 #, c-format msgid "Try `%s --help' for more information." msgstr "" #: src/main/options.c:700 #, c-format msgid "Try `%s -h' for more information." msgstr "" #: src/main/options.c:731 msgid "" "cannot use line mode or transfer modifier options when watching file " "descriptors" msgstr "" #: src/main/options.c:740 msgid "cannot use cursor positioning when watching file descriptors" msgstr "" #: src/main/options.c:749 msgid "cannot use remote control when watching file descriptors" msgstr "" #: src/main/options.c:758 msgid "cannot transfer files when watching file descriptors" msgstr "" #: src/main/options.c:773 msgid "not available on systems without /proc/self/fdinfo" msgstr "" #: src/main/remote.c:309 msgid "message not received" msgstr "" #: src/main/remote.c:440 msgid "SA_SIGINFO not supported on this system" msgstr "" #: src/main/version.c:28 msgid "License: GPLv3+ " msgstr "" #: src/main/version.c:29 msgid "This is free software: you are free to change and redistribute it." msgstr "" #: src/main/version.c:30 msgid "There is NO WARRANTY, to the extent permitted by law." msgstr "" #: src/main/version.c:32 msgid "Project web site" msgstr "" #: src/pv/cursor.c:61 msgid "failed to get terminal name" msgstr "" #: src/pv/cursor.c:106 msgid "failed to open lock file" msgstr "" #: src/pv/cursor.c:139 msgid "lock attempt failed" msgstr "" #: src/pv/cursor.c:400 msgid "failed to open terminal" msgstr "" #: src/pv/display.c:249 msgid "yzafpnum kMGTPEZY" msgstr "" #: src/pv/display.c:267 msgid "yzafpnum KMGTPEZY" msgstr "" #: src/pv/display.c:989 src/pv/transfer.c:1056 msgid "buffer allocation failed" msgstr "" #: src/pv/file.c:149 msgid "failed to seek to start of output" msgstr "" #: src/pv/file.c:294 msgid "failed to close file" msgstr "" #: src/pv/file.c:317 msgid "failed to read file" msgstr "" #: src/pv/file.c:332 msgid "failed to stat output file" msgstr "" #: src/pv/file.c:354 msgid "input file is output file" msgstr "" #: src/pv/file.c:412 msgid "(none)" msgstr "" #: src/pv/file.c:414 msgid "(stdin)" msgstr "" #: src/pv/format/averagerate.c:34 src/pv/format/progressbar.c:93 #: src/pv/format/rate.c:37 src/pv/loop.c:551 msgid "b/s" msgstr "" #: src/pv/format/averagerate.c:38 src/pv/format/progressbar.c:97 #: src/pv/format/rate.c:41 msgid "/s" msgstr "" #: src/pv/format/averagerate.c:38 src/pv/format/progressbar.c:97 #: src/pv/format/rate.c:41 src/pv/loop.c:551 msgid "B/s" msgstr "" #: src/pv/format/bytes.c:37 msgid "b" msgstr "" #: src/pv/format/bytes.c:41 src/pv/transfer.c:594 msgid "B" msgstr "" #: src/pv/format/eta.c:53 src/pv/format/eta.c:57 msgid "ETA" msgstr "" #: src/pv/format/fineta.c:81 msgid "FIN" msgstr "" #: src/pv/loop.c:550 msgid "rate min/avg/max/mdev" msgstr "" #: src/pv/loop.c:562 msgid "rate not measured" msgstr "" #: src/pv/loop.c:772 src/pv/loop.c:823 src/pv/loop.c:876 src/pv/watchpid.c:99 #: src/pv/watchpid.c:109 src/pv/watchpid.c:120 src/pv/watchpid.c:128 #: src/pv/watchpid.c:165 src/pv/watchpid.c:184 src/pv/watchpid.c:192 #: src/pv/watchpid.c:202 src/pv/watchpid.c:300 src/pv/watchpid.c:308 #: src/pv/watchpid.c:385 src/pv/watchpid.c:406 msgid "pid" msgstr "" #: src/pv/state.c:40 msgid "history structure allocation failed" msgstr "" #: src/pv/state.c:617 src/pv/state.c:628 msgid "file list allocation failed" msgstr "" #: src/pv/transfer.c:463 msgid "read failed" msgstr "" #: src/pv/transfer.c:479 msgid "warning: read errors detected" msgstr "" #: src/pv/transfer.c:495 msgid "file is not seekable" msgstr "" #: src/pv/transfer.c:573 msgid "failed to seek past error" msgstr "" #: src/pv/transfer.c:593 msgid "skipped past read error" msgstr "" #: src/pv/transfer.c:634 msgid "no transfer buffer allocated" msgstr "" #: src/pv/transfer.c:676 msgid "failed to set interval timer" msgstr "" #: src/pv/transfer.c:702 msgid "failed to clear interval timer" msgstr "" #: src/pv/transfer.c:744 msgid "line position buffer allocation failed" msgstr "" #: src/pv/transfer.c:917 msgid "write failed" msgstr "" #: src/pv/transfer.c:1154 msgid "select call failed" msgstr "" #: src/pv/watchpid.c:109 src/pv/watchpid.c:121 src/pv/watchpid.c:130 #: src/pv/watchpid.c:184 src/pv/watchpid.c:193 src/pv/watchpid.c:204 msgid "fd" msgstr "" #: src/pv/watchpid.c:130 src/pv/watchpid.c:204 msgid "not a regular file or block device" msgstr "" pv-1.9.31/po/fr.gmo000066400000000000000000000265051474702661500140070ustar00rootroot00000000000000Þ•nŒ•üP Q Y ` c e i Lo ¼ À Å Ì ;Ó     % C T 'Y  … 5Š BÀ % !) K h #n (’ » 4Ô < PF 8— 8Ð  *& -Q , -¬ Ú ï  $<P!jŒ »Ð%ì#&6]w‘¤'³Ûõ )H"e2ˆ»"Õ'ø/ *P%{#¡"Å èô %Ea4}'²Úú+ 8 X)y£µ!Í%ï/G-_4ÂÛú'=\#z0žÏ è&õ 4>FIKOVV­±¹À<È  :M-R€„<‹SÈ-)J'tœ2¤7×)Y9g“…û]Mß%- 5S B‰ ;Ì *!"3!$V!0{!!¬! Î!%ï!)" ?"*`"(‹".´"4ã"7#]P#.®#Ý#ö#$6$$0[$&Œ$³$9Å$!ÿ$5!%7W%%6ª%:á%K&>h&0§&-Ø&('/'*E' p'8‘''Ê'(ò'7(;S()(¹(<Ô(')(9)7b) š) ») Ü)0ý)-.*\*/y*-©*@×*&+0?+-p+Dž+2ã+.,4E,Fz,/Á,ñ,<- ^Wd-5DiP:c4?;0+TF(7 #UM"1> e N\b_%)K]SEh.<R!9A8*$QGf6BkYZ@'gOX=JH &j`CL[ nl/,m23aIV(input)(none)/sBB/sBYTESConcatenate FILE(s), or standard input, to standard output, with monitoring.ETAFILEFORMATHEIGHTLicense: GPLv3+ NAMENUMPIDPID[:FD]Please report any bugs to: %sProject web siteRATESA_SIGINFO not supported on this systemSECSIZEThere is NO WARRANTY, to the extent permitted by law.This is free software: you are free to change and redistribute it.Try `%s --help' for more information.Try `%s -h' for more information.Usage: %s [OPTION] [FILE]...WIDTHassume terminal is HEIGHT rows highassume terminal is WIDTH characters widebuffer allocation failedcannot transfer files when watching file descriptorscannot use cursor positioning when watching file descriptorscannot use line mode or transfer modifier options when watching file descriptorscannot use remote control when watching file descriptorscompute average rate over past SEC seconds (default 30s)count lines instead of bytesdiscard input instead of writing to outputdisplay nothing until SEC seconds have passeddisplay nothing until first byte transferreddo not output any transfer information at allfailed to close filefailed to get terminal namefailed to open lock filefailed to open terminalfailed to read filefailed to seek past errorfailed to seek to start of outputfailed to stat filefailed to stat output filefile is not seekablefile list allocation failedflush cache to disk after every writehistory structure allocation failedif size unknown, show rate vs max rateinput file is output fileinteger argument expectedinvalid process IDis a directorylimit transfer to RATE bytes per secondlines are null-terminatedlock attempt failedmessage not receivednever use splice(), always use read/writeno transfer buffer allocatednot a regular file or block devicenot available on systems without /proc/self/fdinfonumeric argument expectedoption structure allocation failedoption structure argv allocation failedoutput even if standard error is not a terminaloutput percentages, not visual informationoutput transfer statistics at the endprefix visual information with NAMEprocess ID or pid:fd pair expectedread failedsave process ID in FILEselect call failedset estimated data size to SIZE bytesset output format to FORMATshow NUM bytes last writtenshow absolute estimated time of arrival (completion)show data transfer average rate countershow data transfer rate countershow elapsed timeshow estimated time of arrival (completion)show number of bits transferredshow number of bytes transferredshow percentage of transfer buffer in useshow progress barshow this help and exitshow version information and exitskip errors in BYTES blocks at a timeskip read errors in inputskipped past read errorstate allocation failedstop after --size bytes have been transferredtreat suffixes as multiples of 1000 rather than 1024update every SEC secondsupdate settings of process PIDuse a buffer size of BYTESuse cursor positioning escape sequencesuse direct I/O to bypass cachewarning: read errors detectedwatch file FD opened by process PIDwrite all input to FILE before writing to outputwrite debug logs to FILEwrite failedwrite output to FILE instead of stdoutReport-Msgid-Bugs-To: pv@ivarch.com PO-Revision-Date: 2024-10-12 11:13+0000 Last-Translator: a-j-wood Language-Team: French Language: fr Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=n > 1; X-Generator: Weblate 5.7.2 Date: 1999-06-01 15:18:29+0100 From: Andrew Wood Xgettext-Options: --default-domain=pkgbuild --directory=./.pkgdir --add-comments --keyword=_ --keyword=N_ Files: src/getopt/getopt.c src/getopt/getopt1.c src/version.c src/main/init.c src/main/help.c src/main/xpmptr.c src/guts/load.c src/guts/stop.c src/guts/configure.c src/guts/make.c src/guts/install.c src/guts/prefs.c src/ui/generate.c src/ui/main.c src/ui/xpm.c src/ui/status.c src/ui/activate.c src/ui/handlers/main.c src/ui/handlers/package.c src/ui/handlers/prefs.c src/ui/handlers/dirsel.c src/ui/handlers/popup.c src/ui/handlers/help.c src/ui/textout.c src/ui/report.c src/ui/callback.c src/nls/intl/bindtextdom.c src/nls/intl/dcgettext.c src/nls/intl/dgettext.c src/nls/intl/finddomain.c src/nls/intl/gettext.c src/nls/intl/loadmsgcat.c src/nls/intl/localealias.c src/nls/intl/textdomain.c src/nls/intl-cat/cat-compat.c src/nls/intl-gett/intl-compat.c (entrée)(aucun)/sOO/sOCTETSConcaténer FICHIER(s), ou l'entrée standard, sur la sortie standard avec monitorage.ETAFICHIERFORMATHAUTEURLicense : GPLv3+ NOMNUMPIDPID[:FD]SVP rapporter tous bogues à %sSite web du projetTAUXSA_SIGINFO non pris en charge sur ce systèmeSECTAILLEIl n'y a AUCUNE GARANTIE, dans la mesure permise par la loi.Ceci est un logiciel libre : vous êtes libre de le modifier et de le redistribuer.Essayez `%s --help' pour plus d'informations.Essayez `%s -h' pour plus d'informations.Utilisation : %s [OPTIONS] [FICHIER]...LARGEURprésumer la hauteur du terminal à HAUTEUR lignesprésumer la largeur du terminal à LARGEUR caractèreséchec de l'allocation de mémoire tamponimpossible de transférer des fichiers lorsque vous regardez des descripteurs de fichiersimpossible d'utiliser le positionnement du curseur lors de la visualisation des descripteurs de fichierimpossible d'utiliser le mode ligne ou les options de modificateur de transfert lors de la visualisation des descripteurs de fichiersimpossible d'utiliser la télécommande lors de la visualisation des descripteurs de fichierscalculer le taux moyen d'après les SEC dernières secondes (30s par défaut)compter les lignes au lieu des octetsrejeter l'entrée au lieu de l'écrire vers la sortiene rien afficher jusqu'à ce que SEC secondes se soient écouléesne rien afficher avant qu'au moins un octet soit tranférén'afficher aucune information de transfertla fermeture du fichier a échouééchec de lecture du nom du terminaléchec de l'ouverture du fichier de verrouillageéchec de l'ouverture du terminalla lecture du fichier a échouén'a pas réussi à dépasser l'erreurne peut pas passer au début de la sortieéchec à statuer sur le fichieréchec à statuer sur le fichier de sortiene peut pas se déplacer dans le fichieréchec de l'allocation de la liste de fichiersvider le cache sur le disque après chaque écriturel'allocation de la structure de l'historique a échouési la taille est inconnue, afficher le taux de transfert par rapport au taux de transfert maxfichiers d'entré et de sortie sont les mêmesValeur entière attendueID de processus non valideest un répertoirelimite le taux de transfert à TAUX octets par secondeles lignes sont terminées par un caractère nuléchec de la tentative de verrouillagemessage non reçune jamais utiliser splice(), toujours utiliser read/writeaucun tampon de transfert allouépas un fichier ordinaire ou un périphérique de blocnon disponible sur les systèmes sans /proc/self/fdinfoValeur numérique attenduel'allocation pour la structure d'une option a échouél'allocation pour la structure de l'option argv a échouéimprimer vers la sortie d'erreur standard même si ce n'est pas un terminalimprimer en pourcentage plutôt que des informations visuellesafficher les statistiques de transfert à la finpréfixer les informations visuelles avec NOMID de processus ou paire pid:fd attenduela lecture a échouéenregistrer l'ID de processus dans FICHIERl'appel de sélection a échouéajuster la taille estimée des données à TAILLE octetsdéfinir le format de sortie sur FORMATafficher les derniers NUM octets écritsafficher l'heure absolute de l'achèvement de la tâcheafficher le compteur de taux moyen de transfert de donnéesafficher le taux de tranfert des donnéesafficher le temps écouléafficher l'heure approximative de l'achèvement de la tâcheafficher le nombre de bits transférésafficher le nombre d'octets transférésafficher le pourcentage de tampon de transfert utiliséafficher la barre de progressionafficher cette aide puis quitterafficher la version puis quitterignorer les erreurs dans OCTETS blocs à la foisignorer les erreurs de lecture dans l'entréeerreur de lecture dépasséeéchec de l'allocation de mémoire de conditionarrêter après le transfert de --size octetstraiter les suffixes comme des multiples de 1000 au lieu de 1024mettre à jour toutes les SEC secondesmettre à jour la configuration du processus PIDUtiliser une mémoire tampon de OCTETS octetsutiliser les séquences d'échappements de positionnement de curseurutiliser les E/S directes pour contourner le cacheavertissement : erreurs de lecture détectéessurveiller le fichier FD ouvert par le processus PIDécrire toute l'entrée vers FICHIER avant de l'écrire vers la sortieécrire les journaux de déboggage vers FICHIERl'écriture a échouéécrire la sortie dans FICHIER au lieu de la sortie standardpv-1.9.31/po/fr.po000066400000000000000000000401441474702661500136360ustar00rootroot00000000000000msgid "" msgstr "" "Report-Msgid-Bugs-To: pv@ivarch.com\n" "POT-Creation-Date: 2025-01-28 21:21+0000\n" "PO-Revision-Date: 2024-10-12 11:13+0000\n" "Last-Translator: a-j-wood \n" "Language-Team: French \n" "Language: fr\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" "X-Generator: Weblate 5.7.2\n" "Date: 1999-06-01 15:18:29+0100\n" "From: Andrew Wood \n" "Xgettext-Options: --default-domain=pkgbuild --directory=./.pkgdir --add-" "comments --keyword=_ --keyword=N_\n" "Files: src/getopt/getopt.c src/getopt/getopt1.c src/version.c src/main/init." "c src/main/help.c src/main/xpmptr.c src/guts/load.c src/guts/stop.c src/guts/" "configure.c src/guts/make.c src/guts/install.c src/guts/prefs.c src/ui/" "generate.c src/ui/main.c src/ui/xpm.c src/ui/status.c src/ui/activate.c src/" "ui/handlers/main.c src/ui/handlers/package.c src/ui/handlers/prefs.c src/ui/" "handlers/dirsel.c src/ui/handlers/popup.c src/ui/handlers/help.c src/ui/" "textout.c src/ui/report.c src/ui/callback.c src/nls/intl/bindtextdom.c src/" "nls/intl/dcgettext.c src/nls/intl/dgettext.c src/nls/intl/finddomain.c src/" "nls/intl/gettext.c src/nls/intl/loadmsgcat.c src/nls/intl/localealias.c src/" "nls/intl/textdomain.c src/nls/intl-cat/cat-compat.c src/nls/intl-gett/intl-" "compat.c\n" #: src/main/help.c:236 msgid "show progress bar" msgstr "afficher la barre de progression" #: src/main/help.c:239 msgid "show elapsed time" msgstr "afficher le temps écoulé" #: src/main/help.c:242 msgid "show estimated time of arrival (completion)" msgstr "afficher l'heure approximative de l'achèvement de la tâche" #: src/main/help.c:245 msgid "show absolute estimated time of arrival (completion)" msgstr "afficher l'heure absolute de l'achèvement de la tâche" #: src/main/help.c:248 msgid "show data transfer rate counter" msgstr "afficher le taux de tranfert des données" #: src/main/help.c:251 msgid "show data transfer average rate counter" msgstr "afficher le compteur de taux moyen de transfert de données" #: src/main/help.c:254 msgid "show number of bytes transferred" msgstr "afficher le nombre d'octets transférés" #: src/main/help.c:257 msgid "show percentage of transfer buffer in use" msgstr "afficher le pourcentage de tampon de transfert utilisé" #: src/main/help.c:259 msgid "NUM" msgstr "NUM" #: src/main/help.c:260 msgid "show NUM bytes last written" msgstr "afficher les derniers NUM octets écrits" #: src/main/help.c:262 msgid "FORMAT" msgstr "FORMAT" #: src/main/help.c:263 msgid "set output format to FORMAT" msgstr "définir le format de sortie sur FORMAT" #: src/main/help.c:266 msgid "output percentages, not visual information" msgstr "imprimer en pourcentage plutôt que des informations visuelles" #: src/main/help.c:269 msgid "do not output any transfer information at all" msgstr "n'afficher aucune information de transfert" #: src/main/help.c:273 msgid "show number of bits transferred" msgstr "afficher le nombre de bits transférés" #: src/main/help.c:276 msgid "treat suffixes as multiples of 1000 rather than 1024" msgstr "traiter les suffixes comme des multiples de 1000 au lieu de 1024" #: src/main/help.c:279 msgid "display nothing until first byte transferred" msgstr "ne rien afficher avant qu'au moins un octet soit tranféré" #: src/main/help.c:281 src/main/help.c:296 src/main/help.c:299 msgid "SEC" msgstr "SEC" #: src/main/help.c:282 msgid "display nothing until SEC seconds have passed" msgstr "ne rien afficher jusqu'à ce que SEC secondes se soient écoulées" #: src/main/help.c:284 msgid "SIZE" msgstr "TAILLE" #: src/main/help.c:285 msgid "set estimated data size to SIZE bytes" msgstr "ajuster la taille estimée des données à TAILLE octets" #: src/main/help.c:288 msgid "if size unknown, show rate vs max rate" msgstr "" "si la taille est inconnue, afficher le taux de transfert par rapport au taux " "de transfert max" #: src/main/help.c:291 msgid "count lines instead of bytes" msgstr "compter les lignes au lieu des octets" #: src/main/help.c:294 msgid "lines are null-terminated" msgstr "les lignes sont terminées par un caractère nul" #: src/main/help.c:297 msgid "update every SEC seconds" msgstr "mettre à jour toutes les SEC secondes" #: src/main/help.c:300 msgid "compute average rate over past SEC seconds (default 30s)" msgstr "" "calculer le taux moyen d'après les SEC dernières secondes (30s par défaut)" #: src/main/help.c:302 msgid "WIDTH" msgstr "LARGEUR" #: src/main/help.c:303 msgid "assume terminal is WIDTH characters wide" msgstr "présumer la largeur du terminal à LARGEUR caractères" #: src/main/help.c:305 msgid "HEIGHT" msgstr "HAUTEUR" #: src/main/help.c:306 msgid "assume terminal is HEIGHT rows high" msgstr "présumer la hauteur du terminal à HAUTEUR lignes" #: src/main/help.c:308 msgid "NAME" msgstr "NOM" #: src/main/help.c:309 msgid "prefix visual information with NAME" msgstr "préfixer les informations visuelles avec NOM" #: src/main/help.c:311 msgid "STYLE" msgstr "" #: src/main/help.c:312 msgid "set default bar style to NAME" msgstr "" #: src/main/help.c:314 msgid "SPEC" msgstr "" #: src/main/help.c:315 msgid "also send progress to SPEC" msgstr "" #: src/main/help.c:318 msgid "output transfer statistics at the end" msgstr "afficher les statistiques de transfert à la fin" #: src/main/help.c:321 msgid "output even if standard error is not a terminal" msgstr "" "imprimer vers la sortie d'erreur standard même si ce n'est pas un terminal" #: src/main/help.c:324 msgid "use cursor positioning escape sequences" msgstr "utiliser les séquences d'échappements de positionnement de curseur" #: src/main/help.c:327 src/main/help.c:357 src/main/help.c:369 #: src/main/help.c:379 msgid "FILE" msgstr "FICHIER" #: src/main/help.c:328 msgid "write output to FILE instead of stdout" msgstr "écrire la sortie dans FICHIER au lieu de la sortie standard" #: src/main/help.c:330 msgid "RATE" msgstr "TAUX" #: src/main/help.c:331 msgid "limit transfer to RATE bytes per second" msgstr "limite le taux de transfert à TAUX octets par seconde" #: src/main/help.c:333 src/main/help.c:342 msgid "BYTES" msgstr "OCTETS" #: src/main/help.c:334 msgid "use a buffer size of BYTES" msgstr "Utiliser une mémoire tampon de OCTETS octets" #: src/main/help.c:337 msgid "never use splice(), always use read/write" msgstr "ne jamais utiliser splice(), toujours utiliser read/write" #: src/main/help.c:340 msgid "skip read errors in input" msgstr "ignorer les erreurs de lecture dans l'entrée" #: src/main/help.c:343 msgid "skip errors in BYTES blocks at a time" msgstr "ignorer les erreurs dans OCTETS blocs à la fois" #: src/main/help.c:346 msgid "stop after --size bytes have been transferred" msgstr "arrêter après le transfert de --size octets" #: src/main/help.c:349 msgid "flush cache to disk after every write" msgstr "vider le cache sur le disque après chaque écriture" #: src/main/help.c:352 msgid "use direct I/O to bypass cache" msgstr "utiliser les E/S directes pour contourner le cache" #: src/main/help.c:355 msgid "discard input instead of writing to output" msgstr "rejeter l'entrée au lieu de l'écrire vers la sortie" #: src/main/help.c:358 msgid "write all input to FILE before writing to output" msgstr "écrire toute l'entrée vers FICHIER avant de l'écrire vers la sortie" #: src/main/help.c:360 msgid "PID[:FD]" msgstr "PID[:FD]" #: src/main/help.c:361 msgid "watch file FD opened by process PID" msgstr "surveiller le fichier FD ouvert par le processus PID" #: src/main/help.c:364 msgid "PID" msgstr "PID" #: src/main/help.c:365 msgid "update settings of process PID" msgstr "mettre à jour la configuration du processus PID" #: src/main/help.c:370 msgid "save process ID in FILE" msgstr "enregistrer l'ID de processus dans FICHIER" #: src/main/help.c:373 msgid "show this help and exit" msgstr "afficher cette aide puis quitter" #: src/main/help.c:376 msgid "show version information and exit" msgstr "afficher la version puis quitter" #: src/main/help.c:380 msgid "write debug logs to FILE" msgstr "écrire les journaux de déboggage vers FICHIER" #: src/main/help.c:406 #, c-format msgid "Usage: %s [OPTION] [FILE]..." msgstr "Utilisation : %s [OPTIONS] [FICHIER]..." #: src/main/help.c:417 msgid "" "Concatenate FILE(s), or standard input, to standard output, with monitoring." msgstr "" "Concaténer FICHIER(s), ou l'entrée standard, sur la sortie standard avec " "monitorage." #: src/main/help.c:555 msgid "Supported format sequences:" msgstr "" #: src/main/help.c:569 #, c-format msgid "Please report any bugs to: %s" msgstr "SVP rapporter tous bogues à %s" #: src/main/main.c:232 msgid "(input)" msgstr "(entrée)" #: src/main/main.c:328 msgid "state allocation failed" msgstr "échec de l'allocation de mémoire de condition" #: src/main/options.c:144 src/pv/file.c:324 msgid "failed to stat file" msgstr "échec à statuer sur le fichier" #: src/main/options.c:158 msgid "is a directory" msgstr "est un répertoire" #: src/main/options.c:187 msgid "failed to generate sysfs filename" msgstr "" #: src/main/options.c:209 msgid "failed to read sysfs size file" msgstr "" #: src/main/options.c:229 msgid "failed to open block device" msgstr "" #: src/main/options.c:239 msgid "failed to determine size of block device" msgstr "" #: src/main/options.c:345 msgid "option structure allocation failed" msgstr "l'allocation pour la structure d'une option a échoué" #: src/main/options.c:364 msgid "option structure argv allocation failed" msgstr "l'allocation pour la structure de l'option argv a échoué" #: src/main/options.c:417 msgid "numeric value not understood" msgstr "" #: src/main/options.c:435 msgid "integer argument expected" msgstr "Valeur entière attendue" #: src/main/options.c:447 msgid "numeric argument expected" msgstr "Valeur numérique attendue" #: src/main/options.c:458 msgid "process ID or pid:fd pair expected" msgstr "ID de processus ou paire pid:fd attendue" #: src/main/options.c:465 msgid "invalid process ID" msgstr "ID de processus non valide" #: src/main/options.c:698 #, c-format msgid "Try `%s --help' for more information." msgstr "Essayez `%s --help' pour plus d'informations." #: src/main/options.c:700 #, c-format msgid "Try `%s -h' for more information." msgstr "Essayez `%s -h' pour plus d'informations." #: src/main/options.c:731 msgid "" "cannot use line mode or transfer modifier options when watching file " "descriptors" msgstr "" "impossible d'utiliser le mode ligne ou les options de modificateur de " "transfert lors de la visualisation des descripteurs de fichiers" #: src/main/options.c:740 msgid "cannot use cursor positioning when watching file descriptors" msgstr "" "impossible d'utiliser le positionnement du curseur lors de la visualisation " "des descripteurs de fichier" #: src/main/options.c:749 msgid "cannot use remote control when watching file descriptors" msgstr "" "impossible d'utiliser la télécommande lors de la visualisation des " "descripteurs de fichiers" #: src/main/options.c:758 msgid "cannot transfer files when watching file descriptors" msgstr "" "impossible de transférer des fichiers lorsque vous regardez des descripteurs " "de fichiers" #: src/main/options.c:773 msgid "not available on systems without /proc/self/fdinfo" msgstr "non disponible sur les systèmes sans /proc/self/fdinfo" #: src/main/remote.c:309 msgid "message not received" msgstr "message non reçu" #: src/main/remote.c:440 msgid "SA_SIGINFO not supported on this system" msgstr "SA_SIGINFO non pris en charge sur ce système" #: src/main/version.c:28 msgid "License: GPLv3+ " msgstr "License : GPLv3+ " #: src/main/version.c:29 msgid "This is free software: you are free to change and redistribute it." msgstr "" "Ceci est un logiciel libre : vous êtes libre de le modifier et de le " "redistribuer." #: src/main/version.c:30 msgid "There is NO WARRANTY, to the extent permitted by law." msgstr "Il n'y a AUCUNE GARANTIE, dans la mesure permise par la loi." #: src/main/version.c:32 msgid "Project web site" msgstr "Site web du projet" #: src/pv/cursor.c:61 msgid "failed to get terminal name" msgstr "échec de lecture du nom du terminal" #: src/pv/cursor.c:106 msgid "failed to open lock file" msgstr "échec de l'ouverture du fichier de verrouillage" #: src/pv/cursor.c:139 msgid "lock attempt failed" msgstr "échec de la tentative de verrouillage" #: src/pv/cursor.c:400 msgid "failed to open terminal" msgstr "échec de l'ouverture du terminal" #: src/pv/display.c:249 msgid "yzafpnum kMGTPEZY" msgstr "" #: src/pv/display.c:267 msgid "yzafpnum KMGTPEZY" msgstr "" #: src/pv/display.c:989 src/pv/transfer.c:1056 msgid "buffer allocation failed" msgstr "échec de l'allocation de mémoire tampon" #: src/pv/file.c:149 msgid "failed to seek to start of output" msgstr "ne peut pas passer au début de la sortie" #: src/pv/file.c:294 msgid "failed to close file" msgstr "la fermeture du fichier a échoué" #: src/pv/file.c:317 msgid "failed to read file" msgstr "la lecture du fichier a échoué" #: src/pv/file.c:332 msgid "failed to stat output file" msgstr "échec à statuer sur le fichier de sortie" #: src/pv/file.c:354 msgid "input file is output file" msgstr "fichiers d'entré et de sortie sont les mêmes" #: src/pv/file.c:412 msgid "(none)" msgstr "(aucun)" #: src/pv/file.c:414 msgid "(stdin)" msgstr "" #: src/pv/format/averagerate.c:34 src/pv/format/progressbar.c:93 #: src/pv/format/rate.c:37 src/pv/loop.c:551 msgid "b/s" msgstr "" #: src/pv/format/averagerate.c:38 src/pv/format/progressbar.c:97 #: src/pv/format/rate.c:41 msgid "/s" msgstr "/s" #: src/pv/format/averagerate.c:38 src/pv/format/progressbar.c:97 #: src/pv/format/rate.c:41 src/pv/loop.c:551 msgid "B/s" msgstr "O/s" #: src/pv/format/bytes.c:37 msgid "b" msgstr "" #: src/pv/format/bytes.c:41 src/pv/transfer.c:594 msgid "B" msgstr "O" #: src/pv/format/eta.c:53 src/pv/format/eta.c:57 msgid "ETA" msgstr "ETA" #: src/pv/format/fineta.c:81 msgid "FIN" msgstr "" #: src/pv/loop.c:550 msgid "rate min/avg/max/mdev" msgstr "" #: src/pv/loop.c:562 msgid "rate not measured" msgstr "" #: src/pv/loop.c:772 src/pv/loop.c:823 src/pv/loop.c:876 src/pv/watchpid.c:99 #: src/pv/watchpid.c:109 src/pv/watchpid.c:120 src/pv/watchpid.c:128 #: src/pv/watchpid.c:165 src/pv/watchpid.c:184 src/pv/watchpid.c:192 #: src/pv/watchpid.c:202 src/pv/watchpid.c:300 src/pv/watchpid.c:308 #: src/pv/watchpid.c:385 src/pv/watchpid.c:406 msgid "pid" msgstr "" #: src/pv/state.c:40 msgid "history structure allocation failed" msgstr "l'allocation de la structure de l'historique a échoué" #: src/pv/state.c:617 src/pv/state.c:628 msgid "file list allocation failed" msgstr "échec de l'allocation de la liste de fichiers" #: src/pv/transfer.c:463 msgid "read failed" msgstr "la lecture a échoué" #: src/pv/transfer.c:479 msgid "warning: read errors detected" msgstr "avertissement : erreurs de lecture détectées" #: src/pv/transfer.c:495 msgid "file is not seekable" msgstr "ne peut pas se déplacer dans le fichier" #: src/pv/transfer.c:573 msgid "failed to seek past error" msgstr "n'a pas réussi à dépasser l'erreur" #: src/pv/transfer.c:593 msgid "skipped past read error" msgstr "erreur de lecture dépassée" #: src/pv/transfer.c:634 msgid "no transfer buffer allocated" msgstr "aucun tampon de transfert alloué" #: src/pv/transfer.c:676 msgid "failed to set interval timer" msgstr "" #: src/pv/transfer.c:702 msgid "failed to clear interval timer" msgstr "" #: src/pv/transfer.c:744 msgid "line position buffer allocation failed" msgstr "" #: src/pv/transfer.c:917 msgid "write failed" msgstr "l'écriture a échoué" #: src/pv/transfer.c:1154 msgid "select call failed" msgstr "l'appel de sélection a échoué" #: src/pv/watchpid.c:109 src/pv/watchpid.c:121 src/pv/watchpid.c:130 #: src/pv/watchpid.c:184 src/pv/watchpid.c:193 src/pv/watchpid.c:204 msgid "fd" msgstr "" #: src/pv/watchpid.c:130 src/pv/watchpid.c:204 msgid "not a regular file or block device" msgstr "pas un fichier ordinaire ou un périphérique de bloc" #~ msgid "failed to set alarm signal handler" #~ msgstr "échec de la définition du gestionnaire de signal d'alarme" pv-1.9.31/po/insert-header.sin000066400000000000000000000016121474702661500161310ustar00rootroot00000000000000# Sed script that inserts the file called HEADER before the header entry. # # Copyright (C) 2001 Free Software Foundation, Inc. # Written by Bruno Haible , 2001. # This file is free software; the Free Software Foundation gives # unlimited permission to use, copy, distribute, and modify it. # # At each occurrence of a line starting with "msgid ", we execute the following # commands. At the first occurrence, insert the file. At the following # occurrences, do nothing. The distinction between the first and the following # occurrences is achieved by looking at the hold space. /^msgid /{ x # Test if the hold space is empty. s/m/m/ ta # Yes it was empty. First occurrence. Read the file. r HEADER # Output the file's contents by reading the next line. But don't lose the # current line while doing this. g N bb :a # The hold space was nonempty. Following occurrences. Do nothing. x :b } pv-1.9.31/po/pl.gmo000066400000000000000000000276251474702661500140170ustar00rootroot00000000000000Þ•…D³l8 9 A H P S U Y L_ ¬ ° µ ¹ À ;Ç      7 H 'M u y ~ ƒ ‰ 5¥ BÛ % !D f ƒ ‰ #¤ (È ñ ó ÷ 4<EP‚8Ó8 E*b-,»-è5(J!s•±Íæþ1!KmŠž¹¼Ñ%í#&7^x’¥'´&Ü1)Fp"2°ãý"'=/e*•%Àæ#ê"1G Ye}%®Ôð4 'Ai‰+›Ç ç)2D!\%~¤¾Ö-î4Qj‰'¤Ìë# 0-^ w&„«½ëÏ »ÆÍÕØÚÞ[ä@DIM T<_œ¢©­/¶æ ö-08@E!J=lBª4í0"%S y"…5¨9Þ"JA^Œ€ëol `Ü =!IY!:£!8Þ!2"0J"{"7›"2Ó"(#//#3_##“#·#.×#%$1,$-^$/Œ$;¼$ø$û$)%<B%.%[®%0 &+;&g&~&<Ž&0Ë&!ü&#'B'5Z'#':´'/ï'( <(*](/ˆ(F¸(9ÿ((9)b)$f)$‹)°)Í)æ)õ)(*+8*2d*#—*+»*.ç*4+'K+s+!Œ+"®+#Ñ+*õ+ ,*6,&a,1ˆ, º,Û,*õ,& -9G-#-"¥-È-2ç-N.%i.+.M». / )/97/q/ƒ/*+C,d‚9 | erQ„Z! i\ƒ<w@yG:f3l]c6s H`pk}PYvx/n5$BqK1?=.Oj#J^& "-NSVEA;'TD_u8…0>gMXh7Fz~L)W{%mR4U 2Ib[€a(to(input)(none)(stdin)/sBB/sBYTESConcatenate FILE(s), or standard input, to standard output, with monitoring.ETAFILEFINFORMATHEIGHTLicense: GPLv3+ NAMENUMPIDPID[:FD]Please report any bugs to: %sProject web siteRATESA_SIGINFO not supported on this systemSECSIZESPECSTYLESupported format sequences:There is NO WARRANTY, to the extent permitted by law.This is free software: you are free to change and redistribute it.Try `%s --help' for more information.Try `%s -h' for more information.Usage: %s [OPTION] [FILE]...WIDTHalso send progress to SPECassume terminal is HEIGHT rows highassume terminal is WIDTH characters widebb/sbuffer allocation failedcannot transfer files when watching file descriptorscannot use cursor positioning when watching file descriptorscannot use line mode or transfer modifier options when watching file descriptorscannot use remote control when watching file descriptorscompute average rate over past SEC seconds (default 30s)count lines instead of bytesdiscard input instead of writing to outputdisplay nothing until SEC seconds have passeddisplay nothing until first byte transferreddo not output any transfer information at allfailed to clear interval timerfailed to close filefailed to determine size of block devicefailed to generate sysfs filenamefailed to get terminal namefailed to open block devicefailed to open lock filefailed to open terminalfailed to read filefailed to read sysfs size filefailed to seek past errorfailed to seek to start of outputfailed to set interval timerfailed to stat filefailed to stat output filefdfile is not seekablefile list allocation failedflush cache to disk after every writehistory structure allocation failedif size unknown, show rate vs max rateinput file is output fileinteger argument expectedinvalid process IDis a directorylimit transfer to RATE bytes per secondline position buffer allocation failedlines are null-terminatedlock attempt failedmessage not receivednever use splice(), always use read/writeno transfer buffer allocatednot a regular file or block devicenot available on systems without /proc/self/fdinfonumeric argument expectednumeric value not understoodoption structure allocation failedoption structure argv allocation failedoutput even if standard error is not a terminaloutput percentages, not visual informationoutput transfer statistics at the endpidprefix visual information with NAMEprocess ID or pid:fd pair expectedrate min/avg/max/mdevrate not measuredread failedsave process ID in FILEselect call failedset default bar style to NAMEset estimated data size to SIZE bytesset output format to FORMATshow NUM bytes last writtenshow absolute estimated time of arrival (completion)show data transfer average rate countershow data transfer rate countershow elapsed timeshow estimated time of arrival (completion)show number of bits transferredshow number of bytes transferredshow percentage of transfer buffer in useshow progress barshow this help and exitshow version information and exitskip errors in BYTES blocks at a timeskip read errors in inputskipped past read errorstate allocation failedstop after --size bytes have been transferredtreat suffixes as multiples of 1000 rather than 1024update every SEC secondsupdate settings of process PIDuse a buffer size of BYTESuse cursor positioning escape sequencesuse direct I/O to bypass cachewarning: read errors detectedwatch file FD opened by process PIDwrite all input to FILE before writing to outputwrite debug logs to FILEwrite failedwrite output to FILE instead of stdoutyzafpnum KMGTPEZYyzafpnum kMGTPEZYProject-Id-Version: PACKAGE VERSION Report-Msgid-Bugs-To: pv@ivarch.com PO-Revision-Date: 2025-01-15 19:08+0000 Last-Translator: coralpink Language-Team: Polish Language: pl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=3; plural=n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2; X-Generator: Weblate 5.9.2 (wejÅ›cie)(brak)(stdin)/sBB/sBAJTYÅÄ…czenie PLIK(ów) lub wejÅ›cia standardowego, do wyjÅ›cia standardowego z monitoringiem.ETAPLIKFINFORMATWYSOKOŚĆLicencja: GPLv3+ NAZWALICZBAPIDPID[:FD]ProszÄ™ przesyÅ‚ać zgÅ‚oszenia błędów do %sStrona projektuPRĘDKOŚĆSA_SIGINFO nie jest wspierane na tym systemieSEKUNDYROZMIARSPECSTYLWspierane sekwencje formatowania:Nie udziela siÄ™ GWARANCJI w zakresie dozwolonym przez prawo.To jest wolne oprogramowanie: masz prawo do zmian i redystrybucji.Spróbuj `%s --help' by uzyskać wiÄ™cej informacji.Spróbuj `%s -h' by uzyskać wiÄ™cej informacji.Sposób użycia: %s [OPCJA] [PLIK]...SZEROKOŚĆwysyÅ‚aj postÄ™p również do SPECprzyjmij, że terminal ma wysokość WYSOKOŚĆ liniiprzyjmij, że terminal ma szerokość SZEROKOŚĆ znakówbb/snie udaÅ‚o siÄ™ zaalokować buforanie można przesyÅ‚ać plików z opcjÄ… obserwowania deskryptorów plikównie można użyć pozycjonowania kursora łącznie z opcjÄ… obserwowania deskryptorów plikównie można użyć trybu zliczania linii lub opcji modyfikujÄ…cych przesyÅ‚ łącznie z opcjÄ… obserwowania deskryptorów plikównie można użyć opcji zaktualizowania ustawieÅ„ procesu łącznie z opcjÄ… obserwowania deskryptorów plikówoblicz Å›redniÄ… prÄ™dkość transferu na podstawie poprzednich SEKUNDY sekund (domyÅ›lnie 30 s)zliczaj linie zamiast bajtyzignoruj dane wejÅ›ciowe zamiast wyÅ›wietlić je na wyjÅ›ciu standardowymnie wyÅ›wietlaj nic do momentu upÅ‚yniÄ™cia SEKUNDY sekundnie wyÅ›wietlaj nic aż do pierwszego przesÅ‚anego bajtunie wyÅ›wietlaj żadnych informacji o przesyÅ‚aniunie udaÅ‚o siÄ™ wyczyÅ›cić interwaÅ‚u czasowegonie udaÅ‚o siÄ™ zamknąć plikunie udaÅ‚o siÄ™ ustalić rozmiaru urzÄ…dzenia blokowegonie udaÅ‚o siÄ™ wygenerować nazwy pliku dla sysfsnie udaÅ‚o siÄ™ uzyskać nazwy terminalanie udaÅ‚o siÄ™ otworzyć urzÄ…dzenia blokowegonie udaÅ‚o siÄ™ otworzyć pliku blokowania zasobównie udaÅ‚o siÄ™ otworzyć terminalanie udaÅ‚o siÄ™ odczytać plikunie udaÅ‚o siÄ™ odczytać rozmiaru pliku sysfsnie udaÅ‚o siÄ™ przewinąć za błądnie udaÅ‚o siÄ™ przewinąć wyjÅ›cia do poczÄ…tkunie udaÅ‚o siÄ™ ustawić interwaÅ‚u czasowegonie udaÅ‚o siÄ™ wykonać operacji stat na plikunie udaÅ‚o siÄ™ wykonać operacji stat na pliku wyjÅ›ciowymfdpliku nie da siÄ™ przewijaćnie udaÅ‚o siÄ™ zaalokować listy plikówwymuÅ› zapis pamiÄ™ci podrÄ™cznej na dysk po każdym zapisienie udaÅ‚o siÄ™ zaalokować struktury historiijeÅ›li rozmiar nie jest znany, wyÅ›wietl zestawienie prÄ™dkoÅ›ci do maksymalnej prÄ™dkoÅ›ciplik wejÅ›ciowy jest zarazem plikiem wyjÅ›ciowymoczekiwany argument typu liczby caÅ‚kowitejniepoprawne ID procesujest katalogiemogranicz przesyÅ‚ane dane do PRĘDKOŚĆ bajtów na sekundÄ™alokacja buforu pozycji linii nie powiodÅ‚a siÄ™linie sÄ… zakoÅ„czone znakiem NULblokada zasobów nie powiodÅ‚a siÄ™wiadomość nieodebrananigdy nie używaj splice(), zawsze używaj read/writebrak zaalokowanego bufora transferuplik nie jest plikiem regularnym lub urzÄ…dzeniem blokowymniedostÄ™pne na systemach bez /proc/self/fdinfooczekiwany argument liczbowywartość liczbowa niezrozumiananie udaÅ‚o siÄ™ zaalokować struktur opcjinie udaÅ‚o siÄ™ zaalokować struktur opcji argvpokaż wyjÅ›cie nawet standardowe wyjÅ›cie błędu nie jest terminalemwyÅ›wietl wyjÅ›cie procentowo, bez graficznej prezentacjiwyÅ›wietl na koÅ„cu statystyki transferupidpoprzedź informacje prefiksem NAZWAoczekiwany proces ID lub para PID:FDprÄ™dkość min/Å›r/max/odchprÄ™dkość niezmierzonabłąd odczytuzapisz ID procesu do PLIKnie udaÅ‚o siÄ™ wywoÅ‚ać funkcji selectustaw domyÅ›lny styl paska postÄ™pu na STYLustaw oczekiwany rozmiar danych na ROZMIAR bajtówustaw FORMAT jako format wyjÅ›ciowypokaż ostatnie LICZBA przesÅ‚anych bajtówpokaż bezwzglÄ™dny szacowany czas ukoÅ„czeniapokaż licznik uÅ›rednionej prÄ™dkoÅ›ci przesyÅ‚aniapokaż licznik prÄ™dkoÅ›ci przesyÅ‚aniapokaż upÅ‚ywajÄ…cy czaspokaż szacowany czas ukoÅ„czeniapokaż ilość przesÅ‚anych bitówpokaż ilość przesÅ‚anych bajtówpokaż procentowe użycie bufora transferupokaż pasek postÄ™puwyÅ›wietl te informacje z pomocÄ… i wyjdźwyÅ›wietl informacje o wersji i wyjdźpomijaj błędy w blokach po BAJTY bajtów na razpomijaj błędy odczytu wejÅ›ciapominiÄ™to błąd odczytualokacja stanu programu nie powiodÅ‚a siÄ™zakoÅ„cz po przesÅ‚aniu --size bajtówtraktuj przyrostki jako wielokrotnoÅ›ci 1000 zamiast 1024aktualizuj co każde SEKUNDY sekundzaktualizuj ustawienia procesu PIDużyj bufora o rozmiarze BAJTYużywaj znaków ucieczki do pozycjonowania kursoraużyj bezpoÅ›redniego wejÅ›cia/wyjÅ›cia celem pominiÄ™cia pamiÄ™ci podrÄ™cznejostrzeżenie: błędy odczytu wykryteobserwuj plik FD otworzony przez proces PIDzapisz wszystkie dane wejÅ›ciowe do PLIK przed wyÅ›wietleniem ich na wyjÅ›ciuzapisz logi debugujÄ…ce do PLIKbłąd zapisuzapisz wyjÅ›cie do PLIK zamiast do wyjÅ›cia standardowegoyzafpnum KMGTPEZYyzafpnum kMGTPEZYpv-1.9.31/po/pl.po000066400000000000000000000375371474702661500136560ustar00rootroot00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Free Software Foundation, Inc. # FIRST AUTHOR , YEAR. # msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: pv@ivarch.com\n" "POT-Creation-Date: 2025-01-28 21:21+0000\n" "PO-Revision-Date: 2025-01-15 19:08+0000\n" "Last-Translator: coralpink \n" "Language-Team: Polish \n" "Language: pl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " "|| n%100>=20) ? 1 : 2;\n" "X-Generator: Weblate 5.9.2\n" #: src/main/help.c:236 msgid "show progress bar" msgstr "pokaż pasek postÄ™pu" #: src/main/help.c:239 msgid "show elapsed time" msgstr "pokaż upÅ‚ywajÄ…cy czas" #: src/main/help.c:242 msgid "show estimated time of arrival (completion)" msgstr "pokaż szacowany czas ukoÅ„czenia" #: src/main/help.c:245 msgid "show absolute estimated time of arrival (completion)" msgstr "pokaż bezwzglÄ™dny szacowany czas ukoÅ„czenia" #: src/main/help.c:248 msgid "show data transfer rate counter" msgstr "pokaż licznik prÄ™dkoÅ›ci przesyÅ‚ania" #: src/main/help.c:251 msgid "show data transfer average rate counter" msgstr "pokaż licznik uÅ›rednionej prÄ™dkoÅ›ci przesyÅ‚ania" #: src/main/help.c:254 msgid "show number of bytes transferred" msgstr "pokaż ilość przesÅ‚anych bajtów" #: src/main/help.c:257 msgid "show percentage of transfer buffer in use" msgstr "pokaż procentowe użycie bufora transferu" #: src/main/help.c:259 msgid "NUM" msgstr "LICZBA" #: src/main/help.c:260 msgid "show NUM bytes last written" msgstr "pokaż ostatnie LICZBA przesÅ‚anych bajtów" #: src/main/help.c:262 msgid "FORMAT" msgstr "FORMAT" #: src/main/help.c:263 msgid "set output format to FORMAT" msgstr "ustaw FORMAT jako format wyjÅ›ciowy" #: src/main/help.c:266 msgid "output percentages, not visual information" msgstr "wyÅ›wietl wyjÅ›cie procentowo, bez graficznej prezentacji" #: src/main/help.c:269 msgid "do not output any transfer information at all" msgstr "nie wyÅ›wietlaj żadnych informacji o przesyÅ‚aniu" #: src/main/help.c:273 msgid "show number of bits transferred" msgstr "pokaż ilość przesÅ‚anych bitów" #: src/main/help.c:276 msgid "treat suffixes as multiples of 1000 rather than 1024" msgstr "traktuj przyrostki jako wielokrotnoÅ›ci 1000 zamiast 1024" #: src/main/help.c:279 msgid "display nothing until first byte transferred" msgstr "nie wyÅ›wietlaj nic aż do pierwszego przesÅ‚anego bajtu" #: src/main/help.c:281 src/main/help.c:296 src/main/help.c:299 msgid "SEC" msgstr "SEKUNDY" #: src/main/help.c:282 msgid "display nothing until SEC seconds have passed" msgstr "nie wyÅ›wietlaj nic do momentu upÅ‚yniÄ™cia SEKUNDY sekund" #: src/main/help.c:284 msgid "SIZE" msgstr "ROZMIAR" #: src/main/help.c:285 msgid "set estimated data size to SIZE bytes" msgstr "ustaw oczekiwany rozmiar danych na ROZMIAR bajtów" #: src/main/help.c:288 msgid "if size unknown, show rate vs max rate" msgstr "" "jeÅ›li rozmiar nie jest znany, wyÅ›wietl zestawienie prÄ™dkoÅ›ci do maksymalnej " "prÄ™dkoÅ›ci" #: src/main/help.c:291 msgid "count lines instead of bytes" msgstr "zliczaj linie zamiast bajty" #: src/main/help.c:294 msgid "lines are null-terminated" msgstr "linie sÄ… zakoÅ„czone znakiem NUL" #: src/main/help.c:297 msgid "update every SEC seconds" msgstr "aktualizuj co każde SEKUNDY sekund" #: src/main/help.c:300 msgid "compute average rate over past SEC seconds (default 30s)" msgstr "" "oblicz Å›redniÄ… prÄ™dkość transferu na podstawie poprzednich SEKUNDY sekund " "(domyÅ›lnie 30 s)" #: src/main/help.c:302 msgid "WIDTH" msgstr "SZEROKOŚĆ" #: src/main/help.c:303 msgid "assume terminal is WIDTH characters wide" msgstr "przyjmij, że terminal ma szerokość SZEROKOŚĆ znaków" #: src/main/help.c:305 msgid "HEIGHT" msgstr "WYSOKOŚĆ" #: src/main/help.c:306 msgid "assume terminal is HEIGHT rows high" msgstr "przyjmij, że terminal ma wysokość WYSOKOŚĆ linii" #: src/main/help.c:308 msgid "NAME" msgstr "NAZWA" #: src/main/help.c:309 msgid "prefix visual information with NAME" msgstr "poprzedź informacje prefiksem NAZWA" #: src/main/help.c:311 msgid "STYLE" msgstr "STYL" #: src/main/help.c:312 msgid "set default bar style to NAME" msgstr "ustaw domyÅ›lny styl paska postÄ™pu na STYL" #: src/main/help.c:314 msgid "SPEC" msgstr "SPEC" #: src/main/help.c:315 msgid "also send progress to SPEC" msgstr "wysyÅ‚aj postÄ™p również do SPEC" #: src/main/help.c:318 msgid "output transfer statistics at the end" msgstr "wyÅ›wietl na koÅ„cu statystyki transferu" #: src/main/help.c:321 msgid "output even if standard error is not a terminal" msgstr "pokaż wyjÅ›cie nawet standardowe wyjÅ›cie błędu nie jest terminalem" #: src/main/help.c:324 msgid "use cursor positioning escape sequences" msgstr "używaj znaków ucieczki do pozycjonowania kursora" #: src/main/help.c:327 src/main/help.c:357 src/main/help.c:369 #: src/main/help.c:379 msgid "FILE" msgstr "PLIK" #: src/main/help.c:328 msgid "write output to FILE instead of stdout" msgstr "zapisz wyjÅ›cie do PLIK zamiast do wyjÅ›cia standardowego" #: src/main/help.c:330 msgid "RATE" msgstr "PRĘDKOŚĆ" #: src/main/help.c:331 msgid "limit transfer to RATE bytes per second" msgstr "ogranicz przesyÅ‚ane dane do PRĘDKOŚĆ bajtów na sekundÄ™" #: src/main/help.c:333 src/main/help.c:342 msgid "BYTES" msgstr "BAJTY" #: src/main/help.c:334 msgid "use a buffer size of BYTES" msgstr "użyj bufora o rozmiarze BAJTY" #: src/main/help.c:337 msgid "never use splice(), always use read/write" msgstr "nigdy nie używaj splice(), zawsze używaj read/write" #: src/main/help.c:340 msgid "skip read errors in input" msgstr "pomijaj błędy odczytu wejÅ›cia" #: src/main/help.c:343 msgid "skip errors in BYTES blocks at a time" msgstr "pomijaj błędy w blokach po BAJTY bajtów na raz" #: src/main/help.c:346 msgid "stop after --size bytes have been transferred" msgstr "zakoÅ„cz po przesÅ‚aniu --size bajtów" #: src/main/help.c:349 msgid "flush cache to disk after every write" msgstr "wymuÅ› zapis pamiÄ™ci podrÄ™cznej na dysk po każdym zapisie" #: src/main/help.c:352 msgid "use direct I/O to bypass cache" msgstr "" "użyj bezpoÅ›redniego wejÅ›cia/wyjÅ›cia celem pominiÄ™cia pamiÄ™ci podrÄ™cznej" #: src/main/help.c:355 msgid "discard input instead of writing to output" msgstr "zignoruj dane wejÅ›ciowe zamiast wyÅ›wietlić je na wyjÅ›ciu standardowym" #: src/main/help.c:358 msgid "write all input to FILE before writing to output" msgstr "" "zapisz wszystkie dane wejÅ›ciowe do PLIK przed wyÅ›wietleniem ich na wyjÅ›ciu" #: src/main/help.c:360 msgid "PID[:FD]" msgstr "PID[:FD]" #: src/main/help.c:361 msgid "watch file FD opened by process PID" msgstr "obserwuj plik FD otworzony przez proces PID" #: src/main/help.c:364 msgid "PID" msgstr "PID" #: src/main/help.c:365 msgid "update settings of process PID" msgstr "zaktualizuj ustawienia procesu PID" #: src/main/help.c:370 msgid "save process ID in FILE" msgstr "zapisz ID procesu do PLIK" #: src/main/help.c:373 msgid "show this help and exit" msgstr "wyÅ›wietl te informacje z pomocÄ… i wyjdź" #: src/main/help.c:376 msgid "show version information and exit" msgstr "wyÅ›wietl informacje o wersji i wyjdź" #: src/main/help.c:380 msgid "write debug logs to FILE" msgstr "zapisz logi debugujÄ…ce do PLIK" #: src/main/help.c:406 #, c-format msgid "Usage: %s [OPTION] [FILE]..." msgstr "Sposób użycia: %s [OPCJA] [PLIK]..." #: src/main/help.c:417 msgid "" "Concatenate FILE(s), or standard input, to standard output, with monitoring." msgstr "" "ÅÄ…czenie PLIK(ów) lub wejÅ›cia standardowego, do wyjÅ›cia standardowego z " "monitoringiem." #: src/main/help.c:555 msgid "Supported format sequences:" msgstr "Wspierane sekwencje formatowania:" #: src/main/help.c:569 #, c-format msgid "Please report any bugs to: %s" msgstr "ProszÄ™ przesyÅ‚ać zgÅ‚oszenia błędów do %s" #: src/main/main.c:232 msgid "(input)" msgstr "(wejÅ›cie)" #: src/main/main.c:328 msgid "state allocation failed" msgstr "alokacja stanu programu nie powiodÅ‚a siÄ™" #: src/main/options.c:144 src/pv/file.c:324 msgid "failed to stat file" msgstr "nie udaÅ‚o siÄ™ wykonać operacji stat na pliku" #: src/main/options.c:158 msgid "is a directory" msgstr "jest katalogiem" #: src/main/options.c:187 msgid "failed to generate sysfs filename" msgstr "nie udaÅ‚o siÄ™ wygenerować nazwy pliku dla sysfs" #: src/main/options.c:209 msgid "failed to read sysfs size file" msgstr "nie udaÅ‚o siÄ™ odczytać rozmiaru pliku sysfs" #: src/main/options.c:229 msgid "failed to open block device" msgstr "nie udaÅ‚o siÄ™ otworzyć urzÄ…dzenia blokowego" #: src/main/options.c:239 msgid "failed to determine size of block device" msgstr "nie udaÅ‚o siÄ™ ustalić rozmiaru urzÄ…dzenia blokowego" #: src/main/options.c:345 msgid "option structure allocation failed" msgstr "nie udaÅ‚o siÄ™ zaalokować struktur opcji" #: src/main/options.c:364 msgid "option structure argv allocation failed" msgstr "nie udaÅ‚o siÄ™ zaalokować struktur opcji argv" #: src/main/options.c:417 msgid "numeric value not understood" msgstr "wartość liczbowa niezrozumiana" #: src/main/options.c:435 msgid "integer argument expected" msgstr "oczekiwany argument typu liczby caÅ‚kowitej" #: src/main/options.c:447 msgid "numeric argument expected" msgstr "oczekiwany argument liczbowy" #: src/main/options.c:458 msgid "process ID or pid:fd pair expected" msgstr "oczekiwany proces ID lub para PID:FD" #: src/main/options.c:465 msgid "invalid process ID" msgstr "niepoprawne ID procesu" #: src/main/options.c:698 #, c-format msgid "Try `%s --help' for more information." msgstr "Spróbuj `%s --help' by uzyskać wiÄ™cej informacji." #: src/main/options.c:700 #, c-format msgid "Try `%s -h' for more information." msgstr "Spróbuj `%s -h' by uzyskać wiÄ™cej informacji." #: src/main/options.c:731 msgid "" "cannot use line mode or transfer modifier options when watching file " "descriptors" msgstr "" "nie można użyć trybu zliczania linii lub opcji modyfikujÄ…cych przesyÅ‚ " "łącznie z opcjÄ… obserwowania deskryptorów plików" #: src/main/options.c:740 msgid "cannot use cursor positioning when watching file descriptors" msgstr "" "nie można użyć pozycjonowania kursora łącznie z opcjÄ… obserwowania " "deskryptorów plików" #: src/main/options.c:749 msgid "cannot use remote control when watching file descriptors" msgstr "" "nie można użyć opcji zaktualizowania ustawieÅ„ procesu łącznie z opcjÄ… " "obserwowania deskryptorów plików" #: src/main/options.c:758 msgid "cannot transfer files when watching file descriptors" msgstr "nie można przesyÅ‚ać plików z opcjÄ… obserwowania deskryptorów plików" #: src/main/options.c:773 msgid "not available on systems without /proc/self/fdinfo" msgstr "niedostÄ™pne na systemach bez /proc/self/fdinfo" #: src/main/remote.c:309 msgid "message not received" msgstr "wiadomość nieodebrana" #: src/main/remote.c:440 msgid "SA_SIGINFO not supported on this system" msgstr "SA_SIGINFO nie jest wspierane na tym systemie" #: src/main/version.c:28 msgid "License: GPLv3+ " msgstr "Licencja: GPLv3+ " #: src/main/version.c:29 msgid "This is free software: you are free to change and redistribute it." msgstr "To jest wolne oprogramowanie: masz prawo do zmian i redystrybucji." #: src/main/version.c:30 msgid "There is NO WARRANTY, to the extent permitted by law." msgstr "Nie udziela siÄ™ GWARANCJI w zakresie dozwolonym przez prawo." #: src/main/version.c:32 msgid "Project web site" msgstr "Strona projektu" #: src/pv/cursor.c:61 msgid "failed to get terminal name" msgstr "nie udaÅ‚o siÄ™ uzyskać nazwy terminala" # "Przewidywany czas ukoÅ„czenia" for ETA is too long #: src/pv/cursor.c:106 msgid "failed to open lock file" msgstr "nie udaÅ‚o siÄ™ otworzyć pliku blokowania zasobów" #: src/pv/cursor.c:139 msgid "lock attempt failed" msgstr "blokada zasobów nie powiodÅ‚a siÄ™" #: src/pv/cursor.c:400 msgid "failed to open terminal" msgstr "nie udaÅ‚o siÄ™ otworzyć terminala" #: src/pv/display.c:249 msgid "yzafpnum kMGTPEZY" msgstr "yzafpnum kMGTPEZY" #: src/pv/display.c:267 msgid "yzafpnum KMGTPEZY" msgstr "yzafpnum KMGTPEZY" #: src/pv/display.c:989 src/pv/transfer.c:1056 msgid "buffer allocation failed" msgstr "nie udaÅ‚o siÄ™ zaalokować bufora" #: src/pv/file.c:149 msgid "failed to seek to start of output" msgstr "nie udaÅ‚o siÄ™ przewinąć wyjÅ›cia do poczÄ…tku" # "Przewidywany czas ukoÅ„czenia" for ETA is too long #: src/pv/file.c:294 msgid "failed to close file" msgstr "nie udaÅ‚o siÄ™ zamknąć pliku" #: src/pv/file.c:317 msgid "failed to read file" msgstr "nie udaÅ‚o siÄ™ odczytać pliku" #: src/pv/file.c:332 msgid "failed to stat output file" msgstr "nie udaÅ‚o siÄ™ wykonać operacji stat na pliku wyjÅ›ciowym" #: src/pv/file.c:354 msgid "input file is output file" msgstr "plik wejÅ›ciowy jest zarazem plikiem wyjÅ›ciowym" #: src/pv/file.c:412 msgid "(none)" msgstr "(brak)" #: src/pv/file.c:414 msgid "(stdin)" msgstr "(stdin)" #: src/pv/format/averagerate.c:34 src/pv/format/progressbar.c:93 #: src/pv/format/rate.c:37 src/pv/loop.c:551 msgid "b/s" msgstr "b/s" #: src/pv/format/averagerate.c:38 src/pv/format/progressbar.c:97 #: src/pv/format/rate.c:41 msgid "/s" msgstr "/s" #: src/pv/format/averagerate.c:38 src/pv/format/progressbar.c:97 #: src/pv/format/rate.c:41 src/pv/loop.c:551 msgid "B/s" msgstr "B/s" #: src/pv/format/bytes.c:37 msgid "b" msgstr "b" #: src/pv/format/bytes.c:41 src/pv/transfer.c:594 msgid "B" msgstr "B" #: src/pv/format/eta.c:53 src/pv/format/eta.c:57 msgid "ETA" msgstr "ETA" #: src/pv/format/fineta.c:81 msgid "FIN" msgstr "FIN" #: src/pv/loop.c:550 msgid "rate min/avg/max/mdev" msgstr "prÄ™dkość min/Å›r/max/odch" #: src/pv/loop.c:562 msgid "rate not measured" msgstr "prÄ™dkość niezmierzona" #: src/pv/loop.c:772 src/pv/loop.c:823 src/pv/loop.c:876 src/pv/watchpid.c:99 #: src/pv/watchpid.c:109 src/pv/watchpid.c:120 src/pv/watchpid.c:128 #: src/pv/watchpid.c:165 src/pv/watchpid.c:184 src/pv/watchpid.c:192 #: src/pv/watchpid.c:202 src/pv/watchpid.c:300 src/pv/watchpid.c:308 #: src/pv/watchpid.c:385 src/pv/watchpid.c:406 msgid "pid" msgstr "pid" #: src/pv/state.c:40 msgid "history structure allocation failed" msgstr "nie udaÅ‚o siÄ™ zaalokować struktury historii" #: src/pv/state.c:617 src/pv/state.c:628 msgid "file list allocation failed" msgstr "nie udaÅ‚o siÄ™ zaalokować listy plików" #: src/pv/transfer.c:463 msgid "read failed" msgstr "błąd odczytu" #: src/pv/transfer.c:479 msgid "warning: read errors detected" msgstr "ostrzeżenie: błędy odczytu wykryte" #: src/pv/transfer.c:495 msgid "file is not seekable" msgstr "pliku nie da siÄ™ przewijać" #: src/pv/transfer.c:573 msgid "failed to seek past error" msgstr "nie udaÅ‚o siÄ™ przewinąć za błąd" #: src/pv/transfer.c:593 msgid "skipped past read error" msgstr "pominiÄ™to błąd odczytu" #: src/pv/transfer.c:634 msgid "no transfer buffer allocated" msgstr "brak zaalokowanego bufora transferu" #: src/pv/transfer.c:676 msgid "failed to set interval timer" msgstr "nie udaÅ‚o siÄ™ ustawić interwaÅ‚u czasowego" # "Przewidywany czas ukoÅ„czenia" for ETA is too long #: src/pv/transfer.c:702 msgid "failed to clear interval timer" msgstr "nie udaÅ‚o siÄ™ wyczyÅ›cić interwaÅ‚u czasowego" #: src/pv/transfer.c:744 msgid "line position buffer allocation failed" msgstr "alokacja buforu pozycji linii nie powiodÅ‚a siÄ™" #: src/pv/transfer.c:917 msgid "write failed" msgstr "błąd zapisu" #: src/pv/transfer.c:1154 msgid "select call failed" msgstr "nie udaÅ‚o siÄ™ wywoÅ‚ać funkcji select" #: src/pv/watchpid.c:109 src/pv/watchpid.c:121 src/pv/watchpid.c:130 #: src/pv/watchpid.c:184 src/pv/watchpid.c:193 src/pv/watchpid.c:204 msgid "fd" msgstr "fd" #: src/pv/watchpid.c:130 src/pv/watchpid.c:204 msgid "not a regular file or block device" msgstr "plik nie jest plikiem regularnym lub urzÄ…dzeniem blokowym" pv-1.9.31/po/pt.gmo000066400000000000000000000161721474702661500140220ustar00rootroot00000000000000Þ•Jle¼PQLU¢¦'Ä%ì!4#Q(už4·<ìP)8z³-Ð,þ-+ Y n Š £ » Ï !é   : O i ƒ '– ¾ Ø ì ) "+ 2N  "› '¾ /æ * #A "e ˆ ” ¬ %¿ å  4 'R z š +¬ Ø )ù #5!Mo‰¡-¹ç':b#€ ¤&±ØWÜ4-8'f-Ž)¼ æ66>u@ŒOÍqFÖ8ô,-3Zަ!Åçÿ,/%\/‚!²,Ô05f…¢)¹5ã2L+i0•8Æ7ÿ)7%a‡—"µ1Ø' )2+\:ˆÃâ"ö(6By"”·#Ñõ'06*g,’!¿5á",:g)3<H(A$/#9=%0 ' B.* D+:>-? !4&@GI7;6E 21,JCF 5"8B/sConcatenate FILE(s), or standard input, to standard output, with monitoring.ETAPlease report any bugs to: %sSA_SIGINFO not supported on this systemTry `%s --help' for more information.Try `%s -h' for more information.Usage: %s [OPTION] [FILE]...assume terminal is HEIGHT rows highassume terminal is WIDTH characters widebuffer allocation failedcannot transfer files when watching file descriptorscannot use cursor positioning when watching file descriptorscannot use line mode or transfer modifier options when watching file descriptorscannot use remote control when watching file descriptorscount lines instead of bytesdisplay nothing until SEC seconds have passeddisplay nothing until first byte transferreddo not output any transfer information at allfailed to close filefailed to get terminal namefailed to open lock filefailed to open terminalfailed to read filefailed to seek past errorfailed to seek to start of outputfailed to stat filefailed to stat output filefile is not seekableinput file is output fileinteger argument expectedinvalid process IDlimit transfer to RATE bytes per secondlines are null-terminatedlock attempt failedmessage not receivednever use splice(), always use read/writenot a regular file or block devicenot available on systems without /proc/self/fdinfonumeric argument expectedoption structure allocation failedoption structure argv allocation failedoutput even if standard error is not a terminaloutput percentages, not visual informationprefix visual information with NAMEprocess ID or pid:fd pair expectedread failedsave process ID in FILEselect call failedset estimated data size to SIZE bytesset output format to FORMATshow NUM bytes last writtenshow absolute estimated time of arrival (completion)show data transfer average rate countershow data transfer rate countershow elapsed timeshow estimated time of arrival (completion)show number of bytes transferredshow percentage of transfer buffer in useshow progress barshow this help and exitshow version information and exitskip read errors in inputskipped past read errorstate allocation failedstop after --size bytes have been transferredupdate every SEC secondsupdate settings of process PIDuse a buffer size of BYTESuse cursor positioning escape sequenceswarning: read errors detectedwatch file FD opened by process PIDwrite failedProject-Id-Version: PACKAGE VERSION Report-Msgid-Bugs-To: pv@ivarch.com PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE Last-Translator: FULL NAME Language-Team: LANGUAGE Language: pt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit B/sConcatena ARQUIVO(s) ou a entrada padrão e grava na saída padrão, com monitoramento.ETAPor favor, reporte quaisquer defeitos para %sSA_SIGINFO não suportado neste sistemaTente `%s --help' para maiores informações.Tente `%s -h' para maiores informações.Uso: %s [OPÇÕES] [ARQUIVOS]...presuma que o terminal tem HEIGHT caracteres de alturapresuma que o terminal tem WIDTH caracteres de larguraerro alocando o buffernão pode transferir arquivos ao assistir descritores de arquivonão pode usar o posicionamento do cursor ao observar os descritores de arquivonão pode usar o modo de linha ou opções de modificador de transferência ao assistir os descritores de arquivonão pode usar o controle remoto ao assistir os descritores de arquivocontar linhas em vez de bytesnão exibir nada até que os segundos SEC tenham passadonão exibe nada até iniciar o processamentoexecuta programa sem exibir quaisquer informaçõeserro fechando o arquivoerro ao ler o nome do terminalerro ao abrir arquivo de bloqueioerro abrindo o terminalerro lendo o arquivonão pode ir além do erronão pode mover para o início da produçãoerro obtendo informações do arquivoerro obtendo informações do arquivo de saídanão pode mover dentro do arquivoos arquivos de entrada e saída são o mesmoargumento inteiro esperadoID de processo inválidolimita a transferência a RATE bytes por segundolinhas são terminadas em nulotentativa de bloqueio falhoumensagem não recebidanunca use splice(), sempre use read/writenão é um arquivo regular ou dispositivo de bloqueionão disponível em sistemas sem /proc/self/fdinfoargumento numérico esperadoerro na alocação da estrutura de opçõeserro na alocação da estrutura de opções argvgera dados mesmo que a saída de erro seja redirecionadaexibe apenas as porcentagens, sem informações visuaisexibe NAME antes das demais informaçõesID do processo ou par pid:fd esperadoerro de leiturasalvar ID do processo em FILEerro na chamada da função selectseta a quantidade estimada de dados em SIZE bytesdefinir o formato de saída para FORMATexibe NUM bytes gravados pela última vezexibe o tempo absoluto estimado de términoexibe o contador da taxa média de transferência de dadosexibe a taxa de transferênciaexibe tempo passadoexibe o tempo estimado de términoexibe a quantidade de bytes transferidosexibe a porcentagem de buffer de transferência em usoexibe barra de progressãoexibe esta tela de ajuda e terminaexibe a versão e terminaignorar erros de leitura em entradaignorado erro de leituraalocação de memória de status falhouparar após --size bytes terem sido transferidosatualiza informações a cada SEC segundosatualizar as configurações do processo PIDuse um tamanho de buffer de BYTESutiliza caracteres de escape para posicionar o cursoraviso: erros de leitura detectadosassistir arquivo FD aberto pelo processo PIDerro de gravaçãopv-1.9.31/po/pt.po000066400000000000000000000327301474702661500136540ustar00rootroot00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Free Software Foundation, Inc. # FIRST AUTHOR , YEAR. # msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: pv@ivarch.com\n" "POT-Creation-Date: 2025-01-28 21:21+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: pt\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: src/main/help.c:236 msgid "show progress bar" msgstr "exibe barra de progressão" #: src/main/help.c:239 msgid "show elapsed time" msgstr "exibe tempo passado" #: src/main/help.c:242 msgid "show estimated time of arrival (completion)" msgstr "exibe o tempo estimado de término" #: src/main/help.c:245 msgid "show absolute estimated time of arrival (completion)" msgstr "exibe o tempo absoluto estimado de término" #: src/main/help.c:248 msgid "show data transfer rate counter" msgstr "exibe a taxa de transferência" #: src/main/help.c:251 msgid "show data transfer average rate counter" msgstr "exibe o contador da taxa média de transferência de dados" #: src/main/help.c:254 msgid "show number of bytes transferred" msgstr "exibe a quantidade de bytes transferidos" #: src/main/help.c:257 msgid "show percentage of transfer buffer in use" msgstr "exibe a porcentagem de buffer de transferência em uso" #: src/main/help.c:259 msgid "NUM" msgstr "" #: src/main/help.c:260 msgid "show NUM bytes last written" msgstr "exibe NUM bytes gravados pela última vez" #: src/main/help.c:262 msgid "FORMAT" msgstr "" #: src/main/help.c:263 msgid "set output format to FORMAT" msgstr "definir o formato de saída para FORMAT" #: src/main/help.c:266 msgid "output percentages, not visual information" msgstr "exibe apenas as porcentagens, sem informações visuais" #: src/main/help.c:269 msgid "do not output any transfer information at all" msgstr "executa programa sem exibir quaisquer informações" #: src/main/help.c:273 msgid "show number of bits transferred" msgstr "" #: src/main/help.c:276 msgid "treat suffixes as multiples of 1000 rather than 1024" msgstr "" #: src/main/help.c:279 msgid "display nothing until first byte transferred" msgstr "não exibe nada até iniciar o processamento" #: src/main/help.c:281 src/main/help.c:296 src/main/help.c:299 msgid "SEC" msgstr "" #: src/main/help.c:282 msgid "display nothing until SEC seconds have passed" msgstr "não exibir nada até que os segundos SEC tenham passado" #: src/main/help.c:284 msgid "SIZE" msgstr "" #: src/main/help.c:285 msgid "set estimated data size to SIZE bytes" msgstr "seta a quantidade estimada de dados em SIZE bytes" #: src/main/help.c:288 msgid "if size unknown, show rate vs max rate" msgstr "" #: src/main/help.c:291 msgid "count lines instead of bytes" msgstr "contar linhas em vez de bytes" #: src/main/help.c:294 msgid "lines are null-terminated" msgstr "linhas são terminadas em nulo" #: src/main/help.c:297 msgid "update every SEC seconds" msgstr "atualiza informações a cada SEC segundos" #: src/main/help.c:300 msgid "compute average rate over past SEC seconds (default 30s)" msgstr "" #: src/main/help.c:302 msgid "WIDTH" msgstr "" #: src/main/help.c:303 msgid "assume terminal is WIDTH characters wide" msgstr "presuma que o terminal tem WIDTH caracteres de largura" #: src/main/help.c:305 msgid "HEIGHT" msgstr "" #: src/main/help.c:306 msgid "assume terminal is HEIGHT rows high" msgstr "presuma que o terminal tem HEIGHT caracteres de altura" #: src/main/help.c:308 msgid "NAME" msgstr "" #: src/main/help.c:309 msgid "prefix visual information with NAME" msgstr "exibe NAME antes das demais informações" #: src/main/help.c:311 msgid "STYLE" msgstr "" #: src/main/help.c:312 msgid "set default bar style to NAME" msgstr "" #: src/main/help.c:314 msgid "SPEC" msgstr "" #: src/main/help.c:315 msgid "also send progress to SPEC" msgstr "" #: src/main/help.c:318 msgid "output transfer statistics at the end" msgstr "" #: src/main/help.c:321 msgid "output even if standard error is not a terminal" msgstr "gera dados mesmo que a saída de erro seja redirecionada" #: src/main/help.c:324 msgid "use cursor positioning escape sequences" msgstr "utiliza caracteres de escape para posicionar o cursor" #: src/main/help.c:327 src/main/help.c:357 src/main/help.c:369 #: src/main/help.c:379 msgid "FILE" msgstr "" #: src/main/help.c:328 msgid "write output to FILE instead of stdout" msgstr "" #: src/main/help.c:330 msgid "RATE" msgstr "" #: src/main/help.c:331 msgid "limit transfer to RATE bytes per second" msgstr "limita a transferência a RATE bytes por segundo" #: src/main/help.c:333 src/main/help.c:342 msgid "BYTES" msgstr "" #: src/main/help.c:334 msgid "use a buffer size of BYTES" msgstr "use um tamanho de buffer de BYTES" #: src/main/help.c:337 msgid "never use splice(), always use read/write" msgstr "nunca use splice(), sempre use read/write" #: src/main/help.c:340 msgid "skip read errors in input" msgstr "ignorar erros de leitura em entrada" #: src/main/help.c:343 msgid "skip errors in BYTES blocks at a time" msgstr "" #: src/main/help.c:346 msgid "stop after --size bytes have been transferred" msgstr "parar após --size bytes terem sido transferidos" #: src/main/help.c:349 msgid "flush cache to disk after every write" msgstr "" #: src/main/help.c:352 msgid "use direct I/O to bypass cache" msgstr "" #: src/main/help.c:355 msgid "discard input instead of writing to output" msgstr "" #: src/main/help.c:358 msgid "write all input to FILE before writing to output" msgstr "" #: src/main/help.c:360 msgid "PID[:FD]" msgstr "" #: src/main/help.c:361 msgid "watch file FD opened by process PID" msgstr "assistir arquivo FD aberto pelo processo PID" #: src/main/help.c:364 msgid "PID" msgstr "" #: src/main/help.c:365 msgid "update settings of process PID" msgstr "atualizar as configurações do processo PID" #: src/main/help.c:370 msgid "save process ID in FILE" msgstr "salvar ID do processo em FILE" #: src/main/help.c:373 msgid "show this help and exit" msgstr "exibe esta tela de ajuda e termina" #: src/main/help.c:376 msgid "show version information and exit" msgstr "exibe a versão e termina" #: src/main/help.c:380 msgid "write debug logs to FILE" msgstr "" #: src/main/help.c:406 #, c-format msgid "Usage: %s [OPTION] [FILE]..." msgstr "Uso: %s [OPÇÕES] [ARQUIVOS]..." #: src/main/help.c:417 msgid "" "Concatenate FILE(s), or standard input, to standard output, with monitoring." msgstr "" "Concatena ARQUIVO(s) ou a entrada padrão e grava na saída padrão, com " "monitoramento." #: src/main/help.c:555 msgid "Supported format sequences:" msgstr "" #: src/main/help.c:569 #, c-format msgid "Please report any bugs to: %s" msgstr "Por favor, reporte quaisquer defeitos para %s" #: src/main/main.c:232 msgid "(input)" msgstr "" #: src/main/main.c:328 msgid "state allocation failed" msgstr "alocação de memória de status falhou" #: src/main/options.c:144 src/pv/file.c:324 msgid "failed to stat file" msgstr "erro obtendo informações do arquivo" #: src/main/options.c:158 msgid "is a directory" msgstr "" #: src/main/options.c:187 msgid "failed to generate sysfs filename" msgstr "" #: src/main/options.c:209 msgid "failed to read sysfs size file" msgstr "" #: src/main/options.c:229 msgid "failed to open block device" msgstr "" #: src/main/options.c:239 msgid "failed to determine size of block device" msgstr "" #: src/main/options.c:345 msgid "option structure allocation failed" msgstr "erro na alocação da estrutura de opções" #: src/main/options.c:364 msgid "option structure argv allocation failed" msgstr "erro na alocação da estrutura de opções argv" #: src/main/options.c:417 msgid "numeric value not understood" msgstr "" #: src/main/options.c:435 msgid "integer argument expected" msgstr "argumento inteiro esperado" #: src/main/options.c:447 msgid "numeric argument expected" msgstr "argumento numérico esperado" #: src/main/options.c:458 msgid "process ID or pid:fd pair expected" msgstr "ID do processo ou par pid:fd esperado" #: src/main/options.c:465 msgid "invalid process ID" msgstr "ID de processo inválido" #: src/main/options.c:698 #, c-format msgid "Try `%s --help' for more information." msgstr "Tente `%s --help' para maiores informações." #: src/main/options.c:700 #, c-format msgid "Try `%s -h' for more information." msgstr "Tente `%s -h' para maiores informações." #: src/main/options.c:731 msgid "" "cannot use line mode or transfer modifier options when watching file " "descriptors" msgstr "" "não pode usar o modo de linha ou opções de modificador de transferência ao " "assistir os descritores de arquivo" #: src/main/options.c:740 msgid "cannot use cursor positioning when watching file descriptors" msgstr "" "não pode usar o posicionamento do cursor ao observar os descritores de " "arquivo" #: src/main/options.c:749 msgid "cannot use remote control when watching file descriptors" msgstr "não pode usar o controle remoto ao assistir os descritores de arquivo" #: src/main/options.c:758 msgid "cannot transfer files when watching file descriptors" msgstr "não pode transferir arquivos ao assistir descritores de arquivo" #: src/main/options.c:773 msgid "not available on systems without /proc/self/fdinfo" msgstr "não disponível em sistemas sem /proc/self/fdinfo" #: src/main/remote.c:309 msgid "message not received" msgstr "mensagem não recebida" #: src/main/remote.c:440 msgid "SA_SIGINFO not supported on this system" msgstr "SA_SIGINFO não suportado neste sistema" #: src/main/version.c:28 msgid "License: GPLv3+ " msgstr "" #: src/main/version.c:29 msgid "This is free software: you are free to change and redistribute it." msgstr "" #: src/main/version.c:30 msgid "There is NO WARRANTY, to the extent permitted by law." msgstr "" #: src/main/version.c:32 msgid "Project web site" msgstr "" #: src/pv/cursor.c:61 msgid "failed to get terminal name" msgstr "erro ao ler o nome do terminal" #: src/pv/cursor.c:106 msgid "failed to open lock file" msgstr "erro ao abrir arquivo de bloqueio" #: src/pv/cursor.c:139 msgid "lock attempt failed" msgstr "tentativa de bloqueio falhou" #: src/pv/cursor.c:400 msgid "failed to open terminal" msgstr "erro abrindo o terminal" #: src/pv/display.c:249 msgid "yzafpnum kMGTPEZY" msgstr "" #: src/pv/display.c:267 msgid "yzafpnum KMGTPEZY" msgstr "" #: src/pv/display.c:989 src/pv/transfer.c:1056 msgid "buffer allocation failed" msgstr "erro alocando o buffer" #: src/pv/file.c:149 msgid "failed to seek to start of output" msgstr "não pode mover para o início da produção" #: src/pv/file.c:294 msgid "failed to close file" msgstr "erro fechando o arquivo" #: src/pv/file.c:317 msgid "failed to read file" msgstr "erro lendo o arquivo" #: src/pv/file.c:332 msgid "failed to stat output file" msgstr "erro obtendo informações do arquivo de saída" #: src/pv/file.c:354 msgid "input file is output file" msgstr "os arquivos de entrada e saída são o mesmo" #: src/pv/file.c:412 msgid "(none)" msgstr "" #: src/pv/file.c:414 msgid "(stdin)" msgstr "" #: src/pv/format/averagerate.c:34 src/pv/format/progressbar.c:93 #: src/pv/format/rate.c:37 src/pv/loop.c:551 msgid "b/s" msgstr "" #: src/pv/format/averagerate.c:38 src/pv/format/progressbar.c:97 #: src/pv/format/rate.c:41 msgid "/s" msgstr "" #: src/pv/format/averagerate.c:38 src/pv/format/progressbar.c:97 #: src/pv/format/rate.c:41 src/pv/loop.c:551 msgid "B/s" msgstr "B/s" #: src/pv/format/bytes.c:37 msgid "b" msgstr "" #: src/pv/format/bytes.c:41 src/pv/transfer.c:594 msgid "B" msgstr "" #: src/pv/format/eta.c:53 src/pv/format/eta.c:57 msgid "ETA" msgstr "ETA" #: src/pv/format/fineta.c:81 msgid "FIN" msgstr "" #: src/pv/loop.c:550 msgid "rate min/avg/max/mdev" msgstr "" #: src/pv/loop.c:562 msgid "rate not measured" msgstr "" #: src/pv/loop.c:772 src/pv/loop.c:823 src/pv/loop.c:876 src/pv/watchpid.c:99 #: src/pv/watchpid.c:109 src/pv/watchpid.c:120 src/pv/watchpid.c:128 #: src/pv/watchpid.c:165 src/pv/watchpid.c:184 src/pv/watchpid.c:192 #: src/pv/watchpid.c:202 src/pv/watchpid.c:300 src/pv/watchpid.c:308 #: src/pv/watchpid.c:385 src/pv/watchpid.c:406 msgid "pid" msgstr "" #: src/pv/state.c:40 msgid "history structure allocation failed" msgstr "" #: src/pv/state.c:617 src/pv/state.c:628 msgid "file list allocation failed" msgstr "" #: src/pv/transfer.c:463 msgid "read failed" msgstr "erro de leitura" #: src/pv/transfer.c:479 msgid "warning: read errors detected" msgstr "aviso: erros de leitura detectados" #: src/pv/transfer.c:495 msgid "file is not seekable" msgstr "não pode mover dentro do arquivo" #: src/pv/transfer.c:573 msgid "failed to seek past error" msgstr "não pode ir além do erro" #: src/pv/transfer.c:593 msgid "skipped past read error" msgstr "ignorado erro de leitura" #: src/pv/transfer.c:634 msgid "no transfer buffer allocated" msgstr "" #: src/pv/transfer.c:676 msgid "failed to set interval timer" msgstr "" #: src/pv/transfer.c:702 msgid "failed to clear interval timer" msgstr "" #: src/pv/transfer.c:744 msgid "line position buffer allocation failed" msgstr "" #: src/pv/transfer.c:917 msgid "write failed" msgstr "erro de gravação" #: src/pv/transfer.c:1154 msgid "select call failed" msgstr "erro na chamada da função select" #: src/pv/watchpid.c:109 src/pv/watchpid.c:121 src/pv/watchpid.c:130 #: src/pv/watchpid.c:184 src/pv/watchpid.c:193 src/pv/watchpid.c:204 msgid "fd" msgstr "" #: src/pv/watchpid.c:130 src/pv/watchpid.c:204 msgid "not a regular file or block device" msgstr "não é um arquivo regular ou dispositivo de bloqueio" pv-1.9.31/po/pv.pot000066400000000000000000000252421474702661500140420ustar00rootroot00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Andrew Wood # This file is distributed under the same license as the pv package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: pv 1.9.31\n" "Report-Msgid-Bugs-To: pv@ivarch.com\n" "POT-Creation-Date: 2025-01-28 21:21+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" #: src/main/help.c:236 msgid "show progress bar" msgstr "" #: src/main/help.c:239 msgid "show elapsed time" msgstr "" #: src/main/help.c:242 msgid "show estimated time of arrival (completion)" msgstr "" #: src/main/help.c:245 msgid "show absolute estimated time of arrival (completion)" msgstr "" #: src/main/help.c:248 msgid "show data transfer rate counter" msgstr "" #: src/main/help.c:251 msgid "show data transfer average rate counter" msgstr "" #: src/main/help.c:254 msgid "show number of bytes transferred" msgstr "" #: src/main/help.c:257 msgid "show percentage of transfer buffer in use" msgstr "" #: src/main/help.c:259 msgid "NUM" msgstr "" #: src/main/help.c:260 msgid "show NUM bytes last written" msgstr "" #: src/main/help.c:262 msgid "FORMAT" msgstr "" #: src/main/help.c:263 msgid "set output format to FORMAT" msgstr "" #: src/main/help.c:266 msgid "output percentages, not visual information" msgstr "" #: src/main/help.c:269 msgid "do not output any transfer information at all" msgstr "" #: src/main/help.c:273 msgid "show number of bits transferred" msgstr "" #: src/main/help.c:276 msgid "treat suffixes as multiples of 1000 rather than 1024" msgstr "" #: src/main/help.c:279 msgid "display nothing until first byte transferred" msgstr "" #: src/main/help.c:281 src/main/help.c:296 src/main/help.c:299 msgid "SEC" msgstr "" #: src/main/help.c:282 msgid "display nothing until SEC seconds have passed" msgstr "" #: src/main/help.c:284 msgid "SIZE" msgstr "" #: src/main/help.c:285 msgid "set estimated data size to SIZE bytes" msgstr "" #: src/main/help.c:288 msgid "if size unknown, show rate vs max rate" msgstr "" #: src/main/help.c:291 msgid "count lines instead of bytes" msgstr "" #: src/main/help.c:294 msgid "lines are null-terminated" msgstr "" #: src/main/help.c:297 msgid "update every SEC seconds" msgstr "" #: src/main/help.c:300 msgid "compute average rate over past SEC seconds (default 30s)" msgstr "" #: src/main/help.c:302 msgid "WIDTH" msgstr "" #: src/main/help.c:303 msgid "assume terminal is WIDTH characters wide" msgstr "" #: src/main/help.c:305 msgid "HEIGHT" msgstr "" #: src/main/help.c:306 msgid "assume terminal is HEIGHT rows high" msgstr "" #: src/main/help.c:308 msgid "NAME" msgstr "" #: src/main/help.c:309 msgid "prefix visual information with NAME" msgstr "" #: src/main/help.c:311 msgid "STYLE" msgstr "" #: src/main/help.c:312 msgid "set default bar style to NAME" msgstr "" #: src/main/help.c:314 msgid "SPEC" msgstr "" #: src/main/help.c:315 msgid "also send progress to SPEC" msgstr "" #: src/main/help.c:318 msgid "output transfer statistics at the end" msgstr "" #: src/main/help.c:321 msgid "output even if standard error is not a terminal" msgstr "" #: src/main/help.c:324 msgid "use cursor positioning escape sequences" msgstr "" #: src/main/help.c:327 src/main/help.c:357 src/main/help.c:369 #: src/main/help.c:379 msgid "FILE" msgstr "" #: src/main/help.c:328 msgid "write output to FILE instead of stdout" msgstr "" #: src/main/help.c:330 msgid "RATE" msgstr "" #: src/main/help.c:331 msgid "limit transfer to RATE bytes per second" msgstr "" #: src/main/help.c:333 src/main/help.c:342 msgid "BYTES" msgstr "" #: src/main/help.c:334 msgid "use a buffer size of BYTES" msgstr "" #: src/main/help.c:337 msgid "never use splice(), always use read/write" msgstr "" #: src/main/help.c:340 msgid "skip read errors in input" msgstr "" #: src/main/help.c:343 msgid "skip errors in BYTES blocks at a time" msgstr "" #: src/main/help.c:346 msgid "stop after --size bytes have been transferred" msgstr "" #: src/main/help.c:349 msgid "flush cache to disk after every write" msgstr "" #: src/main/help.c:352 msgid "use direct I/O to bypass cache" msgstr "" #: src/main/help.c:355 msgid "discard input instead of writing to output" msgstr "" #: src/main/help.c:358 msgid "write all input to FILE before writing to output" msgstr "" #: src/main/help.c:360 msgid "PID[:FD]" msgstr "" #: src/main/help.c:361 msgid "watch file FD opened by process PID" msgstr "" #: src/main/help.c:364 msgid "PID" msgstr "" #: src/main/help.c:365 msgid "update settings of process PID" msgstr "" #: src/main/help.c:370 msgid "save process ID in FILE" msgstr "" #: src/main/help.c:373 msgid "show this help and exit" msgstr "" #: src/main/help.c:376 msgid "show version information and exit" msgstr "" #: src/main/help.c:380 msgid "write debug logs to FILE" msgstr "" #: src/main/help.c:406 #, c-format msgid "Usage: %s [OPTION] [FILE]..." msgstr "" #: src/main/help.c:417 msgid "" "Concatenate FILE(s), or standard input, to standard output, with monitoring." msgstr "" #: src/main/help.c:555 msgid "Supported format sequences:" msgstr "" #: src/main/help.c:569 #, c-format msgid "Please report any bugs to: %s" msgstr "" #: src/main/main.c:232 msgid "(input)" msgstr "" #: src/main/main.c:328 msgid "state allocation failed" msgstr "" #: src/main/options.c:144 src/pv/file.c:324 msgid "failed to stat file" msgstr "" #: src/main/options.c:158 msgid "is a directory" msgstr "" #: src/main/options.c:187 msgid "failed to generate sysfs filename" msgstr "" #: src/main/options.c:209 msgid "failed to read sysfs size file" msgstr "" #: src/main/options.c:229 msgid "failed to open block device" msgstr "" #: src/main/options.c:239 msgid "failed to determine size of block device" msgstr "" #: src/main/options.c:345 msgid "option structure allocation failed" msgstr "" #: src/main/options.c:364 msgid "option structure argv allocation failed" msgstr "" #: src/main/options.c:417 msgid "numeric value not understood" msgstr "" #: src/main/options.c:435 msgid "integer argument expected" msgstr "" #: src/main/options.c:447 msgid "numeric argument expected" msgstr "" #: src/main/options.c:458 msgid "process ID or pid:fd pair expected" msgstr "" #: src/main/options.c:465 msgid "invalid process ID" msgstr "" #: src/main/options.c:698 #, c-format msgid "Try `%s --help' for more information." msgstr "" #: src/main/options.c:700 #, c-format msgid "Try `%s -h' for more information." msgstr "" #: src/main/options.c:731 msgid "" "cannot use line mode or transfer modifier options when watching file " "descriptors" msgstr "" #: src/main/options.c:740 msgid "cannot use cursor positioning when watching file descriptors" msgstr "" #: src/main/options.c:749 msgid "cannot use remote control when watching file descriptors" msgstr "" #: src/main/options.c:758 msgid "cannot transfer files when watching file descriptors" msgstr "" #: src/main/options.c:773 msgid "not available on systems without /proc/self/fdinfo" msgstr "" #: src/main/remote.c:309 msgid "message not received" msgstr "" #: src/main/remote.c:440 msgid "SA_SIGINFO not supported on this system" msgstr "" #: src/main/version.c:28 msgid "License: GPLv3+ " msgstr "" #: src/main/version.c:29 msgid "This is free software: you are free to change and redistribute it." msgstr "" #: src/main/version.c:30 msgid "There is NO WARRANTY, to the extent permitted by law." msgstr "" #: src/main/version.c:32 msgid "Project web site" msgstr "" #: src/pv/cursor.c:61 msgid "failed to get terminal name" msgstr "" #: src/pv/cursor.c:106 msgid "failed to open lock file" msgstr "" #: src/pv/cursor.c:139 msgid "lock attempt failed" msgstr "" #: src/pv/cursor.c:400 msgid "failed to open terminal" msgstr "" #: src/pv/display.c:249 msgid "yzafpnum kMGTPEZY" msgstr "" #: src/pv/display.c:267 msgid "yzafpnum KMGTPEZY" msgstr "" #: src/pv/display.c:989 src/pv/transfer.c:1056 msgid "buffer allocation failed" msgstr "" #: src/pv/file.c:149 msgid "failed to seek to start of output" msgstr "" #: src/pv/file.c:294 msgid "failed to close file" msgstr "" #: src/pv/file.c:317 msgid "failed to read file" msgstr "" #: src/pv/file.c:332 msgid "failed to stat output file" msgstr "" #: src/pv/file.c:354 msgid "input file is output file" msgstr "" #: src/pv/file.c:412 msgid "(none)" msgstr "" #: src/pv/file.c:414 msgid "(stdin)" msgstr "" #: src/pv/format/averagerate.c:34 src/pv/format/progressbar.c:93 #: src/pv/format/rate.c:37 src/pv/loop.c:551 msgid "b/s" msgstr "" #: src/pv/format/averagerate.c:38 src/pv/format/progressbar.c:97 #: src/pv/format/rate.c:41 msgid "/s" msgstr "" #: src/pv/format/averagerate.c:38 src/pv/format/progressbar.c:97 #: src/pv/format/rate.c:41 src/pv/loop.c:551 msgid "B/s" msgstr "" #: src/pv/format/bytes.c:37 msgid "b" msgstr "" #: src/pv/format/bytes.c:41 src/pv/transfer.c:594 msgid "B" msgstr "" #: src/pv/format/eta.c:53 src/pv/format/eta.c:57 msgid "ETA" msgstr "" #: src/pv/format/fineta.c:81 msgid "FIN" msgstr "" #: src/pv/loop.c:550 msgid "rate min/avg/max/mdev" msgstr "" #: src/pv/loop.c:562 msgid "rate not measured" msgstr "" #: src/pv/loop.c:772 src/pv/loop.c:823 src/pv/loop.c:876 src/pv/watchpid.c:99 #: src/pv/watchpid.c:109 src/pv/watchpid.c:120 src/pv/watchpid.c:128 #: src/pv/watchpid.c:165 src/pv/watchpid.c:184 src/pv/watchpid.c:192 #: src/pv/watchpid.c:202 src/pv/watchpid.c:300 src/pv/watchpid.c:308 #: src/pv/watchpid.c:385 src/pv/watchpid.c:406 msgid "pid" msgstr "" #: src/pv/state.c:40 msgid "history structure allocation failed" msgstr "" #: src/pv/state.c:617 src/pv/state.c:628 msgid "file list allocation failed" msgstr "" #: src/pv/transfer.c:463 msgid "read failed" msgstr "" #: src/pv/transfer.c:479 msgid "warning: read errors detected" msgstr "" #: src/pv/transfer.c:495 msgid "file is not seekable" msgstr "" #: src/pv/transfer.c:573 msgid "failed to seek past error" msgstr "" #: src/pv/transfer.c:593 msgid "skipped past read error" msgstr "" #: src/pv/transfer.c:634 msgid "no transfer buffer allocated" msgstr "" #: src/pv/transfer.c:676 msgid "failed to set interval timer" msgstr "" #: src/pv/transfer.c:702 msgid "failed to clear interval timer" msgstr "" #: src/pv/transfer.c:744 msgid "line position buffer allocation failed" msgstr "" #: src/pv/transfer.c:917 msgid "write failed" msgstr "" #: src/pv/transfer.c:1154 msgid "select call failed" msgstr "" #: src/pv/watchpid.c:109 src/pv/watchpid.c:121 src/pv/watchpid.c:130 #: src/pv/watchpid.c:184 src/pv/watchpid.c:193 src/pv/watchpid.c:204 msgid "fd" msgstr "" #: src/pv/watchpid.c:130 src/pv/watchpid.c:204 msgid "not a regular file or block device" msgstr "" pv-1.9.31/po/quot.sed000066400000000000000000000002311474702661500143450ustar00rootroot00000000000000s/"\([^"]*\)"/“\1â€/g s/`\([^`']*\)'/‘\1’/g s/ '\([^`']*\)' / ‘\1’ /g s/ '\([^`']*\)'$/ ‘\1’/g s/^'\([^`']*\)' /‘\1’ /g s/“â€/""/g pv-1.9.31/po/remove-potcdate.sin000066400000000000000000000013201474702661500164710ustar00rootroot00000000000000# Sed script that removes the POT-Creation-Date line in the header entry # from a POT file. # # Copyright (C) 2002 Free Software Foundation, Inc. # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. This file is offered as-is, # without any warranty. # # The distinction between the first and the following occurrences of the # pattern is achieved by looking at the hold space. /^"POT-Creation-Date: .*"$/{ x # Test if the hold space is empty. s/P/P/ ta # Yes it was empty. First occurrence. Remove the line. g d bb :a # The hold space was nonempty. Following occurrences. Do nothing. x :b } pv-1.9.31/po/ru.gmo000066400000000000000000000323411474702661500140210ustar00rootroot00000000000000Þ•xÜ£œ( ) 1 8 @ C E I O S X \ c ;j ¦ « ¯ ³ ¼ Ú ë 'ð   ! ' 5C By %¼ !â  ! #' (K t v z 4“ 8È 8 : *W -‚ ,° -Ý  *(?!hЦÂÛó&CWru%‘#·&Û6I'X€š®)Ãí" 2-`z"—'º/â*%=c#g"‹®Ä Öâú %+Qm4‰'¾æ+D d)…¯Á!Ù%û!-;4iž·Ö'ñ8#V0z« Ä&ÑÌø ÅÐÙìð ù  - :DGŒ“š £1±ãF RY bBmʰv{RòNE9” ÎUÛd1– E§xí‚f{é/eG•XÝe6 Qœ cî +R![~!:Ú!>"FT"B›"3Þ"-#>@#_#Gß#X'$€$R…$=Ø$Z%iq%QÛ%(-&.V&#…&T©&0þ&7/'(g'H'GÙ'^!(C€(Ä($â(V)[^)aº)X*Eu*»*BÄ*D+)L+*v+ ¡+4Â+-÷+V%,R|,<Ï,S -X`-N¹-?..H.Cw.K».M/_U/0µ/Bæ/S)0H}0>Æ0@1XF13Ÿ1=Ó1;2‰M2V×2<.3Qk3l½3I*4 t4K•4g )U7hHQrLxl*oEf,bn #$&%u-6Y>mcW+p1 .'Zs`MOkqv @2N _GR;j?CJBei:IDdX"4!V0P[]S^aw5\A8t<(F/K= T93(input)(none)(stdin)/sBB/sBYTESETAFILEFINFORMATHEIGHTLicense: GPLv3+ NAMENUMPIDPID[:FD]Please report any bugs to: %sProject web siteRATESA_SIGINFO not supported on this systemSECSIZESTYLESupported format sequences:There is NO WARRANTY, to the extent permitted by law.This is free software: you are free to change and redistribute it.Try `%s --help' for more information.Try `%s -h' for more information.Usage: %s [OPTION] [FILE]...WIDTHassume terminal is HEIGHT rows highassume terminal is WIDTH characters widebb/sbuffer allocation failedcannot transfer files when watching file descriptorscannot use remote control when watching file descriptorscompute average rate over past SEC seconds (default 30s)count lines instead of bytesdiscard input instead of writing to outputdisplay nothing until SEC seconds have passeddisplay nothing until first byte transferreddo not output any transfer information at allfailed to clear interval timerfailed to close filefailed to determine size of block devicefailed to generate sysfs filenamefailed to get terminal namefailed to open block devicefailed to open lock filefailed to open terminalfailed to read filefailed to read sysfs size filefailed to set interval timerfailed to stat filefailed to stat output filefdfile list allocation failedflush cache to disk after every writehistory structure allocation failedif size unknown, show rate vs max rateinput file is output fileinteger argument expectedinvalid process IDis a directorylimit transfer to RATE bytes per secondlines are null-terminatedlock attempt failedmessage not receivednever use splice(), always use read/writeno transfer buffer allocatednot a regular file or block devicenot available on systems without /proc/self/fdinfonumeric argument expectednumeric value not understoodoption structure allocation failedoption structure argv allocation failedoutput even if standard error is not a terminaloutput percentages, not visual informationoutput transfer statistics at the endpidprefix visual information with NAMEprocess ID or pid:fd pair expectedrate min/avg/max/mdevrate not measuredread failedsave process ID in FILEselect call failedset default bar style to NAMEset estimated data size to SIZE bytesset output format to FORMATshow NUM bytes last writtenshow absolute estimated time of arrival (completion)show data transfer average rate countershow data transfer rate countershow elapsed timeshow estimated time of arrival (completion)show number of bits transferredshow number of bytes transferredshow percentage of transfer buffer in useshow progress barshow this help and exitshow version information and exitskip errors in BYTES blocks at a timeskip read errors in inputstop after --size bytes have been transferredtreat suffixes as multiples of 1000 rather than 1024update every SEC secondsupdate settings of process PIDuse a buffer size of BYTESuse cursor positioning escape sequencesuse direct I/O to bypass cachewarning: read errors detectedwatch file FD opened by process PIDwrite all input to FILE before writing to outputwrite debug logs to FILEwrite failedwrite output to FILE instead of stdoutReport-Msgid-Bugs-To: pv@ivarch.com PO-Revision-Date: 2025-01-15 19:08+0000 Last-Translator: 0ko <0ko@users.noreply.translate.codeberg.org> Language-Team: Russian Language: ru MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2; X-Generator: Weblate 5.9.2 (ввод)(нет)(Ñтд. ввод)/Ñбайтбайт/ÑБÐЙТОЖИДФÐЙЛЗÐВЕРШФОРМÐТВЫСОТÐЛицензиÑ: GPLv3+ ИМЯКОЛИДпрИДпр[:FD]Сообщайте о проблемах на: %sВеб-Ñайт проектаСКОРЭтой ÑиÑтемой не поддерживаетÑÑ SA_SIGINFOСЕКРÐЗМСТИЛЬПоддерживаемые поÑледовательноÑти:Разработчики не дают никаких гарантий, ÑвÑзанных Ñ Ñ€Ð°Ð±Ð¾Ñ‚Ð¾Ð¹ Ñтой программы, наÑколько Ñто юридичеÑки возможно.Это ÑÐ²Ð¾Ð±Ð¾Ð´Ð½Ð°Ñ Ð¿Ñ€Ð¾Ð³Ñ€Ð°Ð¼Ð¼Ð°. Ð’Ñ‹ можете изменÑть и раÑпроÑтранÑть её.Выполните `%s --help' Ð´Ð»Ñ Ð¿Ð¾Ð»ÑƒÑ‡ÐµÐ½Ð¸Ñ Ð¿Ð¾Ð´Ñ€Ð¾Ð±Ð½Ð¾Ñтей.Выполните `%s -h' Ð´Ð»Ñ Ð¿Ð¾Ð»ÑƒÑ‡ÐµÐ½Ð¸Ñ Ð¿Ð¾Ð´Ñ€Ð¾Ð±Ð½Ð¾Ñтей.ИÑпользование: %s [ОПЦИИ] [ФÐЙЛ]...ШИРИÐÐÑчитать, что на Ñкране помещаетÑÑ Ð’Ð«Ð¡ÐžÐ¢Ð ÑтрокÑчитать, что в одной Ñтроке помещаетÑÑ Ð¨Ð˜Ð Ð˜ÐÐ Ñимволовбитбит/Ñне удалоÑÑŒ выделить памÑть Ð´Ð»Ñ Ð±ÑƒÑ„ÐµÑ€Ð°Ð¿ÐµÑ€ÐµÐ´Ð°Ñ‡Ð° файлов невозможна при отÑлеживании деÑкрипторов файловудалённое управление невозможно при отÑлеживании деÑкрипторов файловвычиÑлÑть Ñреднюю ÑкороÑть за поÑледние СЕК Ñекунд (по умолчанию 30)Ñчитать линии вмеÑто байтотбраÑывать ввод вмеÑто запиÑи в выводничего не показывать, пока не пройдёт СЕК Ñекундничего не показывать, пока не будет передан первый байтне отображать никакую информацию о передачене удалоÑÑŒ очиÑтить измеритель временного промежуткане удалоÑÑŒ закрыть файлне удалоÑÑŒ определить размер блочного уÑтройÑтване удалоÑÑŒ Ñоздать Ð¸Ð¼Ñ Ñ„Ð°Ð¹Ð»Ð° sysfsне удалоÑÑŒ получить Ð¸Ð¼Ñ Ñ‚ÐµÑ€Ð¼Ð¸Ð½Ð°Ð»Ð°Ð½Ðµ удалоÑÑŒ открыть блочное уÑтройÑтвоне удалоÑÑŒ открыть блокирующий файлне удалоÑÑŒ открыть терминалне удалоÑÑŒ прочеÑть файлне удалоÑÑŒ узнать размер файла sysfsне удалоÑÑŒ задать измеритель временного промежуткане удалоÑÑŒ получить информацию о файлене удалоÑÑŒ получить информацию о выходном файледфне удалоÑÑŒ выделить памÑть Ð´Ð»Ñ ÑпиÑка файловÑбраÑывать кеш на диÑк каждый разне удалоÑÑŒ выделить памÑть Ð´Ð»Ñ Ñтруктуры иÑторииеÑли объём неизвеÑтен, показать ÑкороÑть и макÑ. ÑкороÑтьпути иÑходного и выходного файлов одинаковыожидалоÑÑŒ целое чиÑлонеправильный ИД процеÑÑаÑвлÑетÑÑ ÐºÐ°Ñ‚Ð°Ð»Ð¾Ð³Ð¾Ð¼Ð¾Ð³Ñ€Ð°Ð½Ð¸Ñ‡Ð¸Ñ‚ÑŒ ÑкороÑть передачи до СКОР байт/ÑекÑтроки прерываютÑÑ Ð½ÑƒÐ»Ñмипопытка блокировки не удалаÑÑŒÑообщение не полученоиÑпользовать чтение/запиÑÑŒ вмеÑто splice()не выделена памÑть Ð´Ð»Ñ Ð±ÑƒÑ„ÐµÑ€Ð° передачине ÑвлÑетÑÑ Ð¾Ð±Ñ‹Ñ‡Ð½Ñ‹Ð¼ файлом или блочным уÑтройÑтвомневозможно на ÑиÑтемах без /proc/self/fdinfoожидалоÑÑŒ чиÑлочиÑло не раÑпознаноне удалоÑÑŒ выделить памÑть Ð´Ð»Ñ Ñтруктуры опцийне удалоÑÑŒ выделить памÑть Ð´Ð»Ñ Ñтруктуры опций argvвевеÑти, даже еÑли Ñтд. ошибка не ÑвлÑетÑÑ Ñ‚ÐµÑ€Ð¼Ð¸Ð½Ð°Ð»Ð¾Ð¼Ð¿Ð¾ÐºÐ°Ð·Ð°Ñ‚ÑŒ проценты вмеÑто визуальной информациипоÑле Ð·Ð°Ð²ÐµÑ€ÑˆÐµÐ½Ð¸Ñ Ð¿Ð¾ÐºÐ°Ð·Ð°Ñ‚ÑŒ ÑтатиÑтикуИДпрпиÑать ИМЯ до визуальной информацииожидалÑÑ Ð˜Ð” процеÑÑа или пара ИДпр:ДФÑкор. мин/Ñред/макÑ/девÑкороÑть не изменÑетÑÑчтение не удалоÑÑŒÑохранить ИД процеÑÑа в ФÐÐ™Ð›Ð·Ð°Ð¿Ñ€Ð¾Ñ Ð²Ñ‹Ð±Ð¾Ñ€ÐºÐ¸ не удалÑÑзадать Ñтиль полоÑки по умолчанию как ÐÐЗВÐÐИЕуказать ожидаемый объём данных как РÐЗМ байтуказать формат вывода как ФОРМÐТпоказать КОЛ байт, переданных в поÑледний разпоказать примерное абÑолютное Ð²Ñ€ÐµÐ¼Ñ Ð·Ð°Ð²ÐµÑ€ÑˆÐµÐ½Ð¸Ñпоказать Ñреднюю ÑкороÑть передачи данныхпоказать ÑкороÑть передачи данныхпоказать прошедшее времÑпоказать примерное Ð²Ñ€ÐµÐ¼Ñ Ð·Ð°Ð²ÐµÑ€ÑˆÐµÐ½Ð¸Ñпоказать объём переданных данных в битахпоказать объём переданных данных в байтахпоказать иÑпользование буфера передачи в процентахпоказать полоÑу прогреÑÑапоказать Ñправку и завершить работупоказать верÑию программы и завершить работупропуÑкать ошибки в <БÐЙТ> блоках за разпропуÑтить ошибки Ñ‡Ñ‚ÐµÐ½Ð¸Ñ Ð²Ð¾ вводеоÑтановить поÑле передачи --size байтÑчитать ÑуффикÑÑ‹ как умножители на 1000, а не на 1024обновлÑть каждые СЕК Ñекундобновить наÑтройки ИДпр процеÑÑаиÑпользовать буфер размера БÐЙТиÑпользовать Ñимвольные поÑледовательноÑти Ð´Ð»Ñ Ð¿Ð¾Ð·Ð¸Ñ†Ð¸Ð¾Ð½Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ ÐºÑƒÑ€ÑораиÑпользовать прÑмой ввод/вывод Ð´Ð»Ñ Ð¾Ð±Ñ…Ð¾Ð´Ð° кешавнимание: замечены ошибки чтениÑÑледить за FD файла, открытого процеÑÑом ИДпрзапиÑывать веÑÑŒ ввод в ФÐЙЛ прежде, чем отправлÑть на выводвеÑти запиÑÑŒ отладочного журнала в ФÐЙЛзапиÑÑŒ не удалаÑьнаправить вывод в ФÐЙЛ вмеÑто Ñтд. выводаpv-1.9.31/po/ru.po000066400000000000000000000431221474702661500136540ustar00rootroot00000000000000msgid "" msgstr "" "Report-Msgid-Bugs-To: pv@ivarch.com\n" "POT-Creation-Date: 2025-01-28 21:21+0000\n" "PO-Revision-Date: 2025-01-15 19:08+0000\n" "Last-Translator: 0ko <0ko@users.noreply.translate.codeberg.org>\n" "Language-Team: Russian \n" "Language: ru\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && " "n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" "X-Generator: Weblate 5.9.2\n" #: src/main/help.c:236 msgid "show progress bar" msgstr "показать полоÑу прогреÑÑа" #: src/main/help.c:239 msgid "show elapsed time" msgstr "показать прошедшее времÑ" #: src/main/help.c:242 msgid "show estimated time of arrival (completion)" msgstr "показать примерное Ð²Ñ€ÐµÐ¼Ñ Ð·Ð°Ð²ÐµÑ€ÑˆÐµÐ½Ð¸Ñ" #: src/main/help.c:245 msgid "show absolute estimated time of arrival (completion)" msgstr "показать примерное абÑолютное Ð²Ñ€ÐµÐ¼Ñ Ð·Ð°Ð²ÐµÑ€ÑˆÐµÐ½Ð¸Ñ" #: src/main/help.c:248 msgid "show data transfer rate counter" msgstr "показать ÑкороÑть передачи данных" #: src/main/help.c:251 msgid "show data transfer average rate counter" msgstr "показать Ñреднюю ÑкороÑть передачи данных" #: src/main/help.c:254 msgid "show number of bytes transferred" msgstr "показать объём переданных данных в байтах" #: src/main/help.c:257 msgid "show percentage of transfer buffer in use" msgstr "показать иÑпользование буфера передачи в процентах" #: src/main/help.c:259 msgid "NUM" msgstr "КОЛ" #: src/main/help.c:260 msgid "show NUM bytes last written" msgstr "показать КОЛ байт, переданных в поÑледний раз" #: src/main/help.c:262 msgid "FORMAT" msgstr "ФОРМÐТ" #: src/main/help.c:263 msgid "set output format to FORMAT" msgstr "указать формат вывода как ФОРМÐТ" #: src/main/help.c:266 msgid "output percentages, not visual information" msgstr "показать проценты вмеÑто визуальной информации" #: src/main/help.c:269 msgid "do not output any transfer information at all" msgstr "не отображать никакую информацию о передаче" #: src/main/help.c:273 msgid "show number of bits transferred" msgstr "показать объём переданных данных в битах" #: src/main/help.c:276 msgid "treat suffixes as multiples of 1000 rather than 1024" msgstr "Ñчитать ÑуффикÑÑ‹ как умножители на 1000, а не на 1024" #: src/main/help.c:279 msgid "display nothing until first byte transferred" msgstr "ничего не показывать, пока не будет передан первый байт" #: src/main/help.c:281 src/main/help.c:296 src/main/help.c:299 msgid "SEC" msgstr "СЕК" #: src/main/help.c:282 msgid "display nothing until SEC seconds have passed" msgstr "ничего не показывать, пока не пройдёт СЕК Ñекунд" #: src/main/help.c:284 msgid "SIZE" msgstr "РÐЗМ" #: src/main/help.c:285 msgid "set estimated data size to SIZE bytes" msgstr "указать ожидаемый объём данных как РÐЗМ байт" #: src/main/help.c:288 msgid "if size unknown, show rate vs max rate" msgstr "еÑли объём неизвеÑтен, показать ÑкороÑть и макÑ. ÑкороÑть" #: src/main/help.c:291 msgid "count lines instead of bytes" msgstr "Ñчитать линии вмеÑто байт" #: src/main/help.c:294 msgid "lines are null-terminated" msgstr "Ñтроки прерываютÑÑ Ð½ÑƒÐ»Ñми" #: src/main/help.c:297 msgid "update every SEC seconds" msgstr "обновлÑть каждые СЕК Ñекунд" #: src/main/help.c:300 msgid "compute average rate over past SEC seconds (default 30s)" msgstr "вычиÑлÑть Ñреднюю ÑкороÑть за поÑледние СЕК Ñекунд (по умолчанию 30)" #: src/main/help.c:302 msgid "WIDTH" msgstr "ШИРИÐÐ" #: src/main/help.c:303 msgid "assume terminal is WIDTH characters wide" msgstr "Ñчитать, что в одной Ñтроке помещаетÑÑ Ð¨Ð˜Ð Ð˜ÐÐ Ñимволов" #: src/main/help.c:305 msgid "HEIGHT" msgstr "ВЫСОТÐ" #: src/main/help.c:306 msgid "assume terminal is HEIGHT rows high" msgstr "Ñчитать, что на Ñкране помещаетÑÑ Ð’Ð«Ð¡ÐžÐ¢Ð Ñтрок" #: src/main/help.c:308 msgid "NAME" msgstr "ИМЯ" #: src/main/help.c:309 msgid "prefix visual information with NAME" msgstr "пиÑать ИМЯ до визуальной информации" #: src/main/help.c:311 msgid "STYLE" msgstr "СТИЛЬ" #: src/main/help.c:312 msgid "set default bar style to NAME" msgstr "задать Ñтиль полоÑки по умолчанию как ÐÐЗВÐÐИЕ" #: src/main/help.c:314 msgid "SPEC" msgstr "" #: src/main/help.c:315 msgid "also send progress to SPEC" msgstr "" #: src/main/help.c:318 msgid "output transfer statistics at the end" msgstr "поÑле Ð·Ð°Ð²ÐµÑ€ÑˆÐµÐ½Ð¸Ñ Ð¿Ð¾ÐºÐ°Ð·Ð°Ñ‚ÑŒ ÑтатиÑтику" #: src/main/help.c:321 msgid "output even if standard error is not a terminal" msgstr "вевеÑти, даже еÑли Ñтд. ошибка не ÑвлÑетÑÑ Ñ‚ÐµÑ€Ð¼Ð¸Ð½Ð°Ð»Ð¾Ð¼" #: src/main/help.c:324 msgid "use cursor positioning escape sequences" msgstr "" "иÑпользовать Ñимвольные поÑледовательноÑти Ð´Ð»Ñ Ð¿Ð¾Ð·Ð¸Ñ†Ð¸Ð¾Ð½Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ ÐºÑƒÑ€Ñора" #: src/main/help.c:327 src/main/help.c:357 src/main/help.c:369 #: src/main/help.c:379 msgid "FILE" msgstr "ФÐЙЛ" #: src/main/help.c:328 msgid "write output to FILE instead of stdout" msgstr "направить вывод в ФÐЙЛ вмеÑто Ñтд. вывода" #: src/main/help.c:330 msgid "RATE" msgstr "СКОР" #: src/main/help.c:331 msgid "limit transfer to RATE bytes per second" msgstr "ограничить ÑкороÑть передачи до СКОР байт/Ñек" #: src/main/help.c:333 src/main/help.c:342 msgid "BYTES" msgstr "БÐЙТ" #: src/main/help.c:334 msgid "use a buffer size of BYTES" msgstr "иÑпользовать буфер размера БÐЙТ" #: src/main/help.c:337 msgid "never use splice(), always use read/write" msgstr "иÑпользовать чтение/запиÑÑŒ вмеÑто splice()" #: src/main/help.c:340 msgid "skip read errors in input" msgstr "пропуÑтить ошибки Ñ‡Ñ‚ÐµÐ½Ð¸Ñ Ð²Ð¾ вводе" #: src/main/help.c:343 msgid "skip errors in BYTES blocks at a time" msgstr "пропуÑкать ошибки в <БÐЙТ> блоках за раз" #: src/main/help.c:346 msgid "stop after --size bytes have been transferred" msgstr "оÑтановить поÑле передачи --size байт" #: src/main/help.c:349 msgid "flush cache to disk after every write" msgstr "ÑбраÑывать кеш на диÑк каждый раз" #: src/main/help.c:352 msgid "use direct I/O to bypass cache" msgstr "иÑпользовать прÑмой ввод/вывод Ð´Ð»Ñ Ð¾Ð±Ñ…Ð¾Ð´Ð° кеша" #: src/main/help.c:355 msgid "discard input instead of writing to output" msgstr "отбраÑывать ввод вмеÑто запиÑи в вывод" #: src/main/help.c:358 msgid "write all input to FILE before writing to output" msgstr "запиÑывать веÑÑŒ ввод в ФÐЙЛ прежде, чем отправлÑть на вывод" #: src/main/help.c:360 msgid "PID[:FD]" msgstr "ИДпр[:FD]" #: src/main/help.c:361 msgid "watch file FD opened by process PID" msgstr "Ñледить за FD файла, открытого процеÑÑом ИДпр" #: src/main/help.c:364 msgid "PID" msgstr "ИДпр" #: src/main/help.c:365 msgid "update settings of process PID" msgstr "обновить наÑтройки ИДпр процеÑÑа" #: src/main/help.c:370 msgid "save process ID in FILE" msgstr "Ñохранить ИД процеÑÑа в ФÐЙЛ" #: src/main/help.c:373 msgid "show this help and exit" msgstr "показать Ñправку и завершить работу" #: src/main/help.c:376 msgid "show version information and exit" msgstr "показать верÑию программы и завершить работу" #: src/main/help.c:380 msgid "write debug logs to FILE" msgstr "веÑти запиÑÑŒ отладочного журнала в ФÐЙЛ" #: src/main/help.c:406 #, c-format msgid "Usage: %s [OPTION] [FILE]..." msgstr "ИÑпользование: %s [ОПЦИИ] [ФÐЙЛ]..." #: src/main/help.c:417 msgid "" "Concatenate FILE(s), or standard input, to standard output, with monitoring." msgstr "" #: src/main/help.c:555 msgid "Supported format sequences:" msgstr "Поддерживаемые поÑледовательноÑти:" #: src/main/help.c:569 #, c-format msgid "Please report any bugs to: %s" msgstr "Сообщайте о проблемах на: %s" #: src/main/main.c:232 msgid "(input)" msgstr "(ввод)" #: src/main/main.c:328 msgid "state allocation failed" msgstr "" #: src/main/options.c:144 src/pv/file.c:324 msgid "failed to stat file" msgstr "не удалоÑÑŒ получить информацию о файле" #: src/main/options.c:158 msgid "is a directory" msgstr "ÑвлÑетÑÑ ÐºÐ°Ñ‚Ð°Ð»Ð¾Ð³Ð¾Ð¼" #: src/main/options.c:187 msgid "failed to generate sysfs filename" msgstr "не удалоÑÑŒ Ñоздать Ð¸Ð¼Ñ Ñ„Ð°Ð¹Ð»Ð° sysfs" #: src/main/options.c:209 msgid "failed to read sysfs size file" msgstr "не удалоÑÑŒ узнать размер файла sysfs" #: src/main/options.c:229 msgid "failed to open block device" msgstr "не удалоÑÑŒ открыть блочное уÑтройÑтво" #: src/main/options.c:239 msgid "failed to determine size of block device" msgstr "не удалоÑÑŒ определить размер блочного уÑтройÑтва" #: src/main/options.c:345 msgid "option structure allocation failed" msgstr "не удалоÑÑŒ выделить памÑть Ð´Ð»Ñ Ñтруктуры опций" #: src/main/options.c:364 msgid "option structure argv allocation failed" msgstr "не удалоÑÑŒ выделить памÑть Ð´Ð»Ñ Ñтруктуры опций argv" #: src/main/options.c:417 msgid "numeric value not understood" msgstr "чиÑло не раÑпознано" #: src/main/options.c:435 msgid "integer argument expected" msgstr "ожидалоÑÑŒ целое чиÑло" #: src/main/options.c:447 msgid "numeric argument expected" msgstr "ожидалоÑÑŒ чиÑло" #: src/main/options.c:458 msgid "process ID or pid:fd pair expected" msgstr "ожидалÑÑ Ð˜Ð” процеÑÑа или пара ИДпр:ДФ" #: src/main/options.c:465 msgid "invalid process ID" msgstr "неправильный ИД процеÑÑа" #: src/main/options.c:698 #, c-format msgid "Try `%s --help' for more information." msgstr "Выполните `%s --help' Ð´Ð»Ñ Ð¿Ð¾Ð»ÑƒÑ‡ÐµÐ½Ð¸Ñ Ð¿Ð¾Ð´Ñ€Ð¾Ð±Ð½Ð¾Ñтей." #: src/main/options.c:700 #, c-format msgid "Try `%s -h' for more information." msgstr "Выполните `%s -h' Ð´Ð»Ñ Ð¿Ð¾Ð»ÑƒÑ‡ÐµÐ½Ð¸Ñ Ð¿Ð¾Ð´Ñ€Ð¾Ð±Ð½Ð¾Ñтей." #: src/main/options.c:731 msgid "" "cannot use line mode or transfer modifier options when watching file " "descriptors" msgstr "" #: src/main/options.c:740 msgid "cannot use cursor positioning when watching file descriptors" msgstr "" #: src/main/options.c:749 msgid "cannot use remote control when watching file descriptors" msgstr "удалённое управление невозможно при отÑлеживании деÑкрипторов файлов" #: src/main/options.c:758 msgid "cannot transfer files when watching file descriptors" msgstr "передача файлов невозможна при отÑлеживании деÑкрипторов файлов" #: src/main/options.c:773 msgid "not available on systems without /proc/self/fdinfo" msgstr "невозможно на ÑиÑтемах без /proc/self/fdinfo" #: src/main/remote.c:309 msgid "message not received" msgstr "Ñообщение не получено" #: src/main/remote.c:440 msgid "SA_SIGINFO not supported on this system" msgstr "Этой ÑиÑтемой не поддерживаетÑÑ SA_SIGINFO" #: src/main/version.c:28 msgid "License: GPLv3+ " msgstr "ЛицензиÑ: GPLv3+ " #: src/main/version.c:29 msgid "This is free software: you are free to change and redistribute it." msgstr "Это ÑÐ²Ð¾Ð±Ð¾Ð´Ð½Ð°Ñ Ð¿Ñ€Ð¾Ð³Ñ€Ð°Ð¼Ð¼Ð°. Ð’Ñ‹ можете изменÑть и раÑпроÑтранÑть её." #: src/main/version.c:30 msgid "There is NO WARRANTY, to the extent permitted by law." msgstr "" "Разработчики не дают никаких гарантий, ÑвÑзанных Ñ Ñ€Ð°Ð±Ð¾Ñ‚Ð¾Ð¹ Ñтой программы, " "наÑколько Ñто юридичеÑки возможно." #: src/main/version.c:32 msgid "Project web site" msgstr "Веб-Ñайт проекта" #: src/pv/cursor.c:61 msgid "failed to get terminal name" msgstr "не удалоÑÑŒ получить Ð¸Ð¼Ñ Ñ‚ÐµÑ€Ð¼Ð¸Ð½Ð°Ð»Ð°" #: src/pv/cursor.c:106 msgid "failed to open lock file" msgstr "не удалоÑÑŒ открыть блокирующий файл" #: src/pv/cursor.c:139 msgid "lock attempt failed" msgstr "попытка блокировки не удалаÑÑŒ" #: src/pv/cursor.c:400 msgid "failed to open terminal" msgstr "не удалоÑÑŒ открыть терминал" #: src/pv/display.c:249 msgid "yzafpnum kMGTPEZY" msgstr "" #: src/pv/display.c:267 msgid "yzafpnum KMGTPEZY" msgstr "" #: src/pv/display.c:989 src/pv/transfer.c:1056 msgid "buffer allocation failed" msgstr "не удалоÑÑŒ выделить памÑть Ð´Ð»Ñ Ð±ÑƒÑ„ÐµÑ€Ð°" #: src/pv/file.c:149 msgid "failed to seek to start of output" msgstr "" #: src/pv/file.c:294 msgid "failed to close file" msgstr "не удалоÑÑŒ закрыть файл" #: src/pv/file.c:317 msgid "failed to read file" msgstr "не удалоÑÑŒ прочеÑть файл" #: src/pv/file.c:332 msgid "failed to stat output file" msgstr "не удалоÑÑŒ получить информацию о выходном файле" #: src/pv/file.c:354 msgid "input file is output file" msgstr "пути иÑходного и выходного файлов одинаковы" #: src/pv/file.c:412 msgid "(none)" msgstr "(нет)" #: src/pv/file.c:414 msgid "(stdin)" msgstr "(Ñтд. ввод)" #: src/pv/format/averagerate.c:34 src/pv/format/progressbar.c:93 #: src/pv/format/rate.c:37 src/pv/loop.c:551 msgid "b/s" msgstr "бит/Ñ" #: src/pv/format/averagerate.c:38 src/pv/format/progressbar.c:97 #: src/pv/format/rate.c:41 msgid "/s" msgstr "/Ñ" #: src/pv/format/averagerate.c:38 src/pv/format/progressbar.c:97 #: src/pv/format/rate.c:41 src/pv/loop.c:551 msgid "B/s" msgstr "байт/Ñ" #: src/pv/format/bytes.c:37 msgid "b" msgstr "бит" #: src/pv/format/bytes.c:41 src/pv/transfer.c:594 msgid "B" msgstr "байт" #: src/pv/format/eta.c:53 src/pv/format/eta.c:57 msgid "ETA" msgstr "ОЖИД" #: src/pv/format/fineta.c:81 msgid "FIN" msgstr "ЗÐВЕРШ" #: src/pv/loop.c:550 msgid "rate min/avg/max/mdev" msgstr "Ñкор. мин/Ñред/макÑ/дев" #: src/pv/loop.c:562 msgid "rate not measured" msgstr "ÑкороÑть не изменÑетÑÑ" #: src/pv/loop.c:772 src/pv/loop.c:823 src/pv/loop.c:876 src/pv/watchpid.c:99 #: src/pv/watchpid.c:109 src/pv/watchpid.c:120 src/pv/watchpid.c:128 #: src/pv/watchpid.c:165 src/pv/watchpid.c:184 src/pv/watchpid.c:192 #: src/pv/watchpid.c:202 src/pv/watchpid.c:300 src/pv/watchpid.c:308 #: src/pv/watchpid.c:385 src/pv/watchpid.c:406 msgid "pid" msgstr "ИДпр" #: src/pv/state.c:40 msgid "history structure allocation failed" msgstr "не удалоÑÑŒ выделить памÑть Ð´Ð»Ñ Ñтруктуры иÑтории" #: src/pv/state.c:617 src/pv/state.c:628 msgid "file list allocation failed" msgstr "не удалоÑÑŒ выделить памÑть Ð´Ð»Ñ ÑпиÑка файлов" #: src/pv/transfer.c:463 msgid "read failed" msgstr "чтение не удалоÑÑŒ" #: src/pv/transfer.c:479 msgid "warning: read errors detected" msgstr "внимание: замечены ошибки чтениÑ" #: src/pv/transfer.c:495 msgid "file is not seekable" msgstr "" #: src/pv/transfer.c:573 msgid "failed to seek past error" msgstr "" #: src/pv/transfer.c:593 msgid "skipped past read error" msgstr "" #: src/pv/transfer.c:634 msgid "no transfer buffer allocated" msgstr "не выделена памÑть Ð´Ð»Ñ Ð±ÑƒÑ„ÐµÑ€Ð° передачи" #: src/pv/transfer.c:676 msgid "failed to set interval timer" msgstr "не удалоÑÑŒ задать измеритель временного промежутка" #: src/pv/transfer.c:702 msgid "failed to clear interval timer" msgstr "не удалоÑÑŒ очиÑтить измеритель временного промежутка" #: src/pv/transfer.c:744 msgid "line position buffer allocation failed" msgstr "" #: src/pv/transfer.c:917 msgid "write failed" msgstr "запиÑÑŒ не удалаÑÑŒ" #: src/pv/transfer.c:1154 msgid "select call failed" msgstr "Ð·Ð°Ð¿Ñ€Ð¾Ñ Ð²Ñ‹Ð±Ð¾Ñ€ÐºÐ¸ не удалÑÑ" #: src/pv/watchpid.c:109 src/pv/watchpid.c:121 src/pv/watchpid.c:130 #: src/pv/watchpid.c:184 src/pv/watchpid.c:193 src/pv/watchpid.c:204 msgid "fd" msgstr "дф" #: src/pv/watchpid.c:130 src/pv/watchpid.c:204 msgid "not a regular file or block device" msgstr "не ÑвлÑетÑÑ Ð¾Ð±Ñ‹Ñ‡Ð½Ñ‹Ð¼ файлом или блочным уÑтройÑтвом" pv-1.9.31/po/stamp-po000066400000000000000000000000121474702661500143400ustar00rootroot00000000000000timestamp pv-1.9.31/po/tr.gmo000066400000000000000000000257001474702661500140210ustar00rootroot00000000000000Þ•­ À Á É Ð Ø Û Ý á Lç 4 8 = A H ;O ‹  ” ˜ ¡ ¿ Ð 'Õ ý  5 B< % !¥ Ç ä #ê ( 7 9 = 4V <‹ PÈ 88R‹*¨-Ó,-.\{(!¹Û÷,DXw!‘³Ðäÿ%3#Y&}¤¾Øë'ú&"Icw)Œ¶"Ó2ö)"C'f/Ž*¾%é#"7Zp ‚ަ%¹ßû4'Lt”+¦Ò ò)=O!g%‰¯Éá-ù4'\u”'¯×ö#08i ‚&¶ÈªÚ…Ž”œŸ¡¥R­  :!\cgk)tž¯%´ÚÞ3äU8n4§&Ü GDWœž#¢:ÆIgKC³L÷D([/„1´$æ& 2 &G !n  ª Å à ö !+'!+S!&!$¦! Ë!ì!ï!'",/"+\"2ˆ"$»"+à" # ,#:9#1t#¦# Æ#ç#.ù#"($*K$3v$*ª$+Õ$0%72%<j%'§%Ï%$Ó%3ø%%,&R&d&%w&$&2Â&-õ&%#'6I'0€''±'Ù'/ð'" (#C(0g(˜(´($Ò((÷(! )B)b))‚)7¬) ä)"*(*0H*.y*%¨*4Î*3+*7+b+&u+œ+®+._WN /w{(3R">m[pq ?KhU LO2;AfIC@Z)YB#S,&yPj~=a'vo0 9x\8H!`uMsr}i<Q7JbtDn+kz6cdE 1T4V%F]^eX:$5-l*Gg|(input)(none)(stdin)/sBB/sBYTESConcatenate FILE(s), or standard input, to standard output, with monitoring.ETAFILEFINFORMATHEIGHTLicense: GPLv3+ NAMENUMPIDPID[:FD]Please report any bugs to: %sProject web siteRATESA_SIGINFO not supported on this systemSECSIZEThere is NO WARRANTY, to the extent permitted by law.This is free software: you are free to change and redistribute it.Try `%s --help' for more information.Try `%s -h' for more information.Usage: %s [OPTION] [FILE]...WIDTHassume terminal is HEIGHT rows highassume terminal is WIDTH characters widebb/sbuffer allocation failedcannot transfer files when watching file descriptorscannot use cursor positioning when watching file descriptorscannot use line mode or transfer modifier options when watching file descriptorscannot use remote control when watching file descriptorscompute average rate over past SEC seconds (default 30s)count lines instead of bytesdiscard input instead of writing to outputdisplay nothing until SEC seconds have passeddisplay nothing until first byte transferreddo not output any transfer information at allfailed to clear interval timerfailed to close filefailed to determine size of block devicefailed to generate sysfs filenamefailed to get terminal namefailed to open block devicefailed to open lock filefailed to open terminalfailed to read filefailed to read sysfs size filefailed to seek past errorfailed to seek to start of outputfailed to set interval timerfailed to stat filefailed to stat output filefdfile is not seekablefile list allocation failedflush cache to disk after every writehistory structure allocation failedif size unknown, show rate vs max rateinput file is output fileinteger argument expectedinvalid process IDis a directorylimit transfer to RATE bytes per secondline position buffer allocation failedlines are null-terminatedlock attempt failedmessage not receivednever use splice(), always use read/writeno transfer buffer allocatednot a regular file or block devicenot available on systems without /proc/self/fdinfonumeric argument expectedoption structure allocation failedoption structure argv allocation failedoutput even if standard error is not a terminaloutput percentages, not visual informationoutput transfer statistics at the endpidprefix visual information with NAMEprocess ID or pid:fd pair expectedrate min/avg/max/mdevrate not measuredread failedsave process ID in FILEselect call failedset estimated data size to SIZE bytesset output format to FORMATshow NUM bytes last writtenshow absolute estimated time of arrival (completion)show data transfer average rate countershow data transfer rate countershow elapsed timeshow estimated time of arrival (completion)show number of bits transferredshow number of bytes transferredshow percentage of transfer buffer in useshow progress barshow this help and exitshow version information and exitskip errors in BYTES blocks at a timeskip read errors in inputskipped past read errorstate allocation failedstop after --size bytes have been transferredtreat suffixes as multiples of 1000 rather than 1024update every SEC secondsupdate settings of process PIDuse a buffer size of BYTESuse cursor positioning escape sequencesuse direct I/O to bypass cachewarning: read errors detectedwatch file FD opened by process PIDwrite all input to FILE before writing to outputwrite debug logs to FILEwrite failedwrite output to FILE instead of stdoutyzafpnum KMGTPEZYyzafpnum kMGTPEZYProject-Id-Version: pv 1.8.14 Report-Msgid-Bugs-To: pv@ivarch.com PO-Revision-Date: 2024-10-12 23:51+0000 Last-Translator: a-j-wood Language-Team: Turkish Language: tr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=n != 1; X-Generator: Weblate 5.7.2 (giriÅŸ)(yok)(stdin)/sBB/sBAYTLARİzleme ile DOSYA(lar)ı veya standart girdiyi standart çıktı ile birleÅŸtirin.ETADOSYAFINFORMATYÜKSEKLİKLisans: GPLv3+ İSİMNUMPIDPID[:FD]Lütfen hataları ÅŸu adrese bildirin: %sProje web sitesiORANSA_SIGINFO bu sistemde desteklenmiyorSECBOYUTYasaların izin verdiÄŸi ölçüde GARANTİ YOKTUR.Bu özgür bir yazılımdır: deÄŸiÅŸtirmekte ve yeniden dağıtmakta özgürsünüz.Daha fazla bilgi için `%s --help' seçeneÄŸini deneyin.Daha fazla bilgi için `%s -h' seçeneÄŸini deneyin.Kullanım ÅŸekli: %s [AYAR] [DOSYA]...GENİŞLİKterminalin YÜKSEKLİK sıraları yüksekliÄŸinde olduÄŸunu varsayalımterminalin GENİŞLİK karakter geniÅŸliÄŸinde olduÄŸunu varsayalımbb/sarabellek tahsisi baÅŸarısız oldudosya tanımlayıcıları izlenirken dosya aktarılamıyordosya tanımlayıcılarını izlerken imleç konumlandırmayı kullanamazdosya tanımlayıcılarını izlerken satır modu veya aktarım deÄŸiÅŸtirici seçeneklerini kullanamazdosya tanımlayıcılarını izlerken uzaktan kumandayı kullanamazgeçmiÅŸ SEC saniyeleri üzerinden ortalama hızı hesapla (varsayılan 30s)bayt yerine satır sayGirdiyi çıktıya yazmak yerine yok saySEC saniye geçene kadar hiçbir ÅŸey göstermeilk bayt aktarılana kadar hiçbir ÅŸey göstermehiçbir transfer bilgisini yazdırmaaralık zamanlayıcısı temizlenemedidosya kapatılamadıblok aygıtının boyutu belirlenemedisysfs dosya adı oluÅŸturulamadıterminal adı alınamadıblok aygıtı açılamadılock dosyası açılamadıterminal açılamadıdosya okunamadısysfs boyut dosyası okunamadıgeçmiÅŸ hatayı aramakta baÅŸarısız olduçıktının baÅŸlangıcına ulaşılamadıaralık zamanlayıcısı ayarlanamadıdosya statüsünde baÅŸarısız olduçıktı dosyası stat edilemedifddosya aranabilir deÄŸildosya listesi tahsisi baÅŸarısız olduher yazmadan sonra önbelleÄŸi diske boÅŸaltgeçmiÅŸ yapısı tahsisi baÅŸarısız olduboyut bilinmiyorsa, oranı maksimum oranla göstergirdi dosyası çıktı dosyasıdırtamsayı bağımsız deÄŸiÅŸkeni bekleniyorgeçersiz süreç kimliÄŸi (ID)bir dizindiraktarımı saniye başına ORAN bayt ile sınırlandırınsatır konumu arabellek tahsisi baÅŸarısız oldusatırlar boÅŸ sonlandırılırkilit denemesi baÅŸarısız oldumesaj alınamadısplice() kullanma, her zaman read/write kullanaktarım arabelleÄŸi ayrılmamışnormal bir dosya veya blok aygıtı deÄŸil/proc/self/fdinfo olmayan sistemlerde kullanılamazsayısal bağımsız deÄŸiÅŸken bekleniyorseçenek yapısı tahsisi baÅŸarısız olduseçenek yapısı argv tahsisi baÅŸarısız oldustandart hata bir terminal olmasa bile çıktı yazdırgörsel bilgileri deÄŸil, yüzdeleri çıktı olarak yazdırtransfer istatistiklerini sonda gösterpidgörsel bilgiyi İSİM ile öne eklesüreç kimliÄŸi (ID) veya pid:fd çifti bekleniyororan min/ortalama/maks/standart sapmaoran ölçülmediokuma baÅŸarısızFILE'da iÅŸlem kimliÄŸini (ID) kaydetseçme çaÄŸrısı baÅŸarısız oldutahmini veri boyutunu BOYUT bayt olarak ayarlayınçıktı formatını FORMAT olarak ayarlayınson yazılan NUM baytlarını göstermutlak tahmini varış (tamamlanma) zamanını gösterveri aktarımı ortalama hız sayacını gösterveri aktarım oranı sayacını göstergeçen süreyi göstertahmini varış (tamamlanma) zamanını gösteraktarılan bit sayısını gösteraktarılan bayt sayısını gösteraktarım tamponunun kullanım yüzdesini gösterilerleme çubuÄŸunu gösterbu yardımı göster ve çıksürüm bilgilerini göster ve çıkBAYTLAR blokları halinde hataları atlagirdideki okuma hatalarını atlageçmiÅŸ okuma hatası atlandıdurum tahsisi baÅŸarısız oldu--size bayt transfer edildikten sonra durekleri 1024 yerine 1000'in katları olarak deÄŸerlendirher SEC saniyede bir güncellemesüreç PID ayarlarını güncelleBAYTLAR tampon boyutu kullanınimleç konumlandırma kaçış dizilerini kullanÖnbelleÄŸi atlamak için doÄŸrudan I/O kullanuyarı: okuma hataları tespit edildiFD izleme dosyası PID iÅŸlemi tarafından açıldıçıktıya yazmadan önce tüm girdiyi DOSYA'ya yazHata ayıklama kayıtlarını DOSYA'ya yazyazma baÅŸarısızçıktıyı stdout yerine DOSYA'ya yazyzafpnum KMGTPEZYyzafpnum kMGTPEZYpv-1.9.31/po/tr.po000066400000000000000000000355141474702661500136610ustar00rootroot00000000000000msgid "" msgstr "" "Project-Id-Version: pv 1.8.14\n" "Report-Msgid-Bugs-To: pv@ivarch.com\n" "POT-Creation-Date: 2025-01-28 21:21+0000\n" "PO-Revision-Date: 2024-10-12 23:51+0000\n" "Last-Translator: a-j-wood \n" "Language-Team: Turkish \n" "Language: tr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" "X-Generator: Weblate 5.7.2\n" #: src/main/help.c:236 msgid "show progress bar" msgstr "ilerleme çubuÄŸunu göster" #: src/main/help.c:239 msgid "show elapsed time" msgstr "geçen süreyi göster" #: src/main/help.c:242 msgid "show estimated time of arrival (completion)" msgstr "tahmini varış (tamamlanma) zamanını göster" #: src/main/help.c:245 msgid "show absolute estimated time of arrival (completion)" msgstr "mutlak tahmini varış (tamamlanma) zamanını göster" #: src/main/help.c:248 msgid "show data transfer rate counter" msgstr "veri aktarım oranı sayacını göster" #: src/main/help.c:251 msgid "show data transfer average rate counter" msgstr "veri aktarımı ortalama hız sayacını göster" #: src/main/help.c:254 msgid "show number of bytes transferred" msgstr "aktarılan bayt sayısını göster" #: src/main/help.c:257 msgid "show percentage of transfer buffer in use" msgstr "aktarım tamponunun kullanım yüzdesini göster" #: src/main/help.c:259 msgid "NUM" msgstr "NUM" #: src/main/help.c:260 msgid "show NUM bytes last written" msgstr "son yazılan NUM baytlarını göster" #: src/main/help.c:262 msgid "FORMAT" msgstr "FORMAT" #: src/main/help.c:263 msgid "set output format to FORMAT" msgstr "çıktı formatını FORMAT olarak ayarlayın" #: src/main/help.c:266 msgid "output percentages, not visual information" msgstr "görsel bilgileri deÄŸil, yüzdeleri çıktı olarak yazdır" #: src/main/help.c:269 msgid "do not output any transfer information at all" msgstr "hiçbir transfer bilgisini yazdırma" #: src/main/help.c:273 msgid "show number of bits transferred" msgstr "aktarılan bit sayısını göster" #: src/main/help.c:276 msgid "treat suffixes as multiples of 1000 rather than 1024" msgstr "ekleri 1024 yerine 1000'in katları olarak deÄŸerlendir" #: src/main/help.c:279 msgid "display nothing until first byte transferred" msgstr "ilk bayt aktarılana kadar hiçbir ÅŸey gösterme" #: src/main/help.c:281 src/main/help.c:296 src/main/help.c:299 msgid "SEC" msgstr "SEC" #: src/main/help.c:282 msgid "display nothing until SEC seconds have passed" msgstr "SEC saniye geçene kadar hiçbir ÅŸey gösterme" #: src/main/help.c:284 msgid "SIZE" msgstr "BOYUT" #: src/main/help.c:285 msgid "set estimated data size to SIZE bytes" msgstr "tahmini veri boyutunu BOYUT bayt olarak ayarlayın" #: src/main/help.c:288 msgid "if size unknown, show rate vs max rate" msgstr "boyut bilinmiyorsa, oranı maksimum oranla göster" #: src/main/help.c:291 msgid "count lines instead of bytes" msgstr "bayt yerine satır say" #: src/main/help.c:294 msgid "lines are null-terminated" msgstr "satırlar boÅŸ sonlandırılır" #: src/main/help.c:297 msgid "update every SEC seconds" msgstr "her SEC saniyede bir güncelleme" #: src/main/help.c:300 msgid "compute average rate over past SEC seconds (default 30s)" msgstr "geçmiÅŸ SEC saniyeleri üzerinden ortalama hızı hesapla (varsayılan 30s)" #: src/main/help.c:302 msgid "WIDTH" msgstr "GENİŞLİK" #: src/main/help.c:303 msgid "assume terminal is WIDTH characters wide" msgstr "terminalin GENİŞLİK karakter geniÅŸliÄŸinde olduÄŸunu varsayalım" #: src/main/help.c:305 msgid "HEIGHT" msgstr "YÜKSEKLİK" #: src/main/help.c:306 msgid "assume terminal is HEIGHT rows high" msgstr "terminalin YÜKSEKLİK sıraları yüksekliÄŸinde olduÄŸunu varsayalım" #: src/main/help.c:308 msgid "NAME" msgstr "İSİM" #: src/main/help.c:309 msgid "prefix visual information with NAME" msgstr "görsel bilgiyi İSİM ile öne ekle" #: src/main/help.c:311 msgid "STYLE" msgstr "" #: src/main/help.c:312 msgid "set default bar style to NAME" msgstr "" #: src/main/help.c:314 msgid "SPEC" msgstr "" #: src/main/help.c:315 msgid "also send progress to SPEC" msgstr "" #: src/main/help.c:318 msgid "output transfer statistics at the end" msgstr "transfer istatistiklerini sonda göster" #: src/main/help.c:321 msgid "output even if standard error is not a terminal" msgstr "standart hata bir terminal olmasa bile çıktı yazdır" #: src/main/help.c:324 msgid "use cursor positioning escape sequences" msgstr "imleç konumlandırma kaçış dizilerini kullan" #: src/main/help.c:327 src/main/help.c:357 src/main/help.c:369 #: src/main/help.c:379 msgid "FILE" msgstr "DOSYA" #: src/main/help.c:328 msgid "write output to FILE instead of stdout" msgstr "çıktıyı stdout yerine DOSYA'ya yaz" #: src/main/help.c:330 msgid "RATE" msgstr "ORAN" #: src/main/help.c:331 msgid "limit transfer to RATE bytes per second" msgstr "aktarımı saniye başına ORAN bayt ile sınırlandırın" #: src/main/help.c:333 src/main/help.c:342 msgid "BYTES" msgstr "BAYTLAR" #: src/main/help.c:334 msgid "use a buffer size of BYTES" msgstr "BAYTLAR tampon boyutu kullanın" #: src/main/help.c:337 msgid "never use splice(), always use read/write" msgstr "splice() kullanma, her zaman read/write kullan" #: src/main/help.c:340 msgid "skip read errors in input" msgstr "girdideki okuma hatalarını atla" #: src/main/help.c:343 msgid "skip errors in BYTES blocks at a time" msgstr "BAYTLAR blokları halinde hataları atla" #: src/main/help.c:346 msgid "stop after --size bytes have been transferred" msgstr "--size bayt transfer edildikten sonra dur" #: src/main/help.c:349 msgid "flush cache to disk after every write" msgstr "her yazmadan sonra önbelleÄŸi diske boÅŸalt" #: src/main/help.c:352 msgid "use direct I/O to bypass cache" msgstr "ÖnbelleÄŸi atlamak için doÄŸrudan I/O kullan" #: src/main/help.c:355 msgid "discard input instead of writing to output" msgstr "Girdiyi çıktıya yazmak yerine yok say" #: src/main/help.c:358 msgid "write all input to FILE before writing to output" msgstr "çıktıya yazmadan önce tüm girdiyi DOSYA'ya yaz" #: src/main/help.c:360 msgid "PID[:FD]" msgstr "PID[:FD]" #: src/main/help.c:361 msgid "watch file FD opened by process PID" msgstr "FD izleme dosyası PID iÅŸlemi tarafından açıldı" #: src/main/help.c:364 msgid "PID" msgstr "PID" #: src/main/help.c:365 msgid "update settings of process PID" msgstr "süreç PID ayarlarını güncelle" #: src/main/help.c:370 msgid "save process ID in FILE" msgstr "FILE'da iÅŸlem kimliÄŸini (ID) kaydet" #: src/main/help.c:373 msgid "show this help and exit" msgstr "bu yardımı göster ve çık" #: src/main/help.c:376 msgid "show version information and exit" msgstr "sürüm bilgilerini göster ve çık" #: src/main/help.c:380 msgid "write debug logs to FILE" msgstr "Hata ayıklama kayıtlarını DOSYA'ya yaz" #: src/main/help.c:406 #, c-format msgid "Usage: %s [OPTION] [FILE]..." msgstr "Kullanım ÅŸekli: %s [AYAR] [DOSYA]..." #: src/main/help.c:417 msgid "" "Concatenate FILE(s), or standard input, to standard output, with monitoring." msgstr "" "İzleme ile DOSYA(lar)ı veya standart girdiyi standart çıktı ile birleÅŸtirin." #: src/main/help.c:555 msgid "Supported format sequences:" msgstr "" #: src/main/help.c:569 #, c-format msgid "Please report any bugs to: %s" msgstr "Lütfen hataları ÅŸu adrese bildirin: %s" #: src/main/main.c:232 msgid "(input)" msgstr "(giriÅŸ)" #: src/main/main.c:328 msgid "state allocation failed" msgstr "durum tahsisi baÅŸarısız oldu" #: src/main/options.c:144 src/pv/file.c:324 msgid "failed to stat file" msgstr "dosya statüsünde baÅŸarısız oldu" #: src/main/options.c:158 msgid "is a directory" msgstr "bir dizindir" #: src/main/options.c:187 msgid "failed to generate sysfs filename" msgstr "sysfs dosya adı oluÅŸturulamadı" #: src/main/options.c:209 msgid "failed to read sysfs size file" msgstr "sysfs boyut dosyası okunamadı" #: src/main/options.c:229 msgid "failed to open block device" msgstr "blok aygıtı açılamadı" #: src/main/options.c:239 msgid "failed to determine size of block device" msgstr "blok aygıtının boyutu belirlenemedi" #: src/main/options.c:345 msgid "option structure allocation failed" msgstr "seçenek yapısı tahsisi baÅŸarısız oldu" #: src/main/options.c:364 msgid "option structure argv allocation failed" msgstr "seçenek yapısı argv tahsisi baÅŸarısız oldu" #: src/main/options.c:417 msgid "numeric value not understood" msgstr "" #: src/main/options.c:435 msgid "integer argument expected" msgstr "tamsayı bağımsız deÄŸiÅŸkeni bekleniyor" #: src/main/options.c:447 msgid "numeric argument expected" msgstr "sayısal bağımsız deÄŸiÅŸken bekleniyor" #: src/main/options.c:458 msgid "process ID or pid:fd pair expected" msgstr "süreç kimliÄŸi (ID) veya pid:fd çifti bekleniyor" #: src/main/options.c:465 msgid "invalid process ID" msgstr "geçersiz süreç kimliÄŸi (ID)" #: src/main/options.c:698 #, c-format msgid "Try `%s --help' for more information." msgstr "Daha fazla bilgi için `%s --help' seçeneÄŸini deneyin." #: src/main/options.c:700 #, c-format msgid "Try `%s -h' for more information." msgstr "Daha fazla bilgi için `%s -h' seçeneÄŸini deneyin." #: src/main/options.c:731 msgid "" "cannot use line mode or transfer modifier options when watching file " "descriptors" msgstr "" "dosya tanımlayıcılarını izlerken satır modu veya aktarım deÄŸiÅŸtirici " "seçeneklerini kullanamaz" #: src/main/options.c:740 msgid "cannot use cursor positioning when watching file descriptors" msgstr "dosya tanımlayıcılarını izlerken imleç konumlandırmayı kullanamaz" #: src/main/options.c:749 msgid "cannot use remote control when watching file descriptors" msgstr "dosya tanımlayıcılarını izlerken uzaktan kumandayı kullanamaz" #: src/main/options.c:758 msgid "cannot transfer files when watching file descriptors" msgstr "dosya tanımlayıcıları izlenirken dosya aktarılamıyor" #: src/main/options.c:773 msgid "not available on systems without /proc/self/fdinfo" msgstr "/proc/self/fdinfo olmayan sistemlerde kullanılamaz" #: src/main/remote.c:309 msgid "message not received" msgstr "mesaj alınamadı" #: src/main/remote.c:440 msgid "SA_SIGINFO not supported on this system" msgstr "SA_SIGINFO bu sistemde desteklenmiyor" #: src/main/version.c:28 msgid "License: GPLv3+ " msgstr "Lisans: GPLv3+ " #: src/main/version.c:29 msgid "This is free software: you are free to change and redistribute it." msgstr "" "Bu özgür bir yazılımdır: deÄŸiÅŸtirmekte ve yeniden dağıtmakta özgürsünüz." #: src/main/version.c:30 msgid "There is NO WARRANTY, to the extent permitted by law." msgstr "Yasaların izin verdiÄŸi ölçüde GARANTİ YOKTUR." #: src/main/version.c:32 msgid "Project web site" msgstr "Proje web sitesi" #: src/pv/cursor.c:61 msgid "failed to get terminal name" msgstr "terminal adı alınamadı" #: src/pv/cursor.c:106 msgid "failed to open lock file" msgstr "lock dosyası açılamadı" #: src/pv/cursor.c:139 msgid "lock attempt failed" msgstr "kilit denemesi baÅŸarısız oldu" #: src/pv/cursor.c:400 msgid "failed to open terminal" msgstr "terminal açılamadı" #: src/pv/display.c:249 msgid "yzafpnum kMGTPEZY" msgstr "yzafpnum kMGTPEZY" #: src/pv/display.c:267 msgid "yzafpnum KMGTPEZY" msgstr "yzafpnum KMGTPEZY" #: src/pv/display.c:989 src/pv/transfer.c:1056 msgid "buffer allocation failed" msgstr "arabellek tahsisi baÅŸarısız oldu" #: src/pv/file.c:149 msgid "failed to seek to start of output" msgstr "çıktının baÅŸlangıcına ulaşılamadı" #: src/pv/file.c:294 msgid "failed to close file" msgstr "dosya kapatılamadı" #: src/pv/file.c:317 msgid "failed to read file" msgstr "dosya okunamadı" #: src/pv/file.c:332 msgid "failed to stat output file" msgstr "çıktı dosyası stat edilemedi" #: src/pv/file.c:354 msgid "input file is output file" msgstr "girdi dosyası çıktı dosyasıdır" #: src/pv/file.c:412 msgid "(none)" msgstr "(yok)" #: src/pv/file.c:414 msgid "(stdin)" msgstr "(stdin)" #: src/pv/format/averagerate.c:34 src/pv/format/progressbar.c:93 #: src/pv/format/rate.c:37 src/pv/loop.c:551 msgid "b/s" msgstr "b/s" #: src/pv/format/averagerate.c:38 src/pv/format/progressbar.c:97 #: src/pv/format/rate.c:41 msgid "/s" msgstr "/s" #: src/pv/format/averagerate.c:38 src/pv/format/progressbar.c:97 #: src/pv/format/rate.c:41 src/pv/loop.c:551 msgid "B/s" msgstr "B/s" #: src/pv/format/bytes.c:37 msgid "b" msgstr "b" #: src/pv/format/bytes.c:41 src/pv/transfer.c:594 msgid "B" msgstr "B" #: src/pv/format/eta.c:53 src/pv/format/eta.c:57 msgid "ETA" msgstr "ETA" #: src/pv/format/fineta.c:81 msgid "FIN" msgstr "FIN" #: src/pv/loop.c:550 msgid "rate min/avg/max/mdev" msgstr "oran min/ortalama/maks/standart sapma" #: src/pv/loop.c:562 msgid "rate not measured" msgstr "oran ölçülmedi" #: src/pv/loop.c:772 src/pv/loop.c:823 src/pv/loop.c:876 src/pv/watchpid.c:99 #: src/pv/watchpid.c:109 src/pv/watchpid.c:120 src/pv/watchpid.c:128 #: src/pv/watchpid.c:165 src/pv/watchpid.c:184 src/pv/watchpid.c:192 #: src/pv/watchpid.c:202 src/pv/watchpid.c:300 src/pv/watchpid.c:308 #: src/pv/watchpid.c:385 src/pv/watchpid.c:406 msgid "pid" msgstr "pid" #: src/pv/state.c:40 msgid "history structure allocation failed" msgstr "geçmiÅŸ yapısı tahsisi baÅŸarısız oldu" #: src/pv/state.c:617 src/pv/state.c:628 msgid "file list allocation failed" msgstr "dosya listesi tahsisi baÅŸarısız oldu" #: src/pv/transfer.c:463 msgid "read failed" msgstr "okuma baÅŸarısız" #: src/pv/transfer.c:479 msgid "warning: read errors detected" msgstr "uyarı: okuma hataları tespit edildi" #: src/pv/transfer.c:495 msgid "file is not seekable" msgstr "dosya aranabilir deÄŸil" #: src/pv/transfer.c:573 msgid "failed to seek past error" msgstr "geçmiÅŸ hatayı aramakta baÅŸarısız oldu" #: src/pv/transfer.c:593 msgid "skipped past read error" msgstr "geçmiÅŸ okuma hatası atlandı" #: src/pv/transfer.c:634 msgid "no transfer buffer allocated" msgstr "aktarım arabelleÄŸi ayrılmamış" #: src/pv/transfer.c:676 msgid "failed to set interval timer" msgstr "aralık zamanlayıcısı ayarlanamadı" #: src/pv/transfer.c:702 msgid "failed to clear interval timer" msgstr "aralık zamanlayıcısı temizlenemedi" #: src/pv/transfer.c:744 msgid "line position buffer allocation failed" msgstr "satır konumu arabellek tahsisi baÅŸarısız oldu" #: src/pv/transfer.c:917 msgid "write failed" msgstr "yazma baÅŸarısız" #: src/pv/transfer.c:1154 msgid "select call failed" msgstr "seçme çaÄŸrısı baÅŸarısız oldu" #: src/pv/watchpid.c:109 src/pv/watchpid.c:121 src/pv/watchpid.c:130 #: src/pv/watchpid.c:184 src/pv/watchpid.c:193 src/pv/watchpid.c:204 msgid "fd" msgstr "fd" #: src/pv/watchpid.c:130 src/pv/watchpid.c:204 msgid "not a regular file or block device" msgstr "normal bir dosya veya blok aygıtı deÄŸil" pv-1.9.31/src/000077500000000000000000000000001474702661500130355ustar00rootroot00000000000000pv-1.9.31/src/include/000077500000000000000000000000001474702661500144605ustar00rootroot00000000000000pv-1.9.31/src/include/config-aux.h000066400000000000000000000021441474702661500166720ustar00rootroot00000000000000/* * Standard definitions to make use of the config.h values set by the * `configure' script. Include this after config.h and before anything * else. * * Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2025 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #if ENABLE_NLS # ifdef HAVE_LIBINTL_H # include # endif # ifdef HAVE_LOCALE_H # include # endif # define _(String) gettext (String) # define N_(String) (String) #else # define _(String) (String) # define N_(String) (String) #endif #undef CURSOR_ANSWERBACK_BYTE_BY_BYTE #ifndef _AIX #define CURSOR_ANSWERBACK_BYTE_BY_BYTE 1 #endif /* Boolean type support */ #ifdef HAVE_STDBOOL_H # include #else # ifndef HAVE__BOOL # ifdef __cplusplus typedef bool _Bool; # else # define _Bool signed char # endif # endif # define bool _Bool # define false 0 # define true 1 # define __bool_true_false_are_defined 1 #endif /* Whether "--remote" should be available. */ #undef PV_REMOTE_CONTROL #if HAVE_DECL_SA_SIGINFO # if SIGINFO_PROVIDES_PID #define PV_REMOTE_CONTROL 1 # endif #endif pv-1.9.31/src/include/config.h.in000066400000000000000000000250431474702661500165070ustar00rootroot00000000000000/* src/include/config.h.in. Generated from configure.ac by autoheader. */ /* Debugging support enabled */ #undef ENABLE_DEBUGGING /* Build with ncurses support */ #undef ENABLE_NCURSES /* Define to 1 if translation of program messages to the user's native language is requested. */ #undef ENABLE_NLS /* Define to 1 if you have the `alarm' function. */ #undef HAVE_ALARM /* Define to 1 if you have the `basename' function. */ #undef HAVE_BASENAME /* Define to 1 if you have the Mac OS X function CFLocaleCopyPreferredLanguages in the CoreFoundation framework. */ #undef HAVE_CFLOCALECOPYPREFERREDLANGUAGES /* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in the CoreFoundation framework. */ #undef HAVE_CFPREFERENCESCOPYAPPVALUE /* Define to 1 if you have the `clock_gettime' function. */ #undef HAVE_CLOCK_GETTIME /* Define if the GNU dcgettext() function is already present or preinstalled. */ #undef HAVE_DCGETTEXT /* Define to 1 if you have the declaration of `SA_SIGINFO', and to 0 if you don't. */ #undef HAVE_DECL_SA_SIGINFO /* Define to 1 if you have the `dup2' function. */ #undef HAVE_DUP2 /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the `fdatasync' function. */ #undef HAVE_FDATASYNC /* Define to 1 if you have the `fmod' function. */ #undef HAVE_FMOD /* Define to 1 if you have the `fpathconf' function. */ #undef HAVE_FPATHCONF /* Define to 1 if you have the `getcwd' function. */ #undef HAVE_GETCWD /* Define to 1 if you have the header file. */ #undef HAVE_GETOPT_H /* Define to 1 if you have the `getopt_long' function. */ #undef HAVE_GETOPT_LONG /* Define if the GNU gettext() function is already present or preinstalled. */ #undef HAVE_GETTEXT /* Define if you have the iconv() function and it works. */ #undef HAVE_ICONV /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* IPC support enabled */ #undef HAVE_IPC /* Define to 1 if you have the header file. */ #undef HAVE_LANGINFO_H /* Define to 1 if you have the header file. */ #undef HAVE_LIBGEN_H /* Define to 1 if you have the header file. */ #undef HAVE_LIBINTL_H /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H /* Define to 1 if you have the header file. */ #undef HAVE_LOCALE_H /* Define to 1 if you have the header file. */ #undef HAVE_MATH_H /* 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 `memrchr' function. */ #undef HAVE_MEMRCHR /* Define to 1 if you have the `memset' function. */ #undef HAVE_MEMSET /* Define to 1 if you have the header file. */ #undef HAVE_MINIX_CONFIG_H /* Define to 1 if you have the `mkdir' function. */ #undef HAVE_MKDIR /* Define to 1 if you have the `nanosleep' function. */ #undef HAVE_NANOSLEEP /* Define to 1 if you have the `posix_fadvise' function. */ #undef HAVE_POSIX_FADVISE /* Define to 1 if you have the `posix_memalign' function. */ #undef HAVE_POSIX_MEMALIGN /* Define to 1 if you have the `select' function. */ #undef HAVE_SELECT /* Define to 1 if you have the `setitimer' function. */ #undef HAVE_SETITIMER /* Define to 1 if you have the `setlocale' function. */ #undef HAVE_SETLOCALE /* Define to 1 if you have the `setproctitle' function. */ #undef HAVE_SETPROCTITLE /* Define to 1 if you have the `shmget' function. */ #undef HAVE_SHMGET /* Define to 1 if you have the `splice' function. */ #undef HAVE_SPLICE /* Define to 1 if you have the `sqrtl' function. */ #undef HAVE_SQRTL /* Define to 1 if stdbool.h conforms to C99. */ #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_STDIO_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strchr' function. */ #undef HAVE_STRCHR /* Define to 1 if you have the `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 `strlcat' function. */ #undef HAVE_STRLCAT /* Define to 1 if you have the `strrchr' function. */ #undef HAVE_STRRCHR /* Define to 1 if you have the `strstr' function. */ #undef HAVE_STRSTR /* Define to 1 if you have the `strtoul' function. */ #undef HAVE_STRTOUL /* Define to 1 if `st_blksize' is a member of `struct stat'. */ #undef HAVE_STRUCT_STAT_ST_BLKSIZE /* Define to 1 if `st_rdev' is a member of `struct stat'. */ #undef HAVE_STRUCT_STAT_ST_RDEV /* Define to 1 if you have the `sysconf' function. */ #undef HAVE_SYSCONF /* Define to 1 if you have the header file. */ #undef HAVE_SYS_FILE_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_IOCTL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_IPC_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_SHM_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_SYSMACROS_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_TERMIOS_H /* Define to 1 if you have the header file. */ #undef HAVE_TERM_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `vsnprintf' function. */ #undef HAVE_VSNPRINTF /* Define to 1 if you have the header file. */ #undef HAVE_WCHAR_H /* Define to 1 if you have the header file. */ #undef HAVE_WCTYPE_H /* Define to 1 if the system has the type `_Bool'. */ #undef HAVE__BOOL /* 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 /* Signal handlers can determine the sending PID */ #undef SIGINFO_PROVIDES_PID /* Define to 1 if all of the C90 standard headers exist (not just the ones required in a freestanding environment). This macro is provided for backward compatibility; new code need not use it. */ #undef STDC_HEADERS /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif /* Enable general extensions on macOS. */ #ifndef _DARWIN_C_SOURCE # undef _DARWIN_C_SOURCE #endif /* Enable general extensions on Solaris. */ #ifndef __EXTENSIONS__ # undef __EXTENSIONS__ #endif /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif /* Enable X/Open compliant socket functions that do not require linking with -lxnet on HP-UX 11.11. */ #ifndef _HPUX_ALT_XOPEN_SOCKET_API # undef _HPUX_ALT_XOPEN_SOCKET_API #endif /* Identify the host operating system as Minix. This macro does not affect the system headers' behavior. A future release of Autoconf may stop defining this macro. */ #ifndef _MINIX # undef _MINIX #endif /* Enable general extensions on NetBSD. Enable NetBSD compatibility extensions on Minix. */ #ifndef _NETBSD_SOURCE # undef _NETBSD_SOURCE #endif /* Enable OpenBSD compatibility extensions on NetBSD. Oddly enough, this does nothing on OpenBSD. */ #ifndef _OPENBSD_SOURCE # undef _OPENBSD_SOURCE #endif /* Define to 1 if needed for POSIX-compatible behavior. */ #ifndef _POSIX_SOURCE # undef _POSIX_SOURCE #endif /* Define to 2 if needed for POSIX-compatible behavior. */ #ifndef _POSIX_1_SOURCE # undef _POSIX_1_SOURCE #endif /* Enable POSIX-compatible threading on Solaris. */ #ifndef _POSIX_PTHREAD_SEMANTICS # undef _POSIX_PTHREAD_SEMANTICS #endif /* Enable extensions specified by ISO/IEC TS 18661-5:2014. */ #ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ # undef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ #endif /* Enable extensions specified by ISO/IEC TS 18661-1:2014. */ #ifndef __STDC_WANT_IEC_60559_BFP_EXT__ # undef __STDC_WANT_IEC_60559_BFP_EXT__ #endif /* Enable extensions specified by ISO/IEC TS 18661-2:2015. */ #ifndef __STDC_WANT_IEC_60559_DFP_EXT__ # undef __STDC_WANT_IEC_60559_DFP_EXT__ #endif /* Enable extensions specified by ISO/IEC TS 18661-4:2015. */ #ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__ # undef __STDC_WANT_IEC_60559_FUNCS_EXT__ #endif /* Enable extensions specified by ISO/IEC TS 18661-3:2015. */ #ifndef __STDC_WANT_IEC_60559_TYPES_EXT__ # undef __STDC_WANT_IEC_60559_TYPES_EXT__ #endif /* Enable extensions specified by ISO/IEC TR 24731-2:2010. */ #ifndef __STDC_WANT_LIB_EXT2__ # undef __STDC_WANT_LIB_EXT2__ #endif /* Enable extensions specified by ISO/IEC 24747:2009. */ #ifndef __STDC_WANT_MATH_SPEC_FUNCS__ # undef __STDC_WANT_MATH_SPEC_FUNCS__ #endif /* Enable extensions on HP NonStop. */ #ifndef _TANDEM_SOURCE # undef _TANDEM_SOURCE #endif /* Enable X/Open extensions. Define to 500 only if necessary to make mbstate_t available. */ #ifndef _XOPEN_SOURCE # undef _XOPEN_SOURCE #endif /* Version number of package */ #undef VERSION /* 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 empty if `const' does not conform to ANSI C. */ #undef const /* Define to `int' if doesn't define. */ #undef gid_t /* Define to the type of a signed integer type of width exactly 32 bits if such a type exists and the standard includes do not define it. */ #undef int32_t /* Define to `int' if does not define. */ #undef mode_t /* Define to `long int' if does not define. */ #undef off_t /* Define as a signed integer type capable of holding a process identifier. */ #undef pid_t /* Define to `unsigned int' if does not define. */ #undef size_t /* Define to `int' if does not define. */ #undef ssize_t /* Define to `int' if doesn't define. */ #undef uid_t #include "config-aux.h" pv-1.9.31/src/include/options.h000066400000000000000000000103241474702661500163240ustar00rootroot00000000000000/* * Global program option structure and the parsing function prototype. * * Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2025 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #ifndef _OPTIONS_H #define _OPTIONS_H 1 #if HAVE_CONFIG_H #include "config.h" #endif #include #include #ifdef __cplusplus extern "C" { #endif struct opts_s; typedef struct opts_s *opts_t; /* * Structure describing run-time options. * * Members are ordered by size to minimise padding. */ struct opts_s { double interval; /* interval between updates */ double delay_start; /* delay before first display */ /*@keep@*/ const char *program_name; /* name the program is running as */ /*@keep@*/ /*@null@*/ char *output; /* fd to write output to */ /*@keep@*/ /*@null@*/ char *name; /* display name, if any */ /*@keep@*/ /*@null@*/ char *default_bar_style; /* default bar style */ /*@keep@*/ /*@null@*/ char *format; /* output format, if any */ /*@keep@*/ /*@null@*/ char *pidfile; /* PID file, if any */ /*@keep@*/ /*@null@*/ char *store_and_forward_file; /* store and forward file, if any */ /*@keep@*/ /*@null@*/ char *extra_display; /* extra display specifier, if any */ /*@keep@*/ /*@null@*/ const char **argv; /* array of non-option arguments */ size_t lastwritten; /* show N bytes last written */ off_t rate_limit; /* rate limit, in bytes per second */ size_t buffer_size; /* buffer size, in bytes (0=default) */ off_t size; /* total size of data */ off_t error_skip_block; /* skip block size, 0 for adaptive */ pid_t remote; /* PID of pv to update settings of */ unsigned int skip_errors; /* skip read errors counter */ pid_t watch_pid; /* process to watch fds of */ int watch_fd; /* fd to watch */ unsigned int average_rate_window; /* time window in seconds for average rate calculations */ unsigned int width; /* screen width */ unsigned int height; /* screen height */ unsigned int argc; /* number of non-option arguments */ unsigned int argv_length; /* allocated array size */ bool do_nothing; /* exit-without-doing-anything flag */ bool progress; /* progress bar flag */ bool timer; /* timer flag */ bool eta; /* ETA flag */ bool fineta; /* absolute ETA flag */ bool rate; /* rate counter flag */ bool average_rate; /* average rate counter flag */ bool bytes; /* bytes transferred flag */ bool bits; /* report transfer size in bits */ bool decimal_units; /* decimal prefix flag */ bool bufpercent; /* transfer buffer percentage flag */ bool force; /* force-if-not-terminal flag */ bool cursor; /* whether to use cursor positioning */ bool numeric; /* numeric output only */ bool wait; /* wait for transfer before display */ bool rate_gauge; /* if size unknown, show rate vs max rate */ bool linemode; /* count lines instead of bytes */ bool null_terminated_lines; /* lines are null-terminated */ bool no_display; /* do nothing other than pipe data */ bool no_splice; /* flag set if never to use splice */ bool stop_at_size; /* set if we stop at "size" bytes */ bool sync_after_write; /* set if we sync after every write */ bool direct_io; /* set if O_DIRECT is to be used */ bool discard_input; /* set to write nothing to output */ bool show_stats; /* set to write statistics at the end */ bool width_set_manually; /* width was set manually, not detected */ bool height_set_manually; /* height was set manually, not detected */ }; /*@-exportlocal@*/ /* splint thinks opts_free is exported but not used - it is used. */ extern /*@null@*/ /*@only@*/ opts_t opts_parse(unsigned int, char **); extern void opts_free(/*@only@*/ opts_t); extern bool opts_add_file(opts_t, const char *); #ifdef __cplusplus } #endif #endif /* _OPTIONS_H */ pv-1.9.31/src/include/pv-internal.h000066400000000000000000000556101474702661500170770ustar00rootroot00000000000000/* * Functions internal to the PV library. Include "config.h" first. * * Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2025 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #ifndef _PV_INTERNAL_H #define _PV_INTERNAL_H 1 #ifdef HAVE_STDINT_H #include #endif #include #include #include #include #include #include #ifdef __cplusplus extern "C" { #endif #define RATE_GRANULARITY 100000000 /* nsec between -L rate chunks */ #define RATE_BURST_WINDOW 5 /* rate burst window (multiples of rate) */ #define REMOTE_INTERVAL 100000000 /* nsec between checks for -R */ #define BUFFER_SIZE (size_t) 409600 /* default transfer buffer size */ #define BUFFER_SIZE_MAX (size_t) 524288 /* max auto transfer buffer size */ #define MAX_READ_AT_ONCE (size_t) 524288 /* max to read() in one go */ #define MAX_WRITE_AT_ONCE (size_t) 524288 /* max to write() in one go */ #define TRANSFER_READ_TIMEOUT 0.09L /* seconds to time reads out at */ #define TRANSFER_WRITE_TIMEOUT 0.9L /* seconds to time writes out at */ #define MAX_LINE_POSITIONS 100000 /* number of lines to remember positions of */ #define MAXIMISE_BUFFER_FILL 1 #define PV_SIZEOF_DEFAULT_FORMAT 512 #define PV_SIZEOF_CWD 4096 #define PV_SIZEOF_LASTWRITTEN_BUFFER 256 #define PV_SIZEOF_PREVLINE_BUFFER 1024 #define PV_FORMAT_ARRAY_MAX 100 #define PV_SIZEOF_FORMAT_SEGMENTS_BUF 4096 #define PV_SIZEOF_CRS_LOCK_FILE 1024 #define PV_SIZEOF_FILE_FDINFO 4096 #define PV_SIZEOF_FILE_FD 4096 #define PV_SIZEOF_FILE_FDPATH 4096 #define PV_SIZEOF_DISPLAY_NAME 512 #define PV_BARSTYLE_MAX 4 /* number of different styles allowed in a format */ #define PV_BARSTYLE_SIZEOF_STRING 10 /* max length of a bar constituent component in bytes */ #define PV_BARSTYLE_MAX_FILLERS 10 /* max number of bar filler strings */ #define PV_DISPLAY_WINDOWTITLE 1 #define PV_DISPLAY_PROCESSTITLE 2 /* * Structure for data shared between multiple "pv -c" instances. */ struct pvcursorstate_s { int y_topmost; /* terminal row of topmost "pv" instance */ bool tty_tostop_added; /* whether any instance had to set TOSTOP on the terminal */ }; /* * Types of transfer count - bytes, decimal bytes or lines. */ typedef enum { PV_TRANSFERCOUNT_BYTES, PV_TRANSFERCOUNT_DECBYTES, PV_TRANSFERCOUNT_LINES } pvtransfercount_t; /* * Structure describing a short string used as part of a progress bar, whose * width in display characters may not be the same as its length in bytes. */ struct pvbarstring_spec_s { char string[PV_BARSTYLE_SIZEOF_STRING]; uint8_t width; uint8_t bytes; }; /* * Structure describing a style of progress bar. * * The part that moves back and forth when the size isn't known, such as * "<=>", is "indicator". * * The string used to populate the rest of the bar is one of "filler", which * contains "filler_entries" array items. The first item "filler[0]" is * used for an empty part such as " ". The last item * "filler[filler_entries-1]" is used for a 100% full part, such as "=". * * If there are more than the minimum of 2 entries, then the intervening * entries are used for partial fills. * * When there are only 2 entries and the bar isn't completely empty or full, * the last filled portion of the bar is filled with "tip" instead of the * last filler item to indicate the tip of the bar, such as ">". * * Note that only the indicator is expected to ever be wider than 1 display * character. All other items are expected to have a width of 0 or 1. * * The "style_id" is an opaque identifier that should only be used to * determine whether two styles are the same. It is always nonzero. */ struct pvbarstyle_s { uint8_t style_id; uint8_t filler_entries; struct pvbarstring_spec_s indicator; struct pvbarstring_spec_s tip; struct pvbarstring_spec_s filler[PV_BARSTYLE_MAX_FILLERS]; }; typedef struct pvbarstyle_s *pvbarstyle_t; /* Display format component type, -1 for static string. */ typedef int8_t pvdisplay_component_t; #define PVDISPLAY_COMPONENT_MAX (127) /* INT8_MAX */ /* Byte count of a part of the display. */ typedef uint16_t pvdisplay_bytecount_t; #define PVDISPLAY_BYTECOUNT_MAX (65535) /* UINT16_MAX */ /* Width of a part of the display. */ typedef uint16_t pvdisplay_width_t; #define PVDISPLAY_WIDTH_MAX (65535) /* UINT16_MAX */ /* * Structure for holding PV internal state. Opaque outside the PV library. * * In general, members are ordered by size, to minimise padding. */ struct pvstate_s { /****************** * Program status * ******************/ struct { /*@only@*/ char *program_name; /* program name for error reporting */ char cwd[PV_SIZEOF_CWD]; /* current working directory for relative path */ int current_input_file; /* index of current file being read */ int exit_status; /* exit status to give (0=OK) */ } status; /*************** * Input files * ***************/ struct { /*@only@*/ /*@null@*/ char **filename; /* input filenames */ unsigned int file_count; /* number of input files */ } files; /******************* * Program control * *******************/ struct { char default_format[PV_SIZEOF_DEFAULT_FORMAT]; /* default format string */ double interval; /* interval between updates */ double delay_start; /* delay before first display */ /*@only@*/ /*@null@*/ char *name; /* display name */ /*@only@*/ /*@null@*/ char *format_string; /* output format string */ /*@only@*/ /*@null@*/ char *extra_format_string; /* extra format string */ /*@null@*/ char *output_name; /* name of the output, for diagnostics */ /*@null@*/ char *default_bar_style; /* which bar style to use by default */ off_t error_skip_block; /* skip block size, 0 for adaptive */ off_t rate_limit; /* rate limit, in bytes per second */ size_t target_buffer_size; /* buffer size (0=default) */ off_t size; /* total size of data */ pid_t watch_pid; /* process to watch fds of */ unsigned int skip_errors; /* skip read errors counter */ int watch_fd; /* fd to watch */ int output_fd; /* fd to write output to */ unsigned int average_rate_window; /* time window in seconds for average rate calculations */ unsigned int history_interval; /* seconds between each average rate calc history entry */ pvdisplay_width_t width; /* screen width */ unsigned int height; /* screen height */ unsigned int extra_displays; /* bitmask of extra display destinations */ bool force; /* display even if not on terminal */ bool cursor; /* use cursor positioning */ bool numeric; /* numeric output only */ bool wait; /* wait for data before display */ bool rate_gauge; /* if size unknown, show rate vs max rate */ bool linemode; /* count lines instead of bytes */ bool bits; /* report bits instead of bytes */ bool decimal_units; /* use decimal prefixes */ bool null_terminated_lines; /* lines are null-terminated */ bool no_display; /* do nothing other than pipe data */ bool stop_at_size; /* set if we stop at "size" bytes */ bool sync_after_write; /* set if we sync after every write */ bool direct_io; /* set if O_DIRECT is to be used */ bool direct_io_changed; /* set when direct_io is changed */ bool no_splice; /* never use splice() */ bool discard_input; /* write nothing to stdout */ bool show_stats; /* show statistics on exit */ bool can_display_utf8; /* whether UTF-8 output is permitted */ bool can_display_colour; /* whether the terminal supports colour */ bool checked_colour_support; /* whether we have checked colour support yet */ bool width_set_manually; /* width was set manually, not detected */ bool height_set_manually; /* height was set manually, not detected */ } control; /******************* * Signal handling * *******************/ struct { /* old signal handlers to restore in pv_sig_fini(). */ struct sigaction old_sigpipe; struct sigaction old_sigttou; struct sigaction old_sigtstp; struct sigaction old_sigcont; struct sigaction old_sigwinch; struct sigaction old_sigint; struct sigaction old_sighup; struct sigaction old_sigterm; #ifdef PV_REMOTE_CONTROL struct sigaction old_sigusr2; #endif struct sigaction old_sigalrm; struct timespec tstp_time; /* see pv_sig_tstp() / __cont() */ struct timespec toffset; /* total time spent stopped */ #ifdef PV_REMOTE_CONTROL volatile sig_atomic_t rxusr2; /* whether SIGUSR2 was received */ volatile pid_t sender; /* PID of sending process for SIGUSR2 */ #endif } signal; /******************* * Transient flags * *******************/ struct { volatile sig_atomic_t reparse_display; /* whether to re-check format string */ volatile sig_atomic_t terminal_resized; /* whether we need to get term size again */ volatile sig_atomic_t trigger_exit; /* whether we need to abort right now */ volatile sig_atomic_t clear_tty_tostop_on_exit; /* whether to clear tty TOSTOP on exit */ volatile sig_atomic_t suspend_stderr; /* whether writing to stderr is suspended */ volatile sig_atomic_t skip_next_sigcont; /* whether to ignore the next SIGCONT */ volatile sig_atomic_t pipe_closed; /* whether the output pipe was closed */ } flag; /***************** * Display state * *****************/ struct pvdisplay_s { struct pvdisplay_segment_s { /* format string broken into segments */ /* See pv__format_init() for more details. */ /*@dependent@*/ /*@null@*/ const char *string_parameter; /* parameter after colon in %{x:} */ pvdisplay_bytecount_t string_parameter_bytes; /* number of bytes in string_parameter */ pvdisplay_component_t type; /* component type, -1 for static string */ int8_t parameter; /* component parameter, such as bar style index */ pvdisplay_width_t chosen_size; /* "n" from %A, or 0 */ pvdisplay_bytecount_t offset; /* start offset of this segment in the build buffer */ pvdisplay_bytecount_t bytes; /* length of segment in bytes in the build buffer */ pvdisplay_width_t width; /* displayed width of segment */ } format[PV_FORMAT_ARRAY_MAX]; struct pvbarstyle_s barstyle[PV_BARSTYLE_MAX]; /* The last-written "n" bytes. */ char lastwritten_buffer[PV_SIZEOF_LASTWRITTEN_BUFFER]; /* The most recently output complete line. */ char previous_line[PV_SIZEOF_PREVLINE_BUFFER]; /* The line being received now. */ char next_line[PV_SIZEOF_PREVLINE_BUFFER]; /*@only@*/ /*@null@*/ char *display_buffer; /* buffer for display string */ off_t initial_offset; /* offset when first opened (when watching fds) */ size_t next_line_len; /* length of currently receiving line so far */ size_t format_segment_count; /* number of format string segments */ pvtransfercount_t count_type; /* type of count for transfer, rate, etc */ pvdisplay_width_t prev_screen_width; /* screen width last time we were called */ pvdisplay_bytecount_t display_buffer_size; /* size allocated to display buffer */ pvdisplay_bytecount_t display_string_bytes; /* byte length of string in display buffer */ pvdisplay_width_t display_string_width; /* displayed width of string in display buffer */ pvdisplay_bytecount_t lastwritten_bytes; /* largest number of last-written bytes to show */ bool showing_timer; /* set if showing timer */ bool showing_bytes; /* set if showing byte/line count */ bool showing_rate; /* set if showing transfer rate */ bool showing_last_written; /* set if displaying the last few bytes written */ bool showing_previous_line; /* set if displaying the previously output line */ bool format_uses_colour; /* set if the format string uses colours */ bool colour_permitted; /* whether colour is permitted for this display */ bool sgr_code_active; /* set while SGR code is active in a display line */ bool final_update; /* set internally on the final update */ bool display_visible; /* set once anything written to terminal */ } display; /* Extra display for alternate outputs like a window title. */ struct pvdisplay_s extra_display; /************************************ * Calculated state of the transfer * ************************************/ struct { long double transfer_rate; /* calculated transfer rate */ long double average_rate; /* calculated average transfer rate */ long double prev_elapsed_sec; /* elapsed sec at which rate last calculated */ long double prev_rate; /* last calculated instantaneous transfer rate */ long double prev_trans; /* amount transferred since last rate calculation */ long double current_avg_rate; /* current average rate over last history intervals */ long double rate_min; /* minimum measured transfer rate */ long double rate_max; /* maximum measured transfer rate */ long double rate_sum; /* sum of all measured transfer rates */ long double ratesquared_sum; /* sum of the squares of each transfer rate */ unsigned long measurements_taken; /* how many times the rate was measured */ /* Keep track of progress over last intervals to compute current average rate. */ /*@null@*/ struct { /* state at previous intervals (circular buffer) */ long double elapsed_sec; /* time since start of transfer */ off_t transferred; /* amount transferred by that time */ } *history; size_t history_len; /* total size of history array */ size_t history_first; /* index of oldest entry */ size_t history_last; /* index of newest entry */ off_t prev_transferred; /* total amount transferred when called last time */ double percentage; /* transfer percentage completion */ } calc; /******************** * Cursor/IPC state * ********************/ struct { char lock_file[PV_SIZEOF_CRS_LOCK_FILE]; #ifdef HAVE_IPC /*@keep@*/ /*@null@*/ struct pvcursorstate_s *shared; /* data shared between instances */ int shmid; /* ID of our shared memory segment */ int pvcount; /* number of `pv' processes in total */ int pvmax; /* highest number of `pv's seen */ int y_lastread; /* last value of _y_top seen */ int y_offset; /* our Y offset from this top position */ int needreinit; /* counter if we need to reinit cursor pos */ #endif /* HAVE_IPC */ int lock_fd; /* fd of lockfile, -1 if none open */ int y_start; /* our initial Y coordinate */ #ifdef HAVE_IPC bool noipc; /* set if we can't use IPC */ #endif /* HAVE_IPC */ } cursor; /******************* * Transfer state * *******************/ /* * The transfer buffer is used for moving data from the input files * to the output when splice() is not available. * * If buffer_size is smaller than pv__target_bufsize, then * pv_transfer() will try to reallocate transfer_buffer to make * buffer_size equal to pv__target_bufsize. * * Data from the input files is read into the buffer; read_position * is the offset in the buffer that we've read data up to. * * Data is written to the output from the buffer, and write_position * is the offset in the buffer that we've written data up to. It * will always be less than or equal to read_position. */ struct { long double elapsed_seconds; /* how long we have been transferring data for */ /*@only@*/ /*@null@*/ char *transfer_buffer; /* data transfer buffer */ size_t buffer_size; /* size of buffer */ size_t read_position; /* amount of data in buffer */ size_t write_position; /* buffered data written */ ssize_t to_write; /* max to write this time around */ ssize_t written; /* bytes sent to stdout this time */ size_t written_but_not_consumed; /* bytes in the output pipe, unread */ off_t total_written; /* total bytes or lines written */ off_t transferred; /* amount transferred (written - unconsumed) */ /* Keep track of line positions to backtrack written_but_not_consumed. */ /*@only@*/ /*@null@*/ off_t *line_positions; /* line separator write positions (circular buffer) */ size_t line_positions_capacity; /* total size of line position array */ size_t line_positions_length; /* number of positions stored in array */ size_t line_positions_head; /* index to use for next position */ off_t last_output_position; /* write position last sent to output */ /* * While reading from a file descriptor we keep track of how * many times in a row we've seen errors * (read_errors_in_a_row), and whether or not we have put a * warning on stderr about read errors on this fd * (read_error_warning_shown). * * Whenever the active file descriptor changes from * last_read_skip_fd, we reset read_errors_in_a_row to 0 and * read_error_warning_shown to false for the new file * descriptor and set last_read_skip_fd to the new fd * number. * * This way, we're treating each input file separately. */ off_t read_errors_in_a_row; int last_read_skip_fd; /* read_error_warning_shown is defined below. */ #ifdef HAVE_SPLICE /* * These variables are used to keep track of whether * splice() was used; splice_failed_fd is the file * descriptor that splice() last failed on, so that we don't * keep trying to use it on an fd that doesn't support it, * and splice_used is set to true if splice() was used this * time within pv_transfer(). */ int splice_failed_fd; bool splice_used; #endif bool read_error_warning_shown; } transfer; }; typedef struct pvdisplay_s *pvdisplay_t; typedef struct pvdisplay_segment_s *pvdisplay_segment_t; /* * Structure containing the parameters used by formatters. */ struct pvformatter_args_s { /*@dependent@*/ pvstate_t state; /* overall state */ /*@dependent@*/ pvdisplay_t display; /* the display being updated */ /*@dependent@*/ pvdisplay_segment_t segment; /* the segment of the display */ /*@dependent@*/ char *buffer; /* buffer to write formatted segments into */ pvdisplay_bytecount_t buffer_size; /* size of the buffer */ pvdisplay_bytecount_t offset; /* current write position in the buffer */ }; typedef struct pvformatter_args_s *pvformatter_args_t; /* Pointer to a formatter function. */ typedef pvdisplay_bytecount_t (*pvdisplay_formatter_t)(pvformatter_args_t); /* * Structure defining a format string sequence following a %. */ struct pvdisplay_component_s { /*@null@ */ const char *match; /* string to match */ /*@null@ */ pvdisplay_formatter_t function; /* function to call */ bool dynamic; /* whether it can scale with screen size */ }; struct pvwatchfd_s { #ifdef __APPLE__ #else char file_fdinfo[PV_SIZEOF_FILE_FDINFO]; /* path to /proc fdinfo file */ char file_fd[PV_SIZEOF_FILE_FD]; /* path to /proc fd symlink */ #endif char file_fdpath[PV_SIZEOF_FILE_FDPATH]; /* path to file that was opened */ char display_name[PV_SIZEOF_DISPLAY_NAME]; /* name to show on progress bar */ struct stat sb_fd; /* stat of fd symlink */ struct stat sb_fd_link; /* lstat of fd symlink */ off_t size; /* size of whole file, 0 if unknown */ off_t position; /* position last seen at */ struct timespec start_time; /* time we started watching the fd */ /*@null@*/ pvstate_t state; /* state object for flags and display */ pid_t watch_pid; /* PID to watch */ int watch_fd; /* fd to watch, -1 = not displayed */ }; typedef struct pvwatchfd_s *pvwatchfd_t; void pv_error(pvstate_t, char *, ...); int pv_main_loop(pvstate_t); void pv_calculate_transfer_rate(pvstate_t, bool); long pv_bound_long(long, long, long); long pv_seconds_remaining(const off_t, const off_t, const long double); void pv_si_prefix(long double *, char *, const long double, pvtransfercount_t); void pv_describe_amount(char *, size_t, char *, long double, char *, char *, pvtransfercount_t); int8_t pv_display_barstyle_index(pvformatter_args_t, const char *); pvdisplay_bytecount_t pv_formatter_segmentcontent(char *, pvformatter_args_t); /* * Formatting functions. * * Each formatting function takes a state, the current display, and the * segment it's for; it also takes a buffer, with a particular size, and an * offset at which to start writing to the buffer. * * If the component is dynamically sized (such as a progress bar with no * chosen_size constraint), the segment's "width" is expected to have * already been populated by the caller, with the target width. * * The function writes the appropriate string to the buffer at the offset, * and updates the segment's "offset" and "bytes". The number of bytes * written ("bytes") is also returned; it will be 0 if the string would not * fit into the buffer. * * The caller is expected to update the segment's "width". * * If called with a buffer size of 0, only the side effects occur (such as * setting flags like display->showing_timer). */ pvdisplay_bytecount_t pv_formatter_progress(pvformatter_args_t); pvdisplay_bytecount_t pv_formatter_progress_bar_only(pvformatter_args_t); pvdisplay_bytecount_t pv_formatter_progress_amount_only(pvformatter_args_t); pvdisplay_bytecount_t pv_formatter_bar_default(pvformatter_args_t); pvdisplay_bytecount_t pv_formatter_bar_plain(pvformatter_args_t); pvdisplay_bytecount_t pv_formatter_bar_block(pvformatter_args_t); pvdisplay_bytecount_t pv_formatter_bar_granular(pvformatter_args_t); pvdisplay_bytecount_t pv_formatter_bar_shaded(pvformatter_args_t); pvdisplay_bytecount_t pv_formatter_timer(pvformatter_args_t); pvdisplay_bytecount_t pv_formatter_eta(pvformatter_args_t); pvdisplay_bytecount_t pv_formatter_fineta(pvformatter_args_t); pvdisplay_bytecount_t pv_formatter_rate(pvformatter_args_t); pvdisplay_bytecount_t pv_formatter_average_rate(pvformatter_args_t); pvdisplay_bytecount_t pv_formatter_bytes(pvformatter_args_t); pvdisplay_bytecount_t pv_formatter_buffer_percent(pvformatter_args_t); pvdisplay_bytecount_t pv_formatter_last_written(pvformatter_args_t); pvdisplay_bytecount_t pv_formatter_previous_line(pvformatter_args_t); pvdisplay_bytecount_t pv_formatter_name(pvformatter_args_t); pvdisplay_bytecount_t pv_formatter_sgr(pvformatter_args_t); bool pv_format(pvstate_t, /*@null@*/ const char *, pvdisplay_t, bool, bool); void pv_display(pvstate_t, bool); ssize_t pv_transfer(pvstate_t, int, bool *, bool *, off_t, long *); int pv_next_file(pvstate_t, unsigned int, int); /*@keep@*/ const char *pv_current_file_name(pvstate_t); void pv_write_retry(int, const char *, size_t); void pv_tty_write(pvstate_t, const char *, size_t); void pv_crs_fini(pvstate_t); void pv_crs_init(pvstate_t); void pv_crs_update(pvstate_t, const char *); #ifdef HAVE_IPC void pv_crs_needreinit(pvstate_t); #endif void pv_sig_allowpause(void); void pv_sig_checkbg(void); void pv_sig_nopause(void); void pv_remote_init(pvstate_t); void pv_remote_check(pvstate_t); void pv_remote_fini(pvstate_t); int pv_remote_set(pvstate_t); int pv_watchfd_info(pvstate_t, pvwatchfd_t, bool); bool pv_watchfd_changed(pvwatchfd_t); off_t pv_watchfd_position(pvwatchfd_t); int pv_watchpid_scanfds(pvstate_t, pid_t, int *, pvwatchfd_t *, int *); void pv_watchpid_setname(pvstate_t, pvwatchfd_t); #ifdef __cplusplus } #endif #endif /* _PV_INTERNAL_H */ pv-1.9.31/src/include/pv.h000066400000000000000000000221311474702661500152550ustar00rootroot00000000000000/* * Functions used across the program. * * Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2025 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #ifndef _PV_H #define _PV_H 1 #if HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #ifdef __cplusplus extern "C" { #endif /* * Exit status bitmask values. */ #define PV_ERROREXIT_REMOTE_OR_PID 1 #define PV_ERROREXIT_SAF 1 /* store and forward error */ #define PV_ERROREXIT_ACCESS 2 #define PV_ERROREXIT_OUROBOROS 4 #define PV_ERROREXIT_TRANSITION 8 #define PV_ERROREXIT_TRANSFER 16 #define PV_ERROREXIT_SIGNAL 32 #define PV_ERROREXIT_MEMORY 64 /* * Opaque structure for PV internal state. */ struct pvstate_s; typedef struct pvstate_s *pvstate_t; /* * Valid number types for pv_getnum_check(). */ typedef enum { PV_NUMTYPE_ANY_WITH_SUFFIX, PV_NUMTYPE_BARE_INTEGER, PV_NUMTYPE_BARE_DOUBLE } pv_numtype; /* * Simple string functions for processing numbers. */ /* * Return true if the character is an ASCII digit. */ extern bool pv_isdigit(char); /* * Return the given string converted to a double, for use as a time * interval. */ extern double pv_getnum_interval(const char *); /* * Return the given string converted to an off_t, for use as a size, * optionally interpreting suffixes in decimal units (multiples of 1000) * instead of multiples of 1024. */ extern off_t pv_getnum_size(const char *, bool); /* * Return the given string converted to an unsigned integer, for use as a * count such as screen width. */ extern unsigned int pv_getnum_count(const char *, bool); /* * Return true if the given string is a number of the given type. NB an * integer is both a valid integer and a valid double. */ extern bool pv_getnum_check(const char *, pv_numtype); /* * Return a value representing the first amount as a percentage of the * second total, i.e. 100*amount/total. If the second value, the total, is * zero or less, return 0. */ extern double pv_percentage(off_t, const off_t); /* * String handling wrappers. */ /* * Wrapper for sprintf(), falling back to sprintf() on systems without that * function. */ extern int pv_snprintf(char *, size_t, const char *, ...); /* * Implementation of strlcat() where it is unavailable: append a string to a * buffer, constraining the buffer to a particular size and ensuring * termination with '\0'. */ extern size_t pv_strlcat(char *, const char *, size_t); /* * Allocate and return a duplicate of a \0-terminated string, ensuring that * the duplicate is also \0-terminated. Returns NULL on error. */ /*@null@ */ /*@only@ */ extern char *pv_strdup(const char *); /* * Return a pointer to the last matching character in the buffer, or NULL if * not found. */ /*@null@ */ /*@temp@ */ extern void *pv_memrchr(const void *, int, size_t); /* * Return the displayed width of a string. */ extern size_t pv_strwidth(const char *, size_t); /* * Return true if the character is printable. */ extern bool pv_isprint(char); /* * Functions relating to elapsed time. */ /* * Read the current elapsed time, relative to an unspecified point in the * past, and store it in the given timespec buffer. The time is guaranteed * to not go backwards and does not count time when the system was * suspended. See clock_gettime(2) with CLOCK_MONOTONIC. */ void pv_elapsedtime_read(struct timespec *); /* Set the time in the given timespec to zero. */ void pv_elapsedtime_zero(struct timespec *); /* Copy the second timespec into the first. Analogous to strcpy(3). */ void pv_elapsedtime_copy(struct timespec *, const struct timespec *); /* * Return -1, 0, or 1 depending on whether the first time is earlier than, * equal to, or later than the second time. Analogous to strcmp(3). */ int pv_elapsedtime_compare(const struct timespec *, const struct timespec *); /* Add the latter two timespecs and store them in the first timespec. */ void pv_elapsedtime_add(struct timespec *, const struct timespec *, const struct timespec *); /* Add a number of nanoseconds to the given timespec. */ void pv_elapsedtime_add_nsec(struct timespec *, long long); /* Set the first timespec to the second minus the third. */ void pv_elapsedtime_subtract(struct timespec *, const struct timespec *, const struct timespec *); /* Convert a timespec to seconds. */ long double pv_elapsedtime_seconds(const struct timespec *); /* Sleep for a number of nanoseconds. */ void pv_nanosleep(long long); /* * Main PV functions. */ /* * Create a new state structure, and return it, or 0 (NULL) on error. */ extern /*@null@*/ /*@only@*/ pvstate_t pv_state_alloc(const char *); /* * Clear the calculated parts of a state structure. */ extern void pv_state_reset(pvstate_t state); /* * Set the formatting string, given a set of old-style formatting options. */ extern void pv_state_set_format(pvstate_t state, bool progress, bool timer, bool eta, bool fineta, bool rate, bool average_rate, bool bytes, bool bufpercent, size_t lastwritten, /*@null@*/ const char *name); /* * Set the various options. */ extern void pv_state_force_set(pvstate_t, bool); extern void pv_state_cursor_set(pvstate_t, bool); extern void pv_state_show_stats_set(pvstate_t, bool); extern void pv_state_numeric_set(pvstate_t, bool); extern void pv_state_wait_set(pvstate_t, bool); extern void pv_state_delay_start_set(pvstate_t, double); extern void pv_state_rate_gauge_set(pvstate_t, bool); extern void pv_state_linemode_set(pvstate_t, bool); extern void pv_state_bits_set(pvstate_t, bool); extern void pv_state_decimal_units_set(pvstate_t, bool); extern void pv_state_null_terminated_lines_set(pvstate_t, bool); extern void pv_state_no_display_set(pvstate_t, bool); extern void pv_state_skip_errors_set(pvstate_t, unsigned int); extern void pv_state_error_skip_block_set(pvstate_t, off_t); extern void pv_state_stop_at_size_set(pvstate_t, bool); extern void pv_state_sync_after_write_set(pvstate_t, bool); extern void pv_state_direct_io_set(pvstate_t, bool); extern void pv_state_rate_limit_set(pvstate_t, off_t); extern void pv_state_target_buffer_size_set(pvstate_t, size_t); extern void pv_state_no_splice_set(pvstate_t, bool); extern void pv_state_discard_input_set(pvstate_t, bool); extern void pv_state_size_set(pvstate_t, off_t); extern void pv_state_interval_set(pvstate_t, double); extern void pv_state_width_set(pvstate_t, unsigned int, bool); extern void pv_state_height_set(pvstate_t, unsigned int, bool); extern void pv_state_name_set(pvstate_t, /*@null@*/ const char *); extern void pv_state_default_bar_style_set(pvstate_t, /*@null@ */ const char *); extern void pv_state_format_string_set(pvstate_t, /*@null@*/ const char *); extern void pv_state_extra_display_set(pvstate_t, /*@null@*/ const char *); extern void pv_state_watch_pid_set(pvstate_t, pid_t); extern void pv_state_watch_fd_set(pvstate_t, int); extern void pv_state_output_set(pvstate_t, int, const char *); extern void pv_state_average_rate_window_set(pvstate_t, unsigned int); extern void pv_state_set_can_display_utf8(pvstate_t, bool); extern void pv_state_inputfiles(pvstate_t, unsigned int, const char **); /* * Work out whether we are in the foreground. */ extern bool pv_in_foreground(void); /* * Work out the terminal size. */ extern void pv_screensize(unsigned int *width, unsigned int *height); /* * Calculate the total size of all input files. */ extern off_t pv_calc_total_size(pvstate_t); /* * Set up signal handlers ready for running the main loop. */ extern void pv_sig_init(pvstate_t); #ifdef PV_REMOTE_CONTROL /* * Return true if SIGUSR2 has been received, and indicate the sender. */ extern bool pv_sigusr2_received(pvstate_t, pid_t *); #endif /* * Enter the main transfer loop, transferring all input files to the output. */ extern int pv_main_loop(pvstate_t); /* * Watch the selected file descriptor of the selected process. */ extern int pv_watchfd_loop(pvstate_t); /* * Watch the selected process. */ extern int pv_watchpid_loop(pvstate_t); /* * Shut down signal handlers after running the main loop. */ extern void pv_sig_fini(pvstate_t); /* * Free a state structure, after which it can no longer be used. */ extern void pv_state_free(/*@only@*/ pvstate_t); /* * Return a string listing all supported format sequences. */ /*@null@*/ char *pv_format_sequences(void); #if ! HAVE_SETPROCTITLE void initproctitle(int, char **); void setproctitle(const char *, ...); #endif #ifdef ENABLE_DEBUGGING # if __STDC_VERSION__ < 199901L && !defined(__func__) # if __GNUC__ >= 2 # define __func__ __FUNCTION__ # else # define __func__ "" # endif # endif # define debug(x,...) debugging_output(__func__, __FILE__, __LINE__, x, __VA_ARGS__) #else # define debug(x,...) /*@-noeffect@*/ do { } while (0) /*@+noeffect@*/ #endif /* * Set the debugging destination file, if debugging is enabled. */ void debugging_output_destination(const char *); /* * Output debugging information, if debugging is enabled. */ void debugging_output(const char *, const char *, int, const char *, ...); #ifdef __cplusplus } #endif #endif /* _PV_H */ pv-1.9.31/src/main/000077500000000000000000000000001474702661500137615ustar00rootroot00000000000000pv-1.9.31/src/main/debug.c000066400000000000000000000057031474702661500152200ustar00rootroot00000000000000/* * Output debugging information. * * Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2025 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #include "config.h" #include "pv.h" #include #include #include #include #include #include #ifdef ENABLE_DEBUGGING /*@null@*/ static const char *debug_filename = NULL; /* * Set the destination for debugging information. */ void debugging_output_destination(const char *filename) { debug_filename = filename; } /* * Output debugging information to the file specified earlier by a call to * debugging_output_destination(), if any. */ void debugging_output(const char *function, const char *file, int line, const char *format, ...) { static bool tried_open = false; static FILE *debugfptr = NULL; va_list ap; time_t t; struct tm *tm; char tbuf[128]; /* flawfinder: ignore */ /* * flawfinder note: tbuf is only written to by strftime() which * takes its size, and we enforce string termination. */ if (false == tried_open) { if (NULL != debug_filename) { debugfptr = fopen(debug_filename, "a"); /* flawfinder: ignore */ /* * flawfinder note: caller directly controls * filename, the safest we can manage is to use * append mode. */ } tried_open = true; } if (NULL == debugfptr) { return; } /* * Note that here we use gmtime() rather than localtime(), otherwise * we can get stuck in signal handlers - testing with "strace" * showed many cases where "pv /dev/null" being * paused and backgrounded would cause pv to be stuck in * futex_wait() inside a pv_sig_alrm() inside a pv_sig_cont(). The * backtrace mentioned many time zone conversion steps, and all of * that goes away with gmtime(). */ (void) time(&t); tm = gmtime(&t); tbuf[0] = '\0'; if (0 == strftime(tbuf, sizeof(tbuf), "%Y-%m-%d %H:%M:%S", tm)) { tbuf[0] = '\0'; } tbuf[sizeof(tbuf) - 1] = '\0'; /* enforce termination */ (void) fprintf(debugfptr, "[%s] (%d) %s (%s:%d): ", tbuf, getpid(), function, file, line); va_start(ap, format); (void) vfprintf(debugfptr, format, ap); /* flawfinder: ignore */ va_end(ap); /* * flawfinder note: vfprintf format is explicitly controlled by the * caller of this function - no mitigation possible or desirable. */ (void) fprintf(debugfptr, "\n"); (void) fflush(debugfptr); } #else /* ! ENABLE_DEBUGGING */ /* * Stub debugging destination function. */ void debugging_output_destination( /*@unused@ */ __attribute__((unused)) const char *filename) { } /* * Stub debugging output function. */ void debugging_output( /*@unused@ */ __attribute__((unused)) const char *function, /*@unused@ */ __attribute__((unused)) const char *file, /*@unused@ */ __attribute__((unused)) int line, /*@unused@ */ __attribute__((unused)) const char *format, ...) { } #endif /* ENABLE_DEBUGGING */ pv-1.9.31/src/main/help.c000066400000000000000000000425131474702661500150620ustar00rootroot00000000000000/* * Output command-line help to stdout. * * Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2025 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #include "config.h" #include "pv.h" #include #include #include #include #include #if defined(ENABLE_NLS) && defined(HAVE_WCHAR_H) #include #if defined(HAVE_WCTYPE_H) #include #endif #endif /* * Return the number of display columns needed to show the given * null-terminated string. * * If NLS is disabled, or the string cannot be converted, this is just the * same as "strlen()". */ static size_t display_width(const char *string) { size_t bytes; if (NULL == string) return 0; bytes = strlen(string); /* flawfinder: ignore */ /* * flawfinder rationale: we have already checked for NULL, and it is * explicitly required of the caller to provide a null-terminated * string. */ return pv_strwidth(string, bytes); } /* * The 7-bit ASCII version of display_word_wrap() below - does not * understand multi-byte characters. */ static void display_word_wrap_7bit(const char *string, size_t display_width, size_t left_margin) { const char *start; const char *end; if (NULL == string) return; start = string; while (strlen(start) > display_width) { /* flawfinder: ignore */ /* flawfinder rationale: see above. */ end = start + display_width; while ((end > start) && (end[0] != ' ')) end--; if (end == start) { end = start + display_width; } else { end++; } printf("%.*s", (int) (end - start), start); if (end == start) end++; start = end; if (start[0] != '\0') printf("\n%*s", (int) left_margin, ""); } printf("%s", start); } /* * Output a null-terminated string to standard output, word wrapping to * "display_width" display character positions, and left-padding any new * lines after the first one with "left_margin" spaces. * * Wide characters are handled if NLS is enabled, but if they can't be, this * falls back to a version which just counts bytes as characters. */ static void display_word_wrap(const char *string, size_t display_width, size_t left_margin) { #if defined(ENABLE_NLS) && defined(HAVE_WCHAR_H) size_t wide_char_count; size_t wide_string_buffer_size; wchar_t *wide_string; size_t start_idx, end_idx, chars_remaining; if (NULL == string) return; /*@-nullpass@ */ /* splint note: see mbstowcs() call in pv_strwidth(). */ wide_char_count = mbstowcs(NULL, string, 0); /*@+nullpass@ */ if (wide_char_count == (size_t) -1) { debug("%s: %s: %s", "mbstowcs", string, strerror(errno)); display_word_wrap_7bit(string, display_width, left_margin); return; } wide_string_buffer_size = sizeof(*wide_string) * (1 + wide_char_count); wide_string = malloc(wide_string_buffer_size); if (NULL == wide_string) { perror("malloc"); display_word_wrap_7bit(string, display_width, left_margin); return; } memset(wide_string, 0, wide_string_buffer_size); if (mbstowcs(wide_string, string, 1 + wide_char_count) == (size_t) -1) { debug("%s: %s: %s", "mbstowcs", string, strerror(errno)); free(wide_string); display_word_wrap_7bit(string, display_width, left_margin); return; } start_idx = 0; chars_remaining = wide_char_count; /*@-unrecog@ *//* splint seems unable to see the prototype for wcswidth(). */ while (chars_remaining > 0 && wcswidth(&(wide_string[start_idx]), chars_remaining) > display_width) { /*@+unrecog@ */ size_t next_idx; end_idx = start_idx + display_width; while ((end_idx > start_idx) && (!iswspace(wide_string[end_idx]))) end_idx--; if (end_idx == start_idx) { end_idx = start_idx + display_width; } else { end_idx++; } next_idx = end_idx; if (end_idx == start_idx) next_idx++; while (start_idx < end_idx && start_idx < wide_char_count) { char multi_byte_string[MB_CUR_MAX + 1]; /* flawfinder: ignore */ /* * flawfinder rationale: array is explicitly * cleared, large enough according to the wctomb() * manual, and we explicitly terminate the string. */ memset(multi_byte_string, 0, MB_CUR_MAX + 1); if (wctomb(multi_byte_string, wide_string[start_idx]) >= 0) { multi_byte_string[MB_CUR_MAX] = '\0'; printf("%s", multi_byte_string); } start_idx++; } start_idx = next_idx; if (start_idx < wide_char_count) printf("\n%*s", (int) left_margin, ""); chars_remaining = wide_char_count - start_idx; } while (start_idx < wide_char_count) { char multi_byte_string[MB_CUR_MAX + 1]; /* flawfinder: ignore */ /* flawfinder rationale as above. */ memset(multi_byte_string, 0, MB_CUR_MAX + 1); if (wctomb(multi_byte_string, wide_string[start_idx]) >= 0) { multi_byte_string[MB_CUR_MAX] = '\0'; printf("%s", multi_byte_string); } start_idx++; } free(wide_string); #else /* ! defined(ENABLE_NLS) && defined(HAVE_WCHAR_H) */ display_word_wrap_7bit(string, display_width, left_margin); #endif /* defined(ENABLE_NLS) && defined(HAVE_WCHAR_H) */ } /* * Structure holding the displayed descriptions of each option - the short * option such as "-s", its long counterpart such as "--size", the name of * its argument such as "SIZE", and the description of what the option does. * Any of them may be NULL. * * In the initialiser for this structure, translatable strings are wrapped * with N_() to indicate that they are to be translated into the operator's * language by this function at run-time. * * Note that "opt_short" and "opt_long" should never be marked as * translatable, as they must remain consistent across all locales. * * The list is terminated with a NULL opt_short value - to leave a gap, set * opt_short to an empty string instead. */ struct option_definition_s { /*@null@ */ const char *opt_short; /*@null@ */ const char *opt_long; /*@null@ *//*@observer@ */ const char *opt_argument; /*@null@ *//*@observer@ */ const char *opt_description; struct { /* * Structure holding the width, in display character * positions, of the individual parts of the description of * each option - calculated after initialisation, so that * translation can be performed. */ size_t opt_short; size_t opt_long; size_t opt_argument; size_t opt_description; } width; }; /* * Display command-line help. */ void display_help(void) { struct option_definition_s option_definitions[] = { { "-p", "--progress", NULL, N_("show progress bar"), { 0, 0, 0, 0} }, { "-t", "--timer", NULL, N_("show elapsed time"), { 0, 0, 0, 0} }, { "-e", "--eta", NULL, N_("show estimated time of arrival (completion)"), { 0, 0, 0, 0} }, { "-I", "--fineta", NULL, N_("show absolute estimated time of arrival (completion)"), { 0, 0, 0, 0} }, { "-r", "--rate", NULL, N_("show data transfer rate counter"), { 0, 0, 0, 0} }, { "-a", "--average-rate", NULL, N_("show data transfer average rate counter"), { 0, 0, 0, 0} }, { "-b", "--bytes", NULL, N_("show number of bytes transferred"), { 0, 0, 0, 0} }, { "-T", "--buffer-percent", NULL, N_("show percentage of transfer buffer in use"), { 0, 0, 0, 0} }, { "-A", "--last-written", _("NUM"), N_("show NUM bytes last written"), { 0, 0, 0, 0} }, { "-F", "--format", N_("FORMAT"), N_("set output format to FORMAT"), { 0, 0, 0, 0} }, { "-n", "--numeric", NULL, N_("output percentages, not visual information"), { 0, 0, 0, 0} }, { "-q", "--quiet", NULL, N_("do not output any transfer information at all"), { 0, 0, 0, 0} }, { "", NULL, NULL, NULL, { 0, 0, 0, 0} }, { "-8", "--bits", NULL, N_("show number of bits transferred"), { 0, 0, 0, 0} }, { "-k", "--si", NULL, N_("treat suffixes as multiples of 1000 rather than 1024"), { 0, 0, 0, 0} }, { "-W", "--wait", NULL, N_("display nothing until first byte transferred"), { 0, 0, 0, 0} }, { "-D", "--delay-start", N_("SEC"), N_("display nothing until SEC seconds have passed"), { 0, 0, 0, 0} }, { "-s", "--size", N_("SIZE"), N_("set estimated data size to SIZE bytes"), { 0, 0, 0, 0} }, { "-g", "--gauge", NULL, N_("if size unknown, show rate vs max rate"), { 0, 0, 0, 0} }, { "-l", "--line-mode", NULL, N_("count lines instead of bytes"), { 0, 0, 0, 0} }, { "-0", "--null", NULL, N_("lines are null-terminated"), { 0, 0, 0, 0} }, { "-i", "--interval", N_("SEC"), N_("update every SEC seconds"), { 0, 0, 0, 0} }, { "-m", "--average-rate-window", N_("SEC"), N_("compute average rate over past SEC seconds (default 30s)"), { 0, 0, 0, 0} }, { "-w", "--width", N_("WIDTH"), N_("assume terminal is WIDTH characters wide"), { 0, 0, 0, 0} }, { "-H", "--height", N_("HEIGHT"), N_("assume terminal is HEIGHT rows high"), { 0, 0, 0, 0} }, { "-N", "--name", N_("NAME"), N_("prefix visual information with NAME"), { 0, 0, 0, 0} }, { "-u", "--bar-style", N_("STYLE"), N_("set default bar style to NAME"), { 0, 0, 0, 0} }, { "-x", "--extra-display", N_("SPEC"), N_("also send progress to SPEC"), { 0, 0, 0, 0} }, { "-v", "--stats", NULL, N_("output transfer statistics at the end"), { 0, 0, 0, 0} }, { "-f", "--force", NULL, N_("output even if standard error is not a terminal"), { 0, 0, 0, 0} }, { "-c", "--cursor", NULL, N_("use cursor positioning escape sequences"), { 0, 0, 0, 0} }, { "", NULL, NULL, NULL, { 0, 0, 0, 0} }, { "-o", "--output", N_("FILE"), N_("write output to FILE instead of stdout"), { 0, 0, 0, 0} }, { "-L", "--rate-limit", N_("RATE"), N_("limit transfer to RATE bytes per second"), { 0, 0, 0, 0} }, { "-B", "--buffer-size", N_("BYTES"), N_("use a buffer size of BYTES"), { 0, 0, 0, 0} }, { "-C", "--no-splice", NULL, N_("never use splice(), always use read/write"), { 0, 0, 0, 0} }, { "-E", "--skip-errors", NULL, N_("skip read errors in input"), { 0, 0, 0, 0} }, { "-Z", "--error-skip-block", N_("BYTES"), N_("skip errors in BYTES blocks at a time"), { 0, 0, 0, 0} }, { "-S", "--stop-at-size", NULL, N_("stop after --size bytes have been transferred"), { 0, 0, 0, 0} }, { "-Y", "--sync", NULL, N_("flush cache to disk after every write"), { 0, 0, 0, 0} }, { "-K", "--direct-io", NULL, N_("use direct I/O to bypass cache"), { 0, 0, 0, 0} }, { "-X", "--discard", NULL, N_("discard input instead of writing to output"), { 0, 0, 0, 0} }, { "-U", "--store-and-forward", N_("FILE"), N_("write all input to FILE before writing to output"), { 0, 0, 0, 0} }, { "-d", "--watchfd", N_("PID[:FD]"), N_("watch file FD opened by process PID"), { 0, 0, 0, 0} }, #ifdef PV_REMOTE_CONTROL { "-R", "--remote", N_("PID"), N_("update settings of process PID"), { 0, 0, 0, 0} }, #endif /* PV_REMOTE_CONTROL */ { "", NULL, NULL, NULL, { 0, 0, 0, 0} }, { "-P", "--pidfile", N_("FILE"), N_("save process ID in FILE"), { 0, 0, 0, 0} }, { "-h", "--help", NULL, N_("show this help and exit"), { 0, 0, 0, 0} }, { "-V", "--version", NULL, N_("show version information and exit"), { 0, 0, 0, 0} }, #ifdef ENABLE_DEBUGGING { "-!", "--debug", N_("FILE"), N_("write debug logs to FILE"), { 0, 0, 0, 0} }, #endif { NULL, NULL, NULL, NULL, { 0, 0, 0, 0} } }; unsigned int option_index; size_t widest_option_width = 0; size_t description_left_margin = 0; size_t min_description_width = 50; size_t right_margin = 77; const char *program_description; const char *bug_report_note; char *format_sequences = NULL; unsigned int terminal_width = 0, terminal_height = 0; pv_screensize(&terminal_width, &terminal_height); if (terminal_width > 5) { right_margin = (size_t) (terminal_width - 3); } /*@-formatconst@ */ /* * splint note: unavoidable use of %s in translated string. Should * be hard to exploit - the message catalogue would have to be * replaced or forced to load from another location. */ printf(_("Usage: %s [OPTION] [FILE]..."), PACKAGE_NAME); /*@+formatconst@ */ printf("\n"); /*@-mustfreefresh@ */ /* * splint note: the gettext calls made by _() cause memory leak * warnings, but in this case it's unavoidable, and mitigated by the * fact we only translate each string once. */ program_description = _("Concatenate FILE(s), or standard input, to standard output, with monitoring."); if (NULL != program_description) { display_word_wrap(program_description, right_margin, 0); printf("\n"); } printf("\n"); /* * Translate the help text, and calculate the displayed width of * each part of each option definition. The total display width of * the short option, long option, and option argument together form * the "option" width - we look for the widest one to calculate the * left margin for all of the descriptions to start at. */ for (option_index = 0; NULL != option_definitions[option_index].opt_short; option_index++) { struct option_definition_s *definition; size_t option_width; definition = &(option_definitions[option_index]); option_width = 0; definition->width.opt_short = display_width(definition->opt_short); definition->width.opt_long = 0; definition->width.opt_argument = 0; definition->width.opt_description = 0; if (NULL != definition->opt_long) { definition->width.opt_long = display_width(definition->opt_long); } if (NULL != definition->opt_argument) { /*@observer@ */ const char *translated; translated = _(definition->opt_argument); if (NULL != translated) { definition->opt_argument = translated; } definition->width.opt_argument = display_width(definition->opt_argument); } if (NULL != definition->opt_description) { /*@observer@ */ const char *translated; translated = _(definition->opt_description); if (NULL != translated) { definition->opt_description = translated; } definition->width.opt_description = display_width(definition->opt_description); } /* * The option_width is padded with a left margin of 2 * spaces, a ", " between the short and long options, a * space between the long option and the argument, and two * spaces after the argument: * * " , " * * If we don't have getopt_long() then ", " is omitted. */ option_width += 2 + definition->width.opt_short; /* " short" */ #ifdef HAVE_GETOPT_LONG option_width += 2 + definition->width.opt_long; /* ", " */ #endif option_width += 1 + definition->width.opt_argument; /* " ARG" */ option_width += 2; /* final 2 spaces */ if (option_width > widest_option_width) { widest_option_width = option_width; } } /* * Set the left margin for the option descriptions, based on the * widest option width, or (right margin - min_description_width), * whichever is less, so that there is always room for * "min_description_width" characters of description. */ description_left_margin = right_margin - min_description_width; if (widest_option_width < description_left_margin) { description_left_margin = widest_option_width; } debug("%s: description_left_margin=%d, widest_option_width=%d, right_margin=%d", "help display", (int) description_left_margin, (int) widest_option_width, (int) right_margin); /* * Display each of the option definitions, word wrapping the * descriptions. */ for (option_index = 0; NULL != option_definitions[option_index].opt_short; option_index++) { struct option_definition_s *definition; size_t option_width; definition = &(option_definitions[option_index]); option_width = 0; if (definition->width.opt_short > 0 && NULL != definition->opt_short) { printf(" %s", definition->opt_short); option_width += 2 + definition->width.opt_short; } #ifdef HAVE_GETOPT_LONG if (definition->width.opt_long > 0 && NULL != definition->opt_long) { printf(", %s", definition->opt_long); option_width += 2 + definition->width.opt_long; } #endif if (definition->width.opt_argument > 0 && NULL != definition->opt_argument) { printf(" %s", definition->opt_argument); option_width += 1 + definition->width.opt_argument; } /* Just start a new line if there's no description. */ if ((0 == definition->width.opt_description) || (NULL == definition->opt_description)) { printf("\n"); continue; } /* * If the option is too wide, start a new line for the * description. In both cases, pad with spaces up to the * description left margin. */ if (option_width > description_left_margin) { printf("\n%*s", (int) description_left_margin, ""); } else if (option_width < description_left_margin) { printf("%*s", (int) (description_left_margin - option_width), ""); } /* Output the description, word wrapped. */ display_word_wrap(definition->opt_description, right_margin - description_left_margin, description_left_margin); printf("\n"); } format_sequences = pv_format_sequences(); if (NULL != format_sequences) { const char *format_sequence_header; format_sequence_header = _("Supported format sequences:"); if (NULL != format_sequence_header) { printf("\n"); display_word_wrap(format_sequence_header, right_margin, 0); printf("\n"); } printf("\n "); display_word_wrap(format_sequences, right_margin, 2); free(format_sequences); printf("\n"); } printf("\n"); bug_report_note = _("Please report any bugs to: %s"); if (NULL != bug_report_note) { /*@-formatconst@ */ /* * splint note: see earlier "formatconst" note. * flawfinder: same reason. */ printf(bug_report_note, PACKAGE_BUGREPORT); /* flawfinder: ignore */ /*@+formatconst@ */ } printf("\n"); } pv-1.9.31/src/main/main.c000066400000000000000000000422201474702661500150510ustar00rootroot00000000000000/* * Main program entry point - read the command line options, then perform * the appropriate actions. * * Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2025 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #include "config.h" #include "options.h" #include "pv.h" #include #include #include #include #include #include #include #include #ifdef HAVE_LANGINFO_H #include #endif int pv_remote_set(opts_t, pvstate_t); void pv_remote_init(void); void pv_remote_fini(void); /* * Write a PID file, returning nonzero on error. Write it atomically, such * that the file either exists and contains the PID, or is not updated at * all. This is done by writing to a temporary file in the same directory * first, and then renaming the temporary file to the target name. */ static int pv__write_pidfile(opts_t opts) { char *pidfile_tmp_name; size_t pidfile_tmp_bufsize; int pidfile_tmp_fd; FILE *pidfile_tmp_fptr; mode_t prev_umask; const char *pidfile_template = "%s.XXXXXX"; if (NULL == opts->pidfile) return 0; /* * The buffer needs to be long enough to hold the pidfile with the * mkstemp template ".XXXXXX" after it. The "%s" of our * pidfile_template adds 2 extra bytes to the length, of which we * need 1 byte for the terminating \0, so we subtract 1 byte more to * get the exact amount of space we need. */ pidfile_tmp_bufsize = strlen(pidfile_template) + strlen(opts->pidfile) - 1; /* flawfinder: ignore */ /* * flawfinder rationale: flawfinder never likes strlen() in case * it's called on a string that isn't \0 terminated. We have to use * strlen() to find the length of opts->pidfile, so have to trust * that the arguments in argv[] were \0 terminated. We can be sure * that pidfile_template is \0 terminated because we've set it to a * constant value. So we tell flawfinder to skip this check here. */ pidfile_tmp_name = malloc(pidfile_tmp_bufsize); if (NULL == pidfile_tmp_name) { fprintf(stderr, "%s: %s\n", opts->program_name, strerror(errno)); return PV_ERROREXIT_REMOTE_OR_PID; } memset(pidfile_tmp_name, 0, pidfile_tmp_bufsize); (void) pv_snprintf(pidfile_tmp_name, pidfile_tmp_bufsize, pidfile_template, opts->pidfile); /*@-type@ *//* splint doesn't like mode_t */ prev_umask = umask(0000); /* flawfinder: ignore */ (void) umask(prev_umask | 0133); /* flawfinder: ignore */ /*@-unrecog@ *//* splint doesn't know mkstemp() */ pidfile_tmp_fd = mkstemp(pidfile_tmp_name); /* flawfinder: ignore */ /*@+unrecog@ */ if (pidfile_tmp_fd < 0) { fprintf(stderr, "%s: %s: %s\n", opts->program_name, pidfile_tmp_name, strerror(errno)); (void) umask(prev_umask); /* flawfinder: ignore */ free(pidfile_tmp_name); return PV_ERROREXIT_REMOTE_OR_PID; } (void) umask(prev_umask); /* flawfinder: ignore */ /* * flawfinder rationale (umask, mkstemp) - flawfinder * recommends setting the most restrictive umask possible * when calling mkstemp(), so this is what we have done. * * We get the original umask and OR it with 0133 to make * sure new files will be at least chmod 644. Then we put * the umask back to what it was, after creating the * temporary file. */ /*@+type@ */ pidfile_tmp_fptr = fdopen(pidfile_tmp_fd, "w"); if (NULL == pidfile_tmp_fptr) { fprintf(stderr, "%s: %s: %s\n", opts->program_name, pidfile_tmp_name, strerror(errno)); (void) close(pidfile_tmp_fd); (void) remove(pidfile_tmp_name); free(pidfile_tmp_name); return PV_ERROREXIT_REMOTE_OR_PID; } fprintf(pidfile_tmp_fptr, "%d\n", getpid()); if (0 != fclose(pidfile_tmp_fptr)) { fprintf(stderr, "%s: %s: %s\n", opts->program_name, opts->pidfile, strerror(errno)); } if (rename(pidfile_tmp_name, opts->pidfile) < 0) { fprintf(stderr, "%s: %s: %s\n", opts->program_name, opts->pidfile, strerror(errno)); (void) remove(pidfile_tmp_name); } free(pidfile_tmp_name); return 0; } /* * Set the output file, if applicable. Returns nonzero on error. */ static int pv__set_output(pvstate_t state, opts_t opts, /*@null@ */ const char *output_file) { int output_fd; if ((NULL == state) || (NULL == opts)) return 0; if (NULL == output_file || 0 == strcmp(output_file, "-")) { pv_state_output_set(state, STDOUT_FILENO, "(stdout)"); return 0; } output_fd = open(output_file, O_WRONLY | O_CREAT | O_TRUNC, 0600); /* flawfinder: ignore */ /* * flawfinder rationale: the output filename has been * explicitly provided, and in many cases the operator will * want to write to device files and other special * destinations, so there is no sense-checking we can do to * make this safer. */ if (output_fd < 0) { fprintf(stderr, "%s: %s: %s\n", opts->program_name, output_file, strerror(errno)); return PV_ERROREXIT_ACCESS; } pv_state_output_set(state, output_fd, output_file); return 0; } /* * Run in store-and-forward mode: run the main loop once with the output * forced to the store-and-forward file (taking care of creation and removal * of a temporary file if "-" was specified); then run the main loop again * with the input file list forced to be just the store-and-forward file. * Returns nonzero on error. */ static int pv__store_and_forward(pvstate_t state, opts_t opts, bool can_have_eta) { char tmp_filename[4096]; /* flawfinder: ignore */ bool use_temporary_file; char *real_store_and_forward_file; int retcode; /* flawfinder: zeroed with memset and bounded by pv_snprintf. */ if ((NULL == state) || (NULL == opts) || (NULL == opts->store_and_forward_file)) return 0; memset(tmp_filename, 0, sizeof(tmp_filename)); use_temporary_file = false; if (0 == strcmp(opts->store_and_forward_file, "-")) use_temporary_file = true; /* * Create a temporary file if the specified file was "-". */ if (use_temporary_file) { char *tmpdir; int tmp_fd; tmpdir = (char *) getenv("TMPDIR"); /* flawfinder: ignore */ if ((NULL == tmpdir) || ('\0' == tmpdir[0])) tmpdir = (char *) getenv("TMP"); /* flawfinder: ignore */ if ((NULL == tmpdir) || ('\0' == tmpdir[0])) tmpdir = "/tmp"; /* * flawfinder rationale: null and zero-size values of $TMPDIR and * $TMP are rejected, and the destination buffer is bounded. */ (void) pv_snprintf(tmp_filename, sizeof(tmp_filename), "%s/pv.XXXXXX", tmpdir); /*@-unrecog@ *//* splint doesn't know mkstemp() */ tmp_fd = mkstemp(tmp_filename); /* flawfinder: ignore */ /*@+unrecog@ */ if (tmp_fd < 0) { fprintf(stderr, "%s: %s: %s\n", opts->program_name, tmp_filename, strerror(errno)); return PV_ERROREXIT_SAF; } (void) close(tmp_fd); } /* * Real store-and-forward file: either the one we were given, or the * temporary file we created if we were given "-". */ real_store_and_forward_file = use_temporary_file ? tmp_filename : opts->store_and_forward_file; /* * First, set the output file to the store-and-forward file. */ debug("%s: %s", "setting output to store-and-forward file", real_store_and_forward_file); retcode = pv__set_output(state, opts, real_store_and_forward_file); if (0 != retcode) goto end_store_and_forward; /* Reset the formatting to set the displayed name to "(input)". */ /*@-mustfreefresh@ */ pv_state_set_format(state, opts->progress, opts->timer, can_have_eta ? opts->eta : false, can_have_eta ? opts->fineta : false, opts->rate, opts->average_rate, opts->bytes, opts->bufpercent, opts->lastwritten, _("(input)")); /*@+mustfreefresh@ *//* see below about gettext _() calls. */ /* Run the main loop as normal. */ debug("%s", "running store-and-forward receiver"); retcode = pv_main_loop(state); if (0 != retcode) goto end_store_and_forward; /* Set the output file back to what it originally was. */ debug("%s: %s", "setting output to original value", NULL == opts->output ? "(null)" : opts->output); retcode = pv__set_output(state, opts, opts->output); if (0 != retcode) goto end_store_and_forward; /* Replace the list of input files with the store-and-forward file. */ debug("%s", "resetting input file list"); pv_state_inputfiles(state, 1, (const char **) &real_store_and_forward_file); /* Recalculate the input size. */ pv_state_size_set(state, pv_calc_total_size(state)); /* Reset the format, since we might have been asked to show ETA. */ pv_state_set_format(state, opts->progress, opts->timer, opts->eta, opts->fineta, opts->rate, opts->average_rate, opts->bytes, opts->bufpercent, opts->lastwritten, opts->name); /* Reset calculated values in the state. */ pv_state_reset(state); /* Run the main loop again. */ debug("%s", "running store-and-forward transmitter"); retcode = pv_main_loop(state); end_store_and_forward: if (use_temporary_file) (void) remove(tmp_filename); return retcode; } /* * Process command-line arguments and set option flags, then call functions * to initialise, and finally enter the main loop. */ int main(int argc, char **argv) { /*@only@ */ opts_t opts = NULL; /*@only@ */ pvstate_t state = NULL; int retcode = 0; bool can_have_eta = true; bool can_display_utf8 = false; #if ! HAVE_SETPROCTITLE initproctitle(argc, argv); #endif #ifdef ENABLE_NLS /* Initialise language translation. */ (void) setlocale(LC_ALL, ""); (void) bindtextdomain(PACKAGE, LOCALEDIR); (void) textdomain(PACKAGE); #ifdef HAVE_LANGINFO_H /*@-mustfreefresh@ *//* splint thinks nl_langinfo() leaks memory */ if (0 == strcmp(nl_langinfo(CODESET), "UTF-8")) can_display_utf8 = true; /*@+mustfreefresh@ */ #endif #endif /* Parse the command line arguments. */ opts = opts_parse(argc >= 0 ? (unsigned int) argc : 0, argv); if (NULL == opts) { debug("%s: %d", "exiting with status", PV_ERROREXIT_MEMORY); return PV_ERROREXIT_MEMORY; } /* Early exit if necessary, such as with "-h". */ if (opts->do_nothing) { debug("%s", "nothing to do - exiting with status 0"); opts_free(opts); return 0; } /* * Allocate our internal state buffer. */ state = pv_state_alloc(opts->program_name); if (NULL == state) { /*@-mustfreefresh@ */ /* * splint note: the gettext calls made by _() cause memory * leak warnings, but in this case it's unavoidable, and * mitigated by the fact we only translate each string once. */ fprintf(stderr, "%s: %s: %s\n", opts->program_name, _("state allocation failed"), strerror(errno)); opts_free(opts); debug("%s: %d", "exiting with status", PV_ERROREXIT_MEMORY); return PV_ERROREXIT_MEMORY; /*@+mustfreefresh@ */ } /* * -R specified - send the message, then exit. */ if (opts->remote > 0) { /* Initialise signal handling. */ pv_sig_init(state); /* Send the message. */ retcode = pv_remote_set(opts, state); /* Close down the signal handling. */ pv_sig_fini(state); /* Free resources. */ pv_state_free(state); opts_free(opts); /* Early exit. */ return retcode; } /* * Write a PID file if -P was specified. */ if (opts->pidfile != NULL) { int pidfile_rc; pidfile_rc = pv__write_pidfile(opts); if (0 != pidfile_rc) { pv_state_free(state); opts_free(opts); return pidfile_rc; } } /* * If no files were given, pretend "-" was given (stdin). */ if (0 == opts->argc) { debug("%s", "no files given - adding fake argument `-'"); if (!opts_add_file(opts, "-")) { pv_state_free(state); opts_free(opts); return PV_ERROREXIT_MEMORY; } } /* * Put our list of input files into the PV internal state. */ if (NULL != opts->argv) { pv_state_inputfiles(state, opts->argc, (const char **) (opts->argv)); } /* * If stderr is not a terminal and we're neither forcing output nor * outputting numerically, we will have nothing to display at all. */ if ((0 == isatty(STDERR_FILENO)) && (false == opts->force) && (false == opts->numeric)) { opts->no_display = true; debug("%s", "nothing to display - setting no_display"); } /* * Auto-detect width or height if either are unspecified. */ if ((0 == opts->width) || (0 == opts->height)) { unsigned int width, height; width = 0; height = 0; pv_screensize(&width, &height); if (0 == opts->width) { opts->width = width; debug("%s: %u", "auto-detected terminal width", width); } if (0 == opts->height) { opts->height = height; debug("%s: %u", "auto-detected terminal height", height); } } /* * Width and height bounds checking (and defaults). */ if (opts->width < 1) opts->width = 80; if (opts->height < 1) opts->height = 25; if (opts->width > 999999) opts->width = 999999; if (opts->height > 999999) opts->height = 999999; /* * Interval must be at least 0.1 second, and at most 10 minutes. */ if (opts->interval < 0.1) opts->interval = 0.1; if (opts->interval > 600) opts->interval = 600; /* * Set output file, treating no output or "-" as stdout; we have to * do this before looking at setting the size, as the size * calculation looks at the output file if the input size can't be * calculated (issue #91). */ retcode = pv__set_output(state, opts, opts->output); if (0 != retcode) { pv_state_free(state); opts_free(opts); return retcode; } /* * Copy the "stop at size" option before checking the total size, * since calculating the size from the output block device size * after this may want to force this setting on, and if we set it * afterwards, we undo the override. */ pv_state_stop_at_size_set(state, opts->stop_at_size); /* Total size calculation, in normal transfer mode. */ if (0 == opts->watch_pid) { /* * If no size was given, try to calculate the total size. */ if (0 == opts->size) { pv_state_linemode_set(state, opts->linemode); pv_state_null_terminated_lines_set(state, opts->null_terminated_lines); opts->size = pv_calc_total_size(state); debug("%s: %llu", "no size given - calculated", opts->size); } /* * If the size is unknown, we cannot have an ETA. */ if (opts->size < 1) { can_have_eta = false; debug("%s", "size unknown - ETA disabled"); } } /* * Copy the remaining parameters from the options into the main * state. */ pv_state_interval_set(state, opts->interval); pv_state_width_set(state, opts->width, opts->width_set_manually); pv_state_height_set(state, opts->height, opts->height_set_manually); pv_state_no_display_set(state, opts->no_display); pv_state_force_set(state, opts->force); pv_state_cursor_set(state, opts->cursor); pv_state_show_stats_set(state, opts->show_stats); pv_state_numeric_set(state, opts->numeric); pv_state_wait_set(state, opts->wait); pv_state_delay_start_set(state, opts->delay_start); pv_state_rate_gauge_set(state, opts->rate_gauge); pv_state_linemode_set(state, opts->linemode); pv_state_bits_set(state, opts->bits); pv_state_decimal_units_set(state, opts->decimal_units); pv_state_null_terminated_lines_set(state, opts->null_terminated_lines); pv_state_skip_errors_set(state, opts->skip_errors); pv_state_error_skip_block_set(state, opts->error_skip_block); pv_state_sync_after_write_set(state, opts->sync_after_write); pv_state_direct_io_set(state, opts->direct_io); pv_state_discard_input_set(state, opts->discard_input); pv_state_rate_limit_set(state, opts->rate_limit); pv_state_target_buffer_size_set(state, opts->buffer_size); pv_state_no_splice_set(state, opts->no_splice); pv_state_size_set(state, opts->size); pv_state_name_set(state, opts->name); pv_state_default_bar_style_set(state, opts->default_bar_style); pv_state_format_string_set(state, opts->format); pv_state_extra_display_set(state, opts->extra_display); pv_state_watch_pid_set(state, opts->watch_pid); pv_state_watch_fd_set(state, opts->watch_fd); pv_state_average_rate_window_set(state, opts->average_rate_window); pv_state_set_format(state, opts->progress, opts->timer, can_have_eta ? opts->eta : false, can_have_eta ? opts->fineta : false, opts->rate, opts->average_rate, opts->bytes, opts->bufpercent, opts->lastwritten, opts->name); debug("%s: %s", "can_display_utf8", can_display_utf8 ? "true" : "false"); pv_state_set_can_display_utf8(state, can_display_utf8); /* Initialise the signal handling. */ pv_sig_init(state); /* Run the appropriate main loop. */ if (0 == opts->watch_pid && NULL == opts->store_and_forward_file) { /* Normal "transfer data" mode. */ pv_remote_init(); retcode = pv_main_loop(state); pv_remote_fini(); } else if (0 == opts->watch_pid && NULL != opts->store_and_forward_file) { /* Store-and-forward transfer mode. */ pv_remote_init(); retcode = pv__store_and_forward(state, opts, can_have_eta); pv_remote_fini(); } else if (0 != opts->watch_pid && -1 == opts->watch_fd) { /* "Watch all file descriptors of another process" mode. */ retcode = pv_watchpid_loop(state); } else if (0 != opts->watch_pid && -1 != opts->watch_fd) { /* "Watch a specific file descriptor of another process" mode. */ retcode = pv_watchfd_loop(state); } /* Clear up the PID file, if one was written. */ if (opts->pidfile != NULL) { if (0 != remove(opts->pidfile)) { fprintf(stderr, "%s: %s: %s\n", opts->program_name, opts->pidfile, strerror(errno)); } } /* Close down the signal handling. */ pv_sig_fini(state); /* Free the internal PV state. */ pv_state_free(state); /* Free the data from parsing the command-line arguments. */ opts_free(opts); debug("%s: %d", "exiting with status", retcode); return retcode; } pv-1.9.31/src/main/options.c000066400000000000000000000515541474702661500156320ustar00rootroot00000000000000/* * Parse command-line options. * * Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2025 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #include "config.h" #include "options.h" #include "pv.h" #include #include #include #include #include #ifdef HAVE_SYS_SYSMACROS_H #include #ifdef major #ifdef minor #ifdef HAVE_STRUCT_STAT_ST_RDEV #define CAN_BUILD_SYSFS_FILENAME 1 #endif #endif #endif #endif #include #include #ifdef HAVE_GETOPT_H #include #endif void display_help(void); void display_version(void); /* * Free an opts_t object. */ void opts_free( /*@only@ */ opts_t opts) { if (!opts) return; /*@-keeptrans@ */ /* * splint note: we're explicitly being handed the "opts" object to * free it, so the previously "kept" internally allocated buffers * are now ours to free. */ if (NULL != opts->name) free(opts->name); if (NULL != opts->format) free(opts->format); if (NULL != opts->pidfile) free(opts->pidfile); if (NULL != opts->output) free(opts->output); if (NULL != opts->store_and_forward_file) free(opts->store_and_forward_file); if (NULL != opts->extra_display) free(opts->extra_display); if (NULL != opts->argv) free(opts->argv); /*@+keeptrans@ */ free(opts); } /* * Add a filename to the list of non-option arguments, returning false on * error. The filename is not copied - the pointer is stored. */ bool opts_add_file(opts_t opts, const char *filename) { /*@-branchstate@ */ if ((opts->argc >= opts->argv_length) || (NULL == opts->argv)) { opts->argv_length = opts->argc + 10; /*@-keeptrans@ */ opts->argv = realloc(opts->argv, opts->argv_length * sizeof(char *)); /*@+keeptrans@ */ if (NULL == opts->argv) { fprintf(stderr, "%s: %s\n", opts->program_name, strerror(errno)); opts->argv_length = 0; opts->argc = 0; return false; } } /*@+branchstate@ */ /* * splint notes: we turned off "branchstate" above because depending * on whether we have to extend the array, we change argv from * "keep" to "only", which is also why we turned off "keeptrans"; * there doesn't seem to be a clean way to tell splint that everyone * else should not touch argv but we're allowed to reallocate it and * so is opts_parse. */ opts->argv[opts->argc++] = filename; return true; } /* * Set opts->size from the size of the file whose name is size_file, * returning false (and reporting the error) if there is a problem. * * If size_file points to a block device, the size of the block device is * used. */ static bool opts_use_size_of_file(opts_t opts, const char *size_file) { struct stat sb; int stat_rc; #ifdef CAN_BUILD_SYSFS_FILENAME char sysfs_filename[512]; /* flawfinder: ignore */ FILE *sysfs_fptr; long long sysfs_size; #endif /* CAN_BUILD_SYSFS_FILENAME */ int device_fd; off_t device_size; /* * flawfinder rationale: sysfs_filename is only used with * pv_snprintf() which guarantees it will be bounded and zero * terminated. */ stat_rc = 0; memset(&sb, 0, sizeof(sb)); stat_rc = stat(size_file, &sb); if (0 != stat_rc) { /*@-mustfreefresh@ */ /* * splint note: the gettext calls made by _() cause memory * leak warnings, but in this case it's unavoidable, and * mitigated by the fact we only translate each string once. */ fprintf(stderr, "%s: %s: %s: %s\n", opts->program_name, size_file, _("failed to stat file"), strerror(errno)); return false; /*@+mustfreefresh@ */ } /* This was a regular file - use its size and return. */ if (S_ISREG((mode_t) (sb.st_mode))) { opts->size = (off_t) (sb.st_size); return true; } /* This was a directory - report an error. */ if (S_ISDIR((mode_t) (sb.st_mode))) { /*@-mustfreefresh@ *//* see above */ fprintf(stderr, "%s: %s: %s\n", opts->program_name, size_file, _("is a directory")); return false; /*@+mustfreefresh@ */ } /* This was not a block device - just use the size and return. */ if (!S_ISBLK((mode_t) (sb.st_mode))) { opts->size = (off_t) (sb.st_size); return true; } /* * Block device - determine its size by looking for * /sys/dev/block/MAJOR:MINOR/size, and if that fails, try opening * the file and seeking to the end. */ #ifdef CAN_BUILD_SYSFS_FILENAME /* * Try the sysfs method - lightest touch and requires no read access * to the actual block device. */ memset(sysfs_filename, 0, sizeof(sysfs_filename)); if (pv_snprintf (sysfs_filename, sizeof(sysfs_filename), "/sys/dev/block/%u:%u/size", major(sb.st_rdev), minor(sb.st_rdev)) < 0) { /*@-mustfreefresh@ *//* see above */ fprintf(stderr, "%s: %s: %s: %s\n", opts->program_name, size_file, _("failed to generate sysfs filename"), strerror(errno)); return false; /*@+mustfreefresh@ */ } sysfs_fptr = fopen(sysfs_filename, "r"); /* flawfinder: ignore */ /* * flawfinder rationale: sysfs is trusted here, the filename is * predictable, and we are restricted to reading one number. */ if (NULL != sysfs_fptr) { sysfs_size = -1; if (1 == fscanf(sysfs_fptr, "%lld", &sysfs_size)) { /* Read successful - use the value (* 512) and return. */ (void) fclose(sysfs_fptr); opts->size = (off_t) sysfs_size *512; return true; } /* Read not successful - report the error and return. */ /* NB we must fclose() after reporting to retain errno. */ /*@-mustfreefresh@ *//* see above */ fprintf(stderr, "%s: %s: %s: %s\n", opts->program_name, size_file, _("failed to read sysfs size file"), strerror(errno)); (void) fclose(sysfs_fptr); return false; /*@+mustfreefresh@ */ } #endif /* CAN_BUILD_SYSFS_FILENAME */ /* * Try opening the block device and seeking to the end. */ device_fd = open(size_file, O_RDONLY); /* flawfinder: ignore */ /* * flawfinder rationale: the filename is under the direct control of * the operator by its nature, so we can't refuse to open symlinks * etc as that would be counterintuitive. */ if (device_fd < 0) { /*@-mustfreefresh@ *//* see above */ fprintf(stderr, "%s: %s: %s: %s\n", opts->program_name, size_file, _("failed to open block device"), strerror(errno)); return false; /*@+mustfreefresh@ */ } device_size = (off_t) lseek(device_fd, 0, SEEK_END); if (device_size < 0) { /*@-mustfreefresh@ *//* see above */ fprintf(stderr, "%s: %s: %s: %s\n", opts->program_name, size_file, _("failed to determine size of block device"), strerror(errno)); /* NB close() after reporting error, to preserve errno. */ (void) close(device_fd); return false; /*@+mustfreefresh@ */ } (void) close(device_fd); /* Use the size we found. */ opts->size = device_size; return true; } /* * Parse the given command-line arguments into an opts_t object, handling * "help" and "version" options internally. * * Returns an opts_t, or NULL on error. * * Note that the contents of *argv[] (i.e. the command line parameters) * aren't copied anywhere, just the pointers are copied, so make sure the * command line data isn't overwritten or argv[1] free()d or whatever. */ /*@null@ */ /*@only@ */ opts_t opts_parse(unsigned int argc, char **argv) { #ifdef HAVE_GETOPT_LONG /*@-nullassign@ */ /* splint rationale: NULL is allowed for "flags" in long options. */ struct option long_options[] = { { "help", 0, NULL, (int) 'h' }, { "version", 0, NULL, (int) 'V' }, { "progress", 0, NULL, (int) 'p' }, { "timer", 0, NULL, (int) 't' }, { "eta", 0, NULL, (int) 'e' }, { "fineta", 0, NULL, (int) 'I' }, { "rate", 0, NULL, (int) 'r' }, { "average-rate", 0, NULL, (int) 'a' }, { "bytes", 0, NULL, (int) 'b' }, { "bits", 0, NULL, (int) '8' }, { "si", 0, NULL, (int) 'k' }, { "buffer-percent", 0, NULL, (int) 'T' }, { "last-written", 1, NULL, (int) 'A' }, { "force", 0, NULL, (int) 'f' }, { "numeric", 0, NULL, (int) 'n' }, { "quiet", 0, NULL, (int) 'q' }, { "cursor", 0, NULL, (int) 'c' }, { "wait", 0, NULL, (int) 'W' }, { "delay-start", 1, NULL, (int) 'D' }, { "size", 1, NULL, (int) 's' }, { "gauge", 0, NULL, (int) 'g' }, { "line-mode", 0, NULL, (int) 'l' }, { "null", 0, NULL, (int) '0' }, { "interval", 1, NULL, (int) 'i' }, { "width", 1, NULL, (int) 'w' }, { "height", 1, NULL, (int) 'H' }, { "name", 1, NULL, (int) 'N' }, { "bar-style", 1, NULL, (int) 'u' }, { "format", 1, NULL, (int) 'F' }, { "extra-display", 1, NULL, (int) 'x' }, { "stats", 0, NULL, (int) 'v' }, { "rate-limit", 1, NULL, (int) 'L' }, { "buffer-size", 1, NULL, (int) 'B' }, { "no-splice", 0, NULL, (int) 'C' }, { "skip-errors", 0, NULL, (int) 'E' }, { "error-skip-block", 1, NULL, (int) 'Z' }, { "stop-at-size", 0, NULL, (int) 'S' }, { "sync", 0, NULL, (int) 'Y' }, { "direct-io", 0, NULL, (int) 'K' }, { "discard", 0, NULL, (int) 'X' }, { "store-and-forward", 1, NULL, (int) 'U' }, { "remote", 1, NULL, (int) 'R' }, { "pidfile", 1, NULL, (int) 'P' }, { "watchfd", 1, NULL, (int) 'd' }, { "output", 1, NULL, (int) 'o' }, { "average-rate-window", 1, NULL, (int) 'm' }, #ifdef ENABLE_DEBUGGING { "debug", 1, NULL, (int) '!' }, #endif /* ENABLE_DEBUGGING */ { NULL, 0, NULL, 0 } }; /*@+nullassign@ */ int option_index = 0; #endif /* HAVE_GETOPT_LONG */ char *short_options = "hVpteIrab8kTA:fvnqcWD:s:gl0i:w:H:N:u:F:x:L:B:CEZ:SYKXU:R:P:d:m:o:" #ifdef ENABLE_DEBUGGING "!:" #endif ; int c, numopts; unsigned int check_pid, parse_pid; int check_fd, parse_fd; opts_t opts; char *leafptr; opts = calloc(1, sizeof(*opts)); if (!opts) { /*@-mustfreefresh@ */ /* * splint note: the gettext calls made by _() cause memory * leak warnings, but in this case it's unavoidable, and * mitigated by the fact we only translate each string once. */ fprintf(stderr, "%s: %s: %s\n", argv[0], _("option structure allocation failed"), strerror(errno)); return NULL; /*@+mustfreefresh@ */ } leafptr = strrchr(argv[0], '/'); if (NULL != leafptr) { opts->program_name = 1 + leafptr; } else { leafptr = argv[0]; /* avoid splint "keep" warnings */ opts->program_name = leafptr; } opts->argc = 0; opts->argv = calloc((size_t) (argc + 1), sizeof(char *)); if (NULL == opts->argv) { /*@-mustfreefresh@ */ /* splint note: as above. */ fprintf(stderr, "%s: %s: %s\n", opts->program_name, _("option structure argv allocation failed"), strerror(errno)); free(opts); /* can't call opts_free as argv is not set */ return NULL; /*@+mustfreefresh@ */ } opts->argv_length = 1 + argc; numopts = 0; opts->interval = 1; opts->delay_start = 0; opts->watch_pid = 0; opts->watch_fd = -1; opts->average_rate_window = 30; opts->width_set_manually = false; opts->height_set_manually = false; do { #ifdef HAVE_GETOPT_LONG c = getopt_long((int) argc, argv, short_options, long_options, &option_index); /* flawfinder: ignore */ #else c = getopt((int) argc, argv, short_options); /* flawfinder: ignore */ #endif /* * flawfinder rationale: we have to pass argv to getopt, and * limiting the argument sizes would be impractical and * cumbersome (and likely lead to more bugs); so we have to * trust the system getopt to not have internal buffer * overflows. */ if (c < 0) continue; /* * Check that any numeric arguments are of the right type. */ switch (c) { case 's': /* "-s @" is valid, so allow it. */ if ('@' == *optarg) break; /* falls through */ /*@fallthrough@ */ case 'L': /*@fallthrough@ */ case 'B': /*@fallthrough@ */ case 'Z': if (!pv_getnum_check(optarg, PV_NUMTYPE_ANY_WITH_SUFFIX)) { /*@-mustfreefresh@ *//* see above */ fprintf(stderr, "%s: -%c: %s: %s\n", opts->program_name, c, optarg, _("numeric value not understood")); opts_free(opts); return NULL; /*@+mustfreefresh@ */ } break; case 'A': /*@fallthrough@ */ case 'w': /*@fallthrough@ */ case 'H': /*@fallthrough@ */ case 'R': /*@fallthrough@ */ case 'm': if (!pv_getnum_check(optarg, PV_NUMTYPE_BARE_INTEGER)) { /*@-mustfreefresh@ *//* see above */ fprintf(stderr, "%s: -%c: %s: %s\n", opts->program_name, c, optarg, _("integer argument expected")); opts_free(opts); return NULL; /*@+mustfreefresh@ */ } break; case 'i': /*@fallthrough@ */ case 'D': if (!pv_getnum_check(optarg, PV_NUMTYPE_BARE_DOUBLE)) { /*@-mustfreefresh@ *//* see above */ fprintf(stderr, "%s: -%c: %s: %s\n", opts->program_name, c, optarg, _("numeric argument expected")); opts_free(opts); return NULL; /*@+mustfreefresh@ */ } break; case 'd': if (sscanf(optarg, "%u:%d", &check_pid, &check_fd) < 1) { /*@-mustfreefresh@ *//* see above */ fprintf(stderr, "%s: -%c: %s\n", opts->program_name, c, _("process ID or pid:fd pair expected")); opts_free(opts); return NULL; /*@+mustfreefresh@ */ } if (check_pid < 1) { /*@-mustfreefresh@ *//* see above */ fprintf(stderr, "%s: -%c: %s\n", opts->program_name, c, _("invalid process ID")); opts_free(opts); return NULL; /*@+mustfreefresh@ */ } break; default: break; } /* * Parse each command line option. */ switch (c) { case 'h': display_help(); opts->do_nothing = true; return opts; /* early return */ case 'V': display_version(); opts->do_nothing = true; return opts; /* early return */ case 'p': opts->progress = true; numopts++; break; case 't': opts->timer = true; numopts++; break; case 'I': opts->fineta = true; numopts++; break; case 'e': opts->eta = true; numopts++; break; case 'r': opts->rate = true; numopts++; break; case 'a': opts->average_rate = true; numopts++; break; case 'b': opts->bytes = true; numopts++; break; case '8': opts->bytes = true; opts->bits = true; numopts++; break; case 'k': opts->decimal_units = true; break; case 'T': opts->bufpercent = true; numopts++; opts->no_splice = true; break; case 'A': opts->lastwritten = (size_t) pv_getnum_count(optarg, opts->decimal_units); numopts++; opts->no_splice = true; break; case 'f': opts->force = true; break; case 'v': opts->show_stats = true; break; case 'n': opts->numeric = true; numopts++; break; case 'q': opts->no_display = true; numopts++; break; case 'c': opts->cursor = true; break; case 'W': opts->wait = true; break; case 'D': opts->delay_start = pv_getnum_interval(optarg); break; case 's': if ('@' != *optarg) { /* A number was passed, not "@". */ opts->size = pv_getnum_size(optarg, opts->decimal_units); } else { /* Permit "@". */ const char *size_file = 1 + optarg; if (!opts_use_size_of_file(opts, size_file)) { opts_free(opts); return NULL; } } break; case 'g': opts->rate_gauge = true; break; case 'l': opts->linemode = true; break; case '0': opts->null_terminated_lines = true; opts->linemode = true; break; case 'i': opts->interval = pv_getnum_interval(optarg); break; case 'w': opts->width = pv_getnum_count(optarg, opts->decimal_units); opts->width_set_manually = opts->width == 0 ? false : true; break; case 'H': opts->height = pv_getnum_count(optarg, opts->decimal_units); opts->height_set_manually = opts->height == 0 ? false : true; break; case 'N': opts->name = pv_strdup(optarg); if (NULL == opts->name) { fprintf(stderr, "%s: -N: %s\n", opts->program_name, strerror(errno)); opts_free(opts); return NULL; } break; case 'u': opts->default_bar_style = pv_strdup(optarg); if (NULL == opts->default_bar_style) { fprintf(stderr, "%s: -u: %s\n", opts->program_name, strerror(errno)); opts_free(opts); return NULL; } break; case 'L': opts->rate_limit = pv_getnum_size(optarg, opts->decimal_units); break; case 'B': opts->buffer_size = (size_t) pv_getnum_size(optarg, opts->decimal_units); opts->no_splice = true; break; case 'C': opts->no_splice = true; break; case 'E': opts->skip_errors++; break; case 'Z': opts->error_skip_block = pv_getnum_size(optarg, opts->decimal_units); break; case 'S': opts->stop_at_size = true; break; case 'Y': opts->sync_after_write = true; break; case 'K': opts->direct_io = true; break; case 'X': opts->discard_input = true; opts->no_splice = true; break; case 'U': opts->store_and_forward_file = pv_strdup(optarg); if (NULL == opts->store_and_forward_file) { fprintf(stderr, "%s: -U: %s\n", opts->program_name, strerror(errno)); opts_free(opts); return NULL; } break; case 'R': opts->remote = (pid_t) pv_getnum_count(optarg, false); break; case 'P': opts->pidfile = pv_strdup(optarg); if (NULL == opts->pidfile) { fprintf(stderr, "%s: -P: %s\n", opts->program_name, strerror(errno)); opts_free(opts); return NULL; } break; case 'F': opts->format = pv_strdup(optarg); if (NULL == opts->format) { fprintf(stderr, "%s: -F: %s\n", opts->program_name, strerror(errno)); opts_free(opts); return NULL; } break; case 'x': opts->extra_display = pv_strdup(optarg); if (NULL == opts->extra_display) { fprintf(stderr, "%s: -x: %s\n", opts->program_name, strerror(errno)); opts_free(opts); return NULL; } break; case 'd': parse_pid = 0; parse_fd = -1; /* No syntax check here, already done earlier */ (void) sscanf(optarg, "%u:%d", &parse_pid, &parse_fd); opts->watch_pid = (pid_t) parse_pid; opts->watch_fd = parse_fd; break; case 'o': opts->output = pv_strdup(optarg); if (NULL == opts->output) { fprintf(stderr, "%s: -o: %s\n", opts->program_name, strerror(errno)); opts_free(opts); return NULL; } break; case 'm': opts->average_rate_window = pv_getnum_count(optarg, opts->decimal_units); break; #ifdef ENABLE_DEBUGGING case '!': debugging_output_destination(optarg); break; #endif /* ENABLE_DEBUGGING */ default: /*@-mustfreefresh@ *//* see above */ /*@-formatconst@ */ #ifdef HAVE_GETOPT_LONG fprintf(stderr, _("Try `%s --help' for more information."), opts->program_name); #else fprintf(stderr, _("Try `%s -h' for more information."), opts->program_name); #endif /*@+formatconst@ */ /* * splint note: formatconst is warning about the use * of a non constant (translatable) format string; * this is unavoidable here and the only attack * vector is through the message catalogue. */ fprintf(stderr, "\n"); opts_free(opts); opts = NULL; return NULL; /* early return */ /*@+mustfreefresh@ */ } } while (c != -1); /* * splint thinks we can reach here after opts_free() and opts=NULL * above, so explicitly return here if opts was set to NULL. */ if (NULL == opts) return NULL; if (0 != opts->watch_pid) { if (opts->linemode || opts->null_terminated_lines || opts->stop_at_size || (opts->skip_errors > 0) || (opts->buffer_size > 0) || (opts->rate_limit > 0)) { /*@-mustfreefresh@ *//* see above */ fprintf(stderr, "%s: %s\n", opts->program_name, _("cannot use line mode or transfer modifier options when watching file descriptors")); opts_free(opts); return NULL; /*@+mustfreefresh@ */ } if (opts->cursor) { /*@-mustfreefresh@ *//* see above */ fprintf(stderr, "%s: %s\n", opts->program_name, _("cannot use cursor positioning when watching file descriptors")); opts_free(opts); return NULL; /*@+mustfreefresh@ */ } if (0 != opts->remote) { /*@-mustfreefresh@ *//* see above */ fprintf(stderr, "%s: %s\n", opts->program_name, _("cannot use remote control when watching file descriptors")); opts_free(opts); return NULL; /*@+mustfreefresh@ */ } if (optind < (int) argc) { /*@-mustfreefresh@ *//* see above */ fprintf(stderr, "%s: %s\n", opts->program_name, _("cannot transfer files when watching file descriptors")); opts_free(opts); return NULL; /*@+mustfreefresh@ */ } #ifndef __APPLE__ if (0 != access("/proc/self/fdinfo", X_OK)) { /* flawfinder: ignore */ /* * flawfinder rationale: access() is used here as a * low cost stat() to see whether the path exists at * all, under a path only modifiable by root, so is * unlikely to be exploitable. */ /*@-mustfreefresh@ *//* see above */ fprintf(stderr, "%s: -d: %s\n", opts->program_name, _("not available on systems without /proc/self/fdinfo")); opts_free(opts); return NULL; /*@+mustfreefresh@ */ } #endif } /* * Default options: -pterb */ if (0 == numopts) { opts->progress = true; opts->timer = true; opts->eta = true; opts->rate = true; opts->bytes = true; } /* If -Z was given but not -E, pretend one -E was given too. */ if (opts->error_skip_block > 0 && 0 == opts->skip_errors) opts->skip_errors = 1; /* * Store remaining command-line arguments. */ while (optind < (int) argc) { if (!opts_add_file(opts, argv[optind++])) { opts_free(opts); return NULL; } } return opts; } pv-1.9.31/src/main/remote.c000066400000000000000000000302611474702661500154220ustar00rootroot00000000000000/* * Remote-control functions. * * Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2025 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #include "config.h" #include "options.h" #include "pv.h" #include #include #include #include #include #include #include #include #include #include #ifdef PV_REMOTE_CONTROL void pv_error(pvstate_t, char *, ...); struct remote_msg { bool progress; /* progress bar flag */ bool timer; /* timer flag */ bool eta; /* ETA flag */ bool fineta; /* absolute ETA flag */ bool rate; /* rate counter flag */ bool average_rate; /* average rate counter flag */ bool bytes; /* bytes transferred flag */ bool bufpercent; /* transfer buffer percentage flag */ size_t lastwritten; /* last-written bytes count */ off_t rate_limit; /* rate limit, in bytes per second */ size_t buffer_size; /* buffer size, in bytes (0=default) */ off_t size; /* total size of data */ double interval; /* interval between updates */ unsigned int width; /* screen width */ unsigned int height; /* screen height */ bool width_set_manually; /* width was set manually, not detected */ bool height_set_manually; /* height was set manually, not detected */ char name[256]; /* flawfinder: ignore */ char format[256]; /* flawfinder: ignore */ char extra_display[256]; /* flawfinder: ignore */ }; /* * flawfinder rationale: name, format, and extra_display are always * explicitly zeroed and bounded to one less than their size so they are * always \0 terminated. */ /* * Return a stream pointer, and populate the filename buffer, for a control * file associated with a particular process ID; it will be opened for * writing if "sender" is true. Returns NULL on error. */ /*@null@ */ /*@dependent@ */ static FILE *pv__control_file(char *filename, size_t bufsize, pid_t control_pid, bool sender) { int open_flags, open_mode, control_fd; /*@dependent@ */ FILE *control_fptr = NULL; open_flags = O_RDONLY; #ifdef O_NOFOLLOW open_flags += O_NOFOLLOW; #endif if (sender) open_flags = O_WRONLY | O_CREAT | O_EXCL; open_mode = 0644; (void) pv_snprintf(filename, bufsize, "/run/user/%lu/pv.remote.%lu", (unsigned long) geteuid(), (unsigned long) control_pid); control_fd = open(filename, open_flags, open_mode); /* flawfinder: ignore */ /* * If /run/user/ wasn't usable, try $HOME/.pv instead. */ if (control_fd < 0) { char *home_dir; home_dir = getenv("HOME"); /* flawfinder: ignore */ if (NULL == home_dir) return NULL; if ('\0' == home_dir[0]) return NULL; /* * flawfinder rationale: null and zero-size values are * rejected, and the destination buffer is bounded. */ (void) pv_snprintf(filename, bufsize, "%s/.pv/remote.%lu", home_dir, (unsigned long) control_pid); control_fd = open(filename, open_flags, open_mode); /* flawfinder: ignore */ /* * If the open failed, try creating the $HOME/.pv directory * first. */ if (control_fd < 0) { (void) pv_snprintf(filename, bufsize, "%s/.pv", home_dir); (void) mkdir(filename, 0700); /* In case of weird umask, explicitly chmod the dir. */ (void) chmod(filename, 0700); /* flawfinder: ignore */ (void) pv_snprintf(filename, bufsize, "%s/.pv/remote.%lu", home_dir, (unsigned long) control_pid); control_fd = open(filename, open_flags, open_mode); /* flawfinder: ignore */ } } /* * flawfinder rationale: the files are in a directory whose parents * cannot be manipulated, and we are not allowing the final * component to be a symbolic link. We are checking that $HOME is * not NULL, and it's bounded by pv_snprintf() so it can't overshoot * the filename buffer. When we chmod $HOME/.pv, we assume that an * attacker is unlikely to be able to manipulate $HOME's contents to * make use of us setting $HOME/.pv to mode 700. */ if (control_fd < 0) return NULL; debug("%s: %s", "control filename", filename); control_fptr = fdopen(control_fd, sender ? "wb" : "rb"); return control_fptr; } /* * Set the options of a remote process by writing them to a file, sending a * signal to the receiving process, and waiting for the message to be * consumed by the remote process. * * Returns nonzero on error. */ int pv_remote_set(opts_t opts, pvstate_t state) { char control_filename[4096]; /* flawfinder: ignore */ FILE *control_fptr; struct remote_msg msgbuf; pid_t signal_sender; long timeout; bool received; /* * flawfinder rationale: buffer is large enough, explicitly zeroed, * and always bounded properly as we are only writing to it with * pv_snprintf(). */ /* * Check that the remote process exists. */ if (kill((pid_t) (opts->remote), 0) != 0) { pv_error(state, "%u: %s", opts->remote, strerror(errno)); return PV_ERROREXIT_REMOTE_OR_PID; } /* * Make sure parameters are within sensible bounds. */ if (opts->width < 1) opts->width = 80; if (opts->height < 1) opts->height = 25; if (opts->width > 999999) opts->width = 999999; if (opts->height > 999999) opts->height = 999999; if ((opts->interval > 0) && (opts->interval < 0.1)) opts->interval = 0.1; if (opts->interval > 600) opts->interval = 600; /* * Copy parameters into message buffer. */ memset(&msgbuf, 0, sizeof(msgbuf)); msgbuf.progress = opts->progress; msgbuf.timer = opts->timer; msgbuf.eta = opts->eta; msgbuf.fineta = opts->fineta; msgbuf.rate = opts->rate; msgbuf.average_rate = opts->average_rate; msgbuf.bytes = opts->bytes; msgbuf.bufpercent = opts->bufpercent; msgbuf.lastwritten = opts->lastwritten; msgbuf.rate_limit = opts->rate_limit; msgbuf.buffer_size = opts->buffer_size; msgbuf.size = opts->size; msgbuf.interval = opts->interval; msgbuf.width = opts->width; msgbuf.height = opts->height; msgbuf.width_set_manually = opts->width_set_manually; msgbuf.height_set_manually = opts->height_set_manually; if (opts->name != NULL) { strncpy(msgbuf.name, opts->name, sizeof(msgbuf.name) - 1); /* flawfinder: ignore */ } if (opts->format != NULL) { strncpy(msgbuf.format, opts->format, sizeof(msgbuf.format) - 1); /* flawfinder: ignore */ } if (opts->extra_display != NULL) { strncpy(msgbuf.extra_display, opts->extra_display, sizeof(msgbuf.extra_display) - 1); /* flawfinder: ignore */ } /* * flawfinder rationale: name, format, and extra_display are * explicitly bounded to 1 less than the size of their buffer and * the buffer is \0 terminated by memset() earlier. */ /* * Get the filename and file stream to use for remote control. */ memset(control_filename, 0, sizeof(control_filename)); control_fptr = pv__control_file(control_filename, sizeof(control_filename), (pid_t) getpid(), true); if (NULL == control_fptr) { pv_error(state, "%s", strerror(errno)); return PV_ERROREXIT_REMOTE_OR_PID; } /* * Write the message buffer to the remote control file, and close * it. */ if (1 != fwrite(&msgbuf, sizeof(msgbuf), 1, control_fptr)) { pv_error(state, "%s", strerror(errno)); (void) fclose(control_fptr); (void) remove(control_filename); return PV_ERROREXIT_REMOTE_OR_PID; } if (0 != fclose(control_fptr)) { pv_error(state, "%s", strerror(errno)); (void) remove(control_filename); return PV_ERROREXIT_REMOTE_OR_PID; } /* * Send a SIGUSR2 signal to the remote process, to tell it a message * is ready to read, after clearing our own "SIGUSR2 received" flag. */ signal_sender = 0; (void) pv_sigusr2_received(state, &signal_sender); if (kill((pid_t) (opts->remote), SIGUSR2) != 0) { pv_error(state, "%u: %s", opts->remote, strerror(errno)); (void) remove(control_filename); return PV_ERROREXIT_REMOTE_OR_PID; } debug("%s", "message sent"); /* * Wait for a signal from the remote process to say it has received * the message. */ timeout = 1100000; received = false; while (timeout > 10000 && !received) { struct timeval tv; memset(&tv, 0, sizeof(tv)); tv.tv_sec = 0; tv.tv_usec = 10000; /*@-nullpass@ *//* splint: NULL is OK with select() */ (void) select(0, NULL, NULL, NULL, &tv); /*@+nullpass@ */ timeout -= 10000; if (pv_sigusr2_received(state, &signal_sender)) { if (signal_sender == opts->remote) { debug("%s", "message received"); received = true; } } } /* * Remove the remote control file. */ if (0 != remove(control_filename)) { pv_error(state, "%s", strerror(errno)); } /* * Return 0 if the message was received. */ if (received) return 0; /*@-mustfreefresh@ */ /* * splint note: the gettext calls made by _() cause memory leak * warnings, but in this case it's unavoidable, and mitigated by the * fact we only translate each string once. */ pv_error(state, "%u: %s", opts->remote, _("message not received")); return PV_ERROREXIT_REMOTE_OR_PID; /*@+mustfreefresh @ */ } /* * Check for a remote control message and, if there is one, replace the * current process's options with those being passed in. * * NB relies on pv_state_set_format() causing the output format to be * reparsed. */ void pv_remote_check(pvstate_t state) { pid_t signal_sender; char control_filename[4096]; /* flawfinder: ignore */ FILE *control_fptr; struct remote_msg msgbuf; /* flawfinder rationale: as above. */ /* * Return early if a SIGUSR2 signal has not been received. */ signal_sender = 0; if (!pv_sigusr2_received(state, &signal_sender)) return; memset(control_filename, 0, sizeof(control_filename)); control_fptr = pv__control_file(control_filename, sizeof(control_filename), signal_sender, false); if (NULL == control_fptr) { pv_error(state, "%s: %s", control_filename, strerror(errno)); return; } /* * Read the message buffer from the remote control file, and close * it. */ if (1 != fread(&msgbuf, sizeof(msgbuf), 1, control_fptr)) { pv_error(state, "%s", strerror(errno)); (void) fclose(control_fptr); return; } if (0 != fclose(control_fptr)) { pv_error(state, "%s", strerror(errno)); return; } /* * Send a SIGUSR2 signal to the sending process, to tell it the * message has been received. */ if (kill(signal_sender, SIGUSR2) != 0) { debug("%u: %s", signal_sender, strerror(errno)); } debug("%s", "received remote message"); pv_state_format_string_set(state, NULL); pv_state_name_set(state, NULL); pv_state_extra_display_set(state, NULL); msgbuf.name[sizeof(msgbuf.name) - 1] = '\0'; msgbuf.format[sizeof(msgbuf.format) - 1] = '\0'; msgbuf.extra_display[sizeof(msgbuf.extra_display) - 1] = '\0'; pv_state_set_format(state, msgbuf.progress, msgbuf.timer, msgbuf.eta, msgbuf.fineta, msgbuf.rate, msgbuf.average_rate, msgbuf.bytes, msgbuf.bufpercent, msgbuf.lastwritten, '\0' == msgbuf.name[0] ? NULL : msgbuf.name); if (msgbuf.rate_limit > 0) pv_state_rate_limit_set(state, msgbuf.rate_limit); if (msgbuf.buffer_size > 0) { pv_state_target_buffer_size_set(state, msgbuf.buffer_size); } if (msgbuf.size > 0) pv_state_size_set(state, msgbuf.size); if (msgbuf.interval > 0) pv_state_interval_set(state, msgbuf.interval); if (msgbuf.width > 0 && msgbuf.width_set_manually) pv_state_width_set(state, msgbuf.width, msgbuf.width_set_manually); if (msgbuf.height > 0 && msgbuf.height_set_manually) pv_state_height_set(state, msgbuf.height, msgbuf.height_set_manually); if (msgbuf.format[0] != '\0') pv_state_format_string_set(state, msgbuf.format); if (msgbuf.extra_display[0] != '\0') pv_state_extra_display_set(state, msgbuf.extra_display); } /* * Initialise remote message reception handling. */ void pv_remote_init(void) { } /* * Clean up after remote message reception handling. */ void pv_remote_fini(void) { } #else /* !PV_REMOTE_CONTROL */ /* * Dummy stubs for remote control when we don't have PV_REMOTE_CONTROL. */ void pv_remote_init(void) { } void pv_remote_check( /*@unused@ */ __attribute__((unused)) pvstate_t state) { } void pv_remote_fini(void) { } int pv_remote_set( /*@unused@ */ __attribute__((unused)) opts_t opts, /*@unused@ */ __attribute__((unused)) pvstate_t state) { /*@-mustfreefresh@ *//* splint - see above */ fprintf(stderr, "%s\n", _("SA_SIGINFO not supported on this system")); /*@+mustfreefresh@ */ return PV_ERROREXIT_REMOTE_OR_PID; } #endif /* SA_SIGINFO */ pv-1.9.31/src/main/version.c000066400000000000000000000022351474702661500156140ustar00rootroot00000000000000/* * Output version information to stdout. * * Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2025 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #include "config.h" #include /* * Display current package version as per GNU standards. */ void display_version(void) { /*@-mustfreefresh@ */ /* * splint note: the gettext calls made by _() cause memory leak * warnings, but in this case it's unavoidable, and mitigated by the * fact we only translate each string once. */ /* GNU standard first line format: program and version only */ printf("%s %s\n", PACKAGE_NAME, PACKAGE_VERSION); /* GNU standard second line format - "Copyright" always in English */ printf("Copyright %s %s\n", "2025", "Andrew Wood"); /* GNU standard license line and free software notice */ printf("%s\n", _("License: GPLv3+ ")); printf("%s\n", _("This is free software: you are free to change and redistribute it.")); printf("%s\n", _("There is NO WARRANTY, to the extent permitted by law.")); /* Project web site link */ printf("\n%s: <%s>\n", _("Project web site"), PACKAGE_URL); } pv-1.9.31/src/pv/000077500000000000000000000000001474702661500134625ustar00rootroot00000000000000pv-1.9.31/src/pv/calc.c000066400000000000000000000127561474702661500145430ustar00rootroot00000000000000/* * Functions for updating the calculated state of the transfer. * * Copyright 2024-2025 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #include "config.h" #include "pv.h" #include "pv-internal.h" /* * Update the current average rate, using a ring buffer of past transfer * positions - if this is the first entry, use the provided instantaneous * rate, otherwise calulate the average rate from the difference between the * current position + elapsed time pair, and the oldest pair in the buffer. */ static void pv__update_average_rate_history(pvstate_t state, long double rate) { size_t first = state->calc.history_first; size_t last = state->calc.history_last; long double last_elapsed; if (NULL == state->calc.history) return; last_elapsed = state->calc.history[last].elapsed_sec; /* * Do nothing if this is not the first call but not enough time has * elapsed since the previous call yet. */ if ((last_elapsed > 0.0) && (state->transfer.elapsed_seconds < (last_elapsed + state->control.history_interval))) return; /* * If this is not the first call, add a new entry to the circular * buffer. */ if (last_elapsed > 0.0) { size_t len = state->calc.history_len; last = (last + 1) % len; state->calc.history_last = last; if (last == first) { first = (first + 1) % len; state->calc.history_first = first; } } state->calc.history[last].elapsed_sec = state->transfer.elapsed_seconds; state->calc.history[last].transferred = state->transfer.transferred; if (first == last) { state->calc.current_avg_rate = rate; } else { off_t bytes = (state->calc.history[last].transferred - state->calc.history[first].transferred); long double sec = (state->calc.history[last].elapsed_sec - state->calc.history[first].elapsed_sec); state->calc.current_avg_rate = (long double) bytes / sec; } } /* * Update all calculated transfer state (state->calc). * * If "final" is true, this is the final update, so * state->calc.transfer_rate and state->calc.average_rate are given as an * average over the whole transfer; otherwise they are the current transfer * rate and current average rate. * * The value of state->calc.percentage will reflect the percentage * completion if state->control.size is greater than zero, otherwise it will * increase by 2 each call and wrap at 200. */ void pv_calculate_transfer_rate(pvstate_t state, bool final) { off_t bytes_since_last; long double time_since_last, transfer_rate, average_rate; /* Quick safety check - state must exist. */ if (NULL == state) return; bytes_since_last = 0; if (state->transfer.transferred >= 0) { bytes_since_last = state->transfer.transferred - state->calc.prev_transferred; state->calc.prev_transferred = state->transfer.transferred; } /* * In case the time since the last update is very small, we keep * track of amount transferred since the last update, and just keep * adding to that until a reasonable amount of time has passed to * avoid rate spikes or division by zero. */ time_since_last = state->transfer.elapsed_seconds - state->calc.prev_elapsed_sec; if (time_since_last <= 0.01) { transfer_rate = state->calc.prev_rate; state->calc.prev_trans += bytes_since_last; } else { long double measured_rate; transfer_rate = ((long double) bytes_since_last + state->calc.prev_trans) / time_since_last; measured_rate = transfer_rate; state->calc.prev_elapsed_sec = state->transfer.elapsed_seconds; state->calc.prev_trans = 0; if (state->control.bits) measured_rate = 8.0 * measured_rate; if ((state->calc.measurements_taken < 1) || (measured_rate < state->calc.rate_min)) { state->calc.rate_min = measured_rate; } if (measured_rate > state->calc.rate_max) { state->calc.rate_max = measured_rate; } state->calc.rate_sum += measured_rate; state->calc.ratesquared_sum += (measured_rate * measured_rate); state->calc.measurements_taken++; } state->calc.prev_rate = transfer_rate; /* Update history and current average rate for ETA. */ pv__update_average_rate_history(state, transfer_rate); average_rate = state->calc.current_avg_rate; /* * If this is the final update at the end of the transfer, we * recalculate the rate - and the average rate - across the whole * period of the transfer. */ if (final) { /* Safety check to avoid division by zero. */ if (state->transfer.elapsed_seconds < 0.000001) state->transfer.elapsed_seconds = 0.000001; average_rate = (((long double) (state->transfer.transferred)) - ((long double) state->display.initial_offset)) / (long double) (state->transfer.elapsed_seconds); transfer_rate = average_rate; } state->calc.transfer_rate = transfer_rate; state->calc.average_rate = average_rate; if (state->control.size <= 0) { /* * If we don't know the total size of the incoming data, * then for a percentage, we gradually increase the * percentage completion as data arrives, to a maximum of * 200, then reset it - we use this if we can't calculate * it, so that the numeric percentage output will go * 0%-100%, 100%-0%, 0%-100%, and so on. */ if (transfer_rate > 0) state->calc.percentage += 2; if (state->calc.percentage > 199) state->calc.percentage = 0; } else { state->calc.percentage = pv_percentage(state->transfer.transferred, state->control.size); } /* Ensure the percentage is never negative or huge. */ if (state->calc.percentage < 0.0) state->calc.percentage = 0.0; if (state->calc.percentage > 100000.0) state->calc.percentage = 100000.0; } pv-1.9.31/src/pv/cursor.c000066400000000000000000000450511474702661500151500ustar00rootroot00000000000000/* * Cursor positioning functions. * * If IPC is available, then a shared memory segment is used to co-ordinate * cursor positioning across multiple instances of `pv'. The shared memory * segment contains an integer which is the original "y" co-ordinate of the * first `pv' process. * * However, some OSes (FreeBSD and MacOS X so far) don't allow locking of a * terminal, so we try to use a lockfile if terminal locking doesn't work, * and finally abort if even that is unavailable. * * Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2025 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #include "config.h" #include "pv.h" #include "pv-internal.h" #include #include #include #include #include #include #include #include #include #ifdef HAVE_IPC #include #include #ifdef HAVE_SYS_PARAM_H #include #endif #endif /* HAVE_IPC */ /* for basename() */ #ifdef HAVE_LIBGEN_H #include #endif /* * Create a per-euid, per-tty, lockfile in ${TMPDIR:-${TMP:-/tmp}} for the * tty on the given file descriptor. */ static void pv_crs_open_lockfile(pvstate_t state, int fd) { char *ttydev; char *tmpdir; int openflags; state->cursor.lock_fd = -1; ttydev = ttyname(fd); if (!ttydev) { if (!state->control.force) { pv_error(state, "%s: %s", _("failed to get terminal name"), strerror(errno)); } /* * If we don't know our terminal name, we can neither do IPC * nor make a lock file, so turn off cursor positioning. */ state->control.cursor = 0; debug("%s", "ttyname failed - cursor positioning disabled"); return; } tmpdir = (char *) getenv("TMPDIR"); /* flawfinder: ignore */ if ((NULL == tmpdir) || ('\0' == tmpdir[0])) tmpdir = (char *) getenv("TMP"); /* flawfinder: ignore */ if ((NULL == tmpdir) || ('\0' == tmpdir[0])) tmpdir = "/tmp"; /* * flawfinder rationale: null and zero-size values of $TMPDIR and * $TMP are rejected, and the destination buffer is bounded. */ memset(state->cursor.lock_file, 0, PV_SIZEOF_CRS_LOCK_FILE); (void) pv_snprintf(state->cursor.lock_file, PV_SIZEOF_CRS_LOCK_FILE, "%s/pv-%s-%i.lock", tmpdir, basename(ttydev), (int) geteuid()); /* * Pawel Piatek - not everyone has O_NOFOLLOW, e.g. AIX doesn't. */ #ifdef O_NOFOLLOW openflags = O_RDWR | O_CREAT | O_NOFOLLOW; #else openflags = O_RDWR | O_CREAT; #endif state->cursor.lock_fd = open(state->cursor.lock_file, openflags, 0600); /* flawfinder: ignore */ /* * flawfinder rationale: we aren't truncating the lock file, we * don't change its contents, and we are attempting to use * O_NOFOLLOW where possible to avoid symlink attacks, so this * open() is as safe as we can make it. */ if (state->cursor.lock_fd < 0) { pv_error(state, "%s: %s: %s", state->cursor.lock_file, _("failed to open lock file"), strerror(errno)); state->control.cursor = 0; return; } } /* * Lock the terminal on the given file descriptor, falling back to using a * lockfile if the terminal itself cannot be locked. */ static void pv_crs_lock(pvstate_t state, int fd) { struct flock lock; int lock_fd; lock_fd = fd; if (state->cursor.lock_fd >= 0) lock_fd = state->cursor.lock_fd; memset(&lock, 0, sizeof(lock)); lock.l_type = (short) F_WRLCK; lock.l_whence = (short) SEEK_SET; lock.l_start = 0; lock.l_len = 1; while (fcntl(lock_fd, F_SETLKW, &lock) < 0) { if (errno != EINTR) { if (state->cursor.lock_fd == -2) { pv_crs_open_lockfile(state, fd); if (state->cursor.lock_fd >= 0) { lock_fd = state->cursor.lock_fd; } } else { pv_error(state, "%s: %s", _("lock attempt failed"), strerror(errno)); return; } } } if (state->cursor.lock_fd >= 0) { debug("%s: %s", state->cursor.lock_file, "terminal lockfile acquired"); } else { debug("%s", "terminal lock acquired"); } } /* * Unlock the terminal on the given file descriptor. If pv_crs_lock used * lockfile locking, unlock the lockfile. */ static void pv_crs_unlock(pvstate_t state, int fd) { struct flock lock; int lock_fd; lock_fd = fd; if (state->cursor.lock_fd >= 0) lock_fd = state->cursor.lock_fd; memset(&lock, 0, sizeof(lock)); lock.l_type = (short) F_UNLCK; lock.l_whence = (short) SEEK_SET; lock.l_start = 0; lock.l_len = 1; (void) fcntl(lock_fd, F_SETLK, &lock); if (state->cursor.lock_fd >= 0) { debug("%s: %s", state->cursor.lock_file, "terminal lockfile released"); } else { debug("%s", "terminal lock released"); } } #ifdef HAVE_IPC /* * Get the current number of processes attached to our shared memory * segment, i.e. find out how many `pv' processes in total are running in * cursor mode (including us), and store it in pv_crs_pvcount. If this is * larger than pv_crs_pvmax, update pv_crs_pvmax. */ static void pv_crs_ipccount(pvstate_t state) { struct shmid_ds buf; memset(&buf, 0, sizeof(buf)); buf.shm_nattch = 0; (void) shmctl(state->cursor.shmid, IPC_STAT, &buf); state->cursor.pvcount = (int) (buf.shm_nattch); if (state->cursor.pvcount > state->cursor.pvmax) state->cursor.pvmax = state->cursor.pvcount; debug("%s: %d", "pvcount", state->cursor.pvcount); } #endif /* HAVE_IPC */ /* * Get the current cursor Y co-ordinate by sending the ECMA-48 CPR code to * the terminal connected to the given file descriptor. * * This should only be called while the terminal is locked, to avoid * confusing other "pv -c" instances about the current terminal attributes, * since this function temporarily changes the terminal attributes and then * puts them back. */ static int pv_crs_get_ypos(int terminalfd) { struct termios tty; struct termios old_tty; char cpr[32]; /* flawfinder: ignore - bounded, zeroed */ int ypos; ssize_t r; #ifdef CURSOR_ANSWERBACK_BYTE_BY_BYTE int got; #endif /* CURSOR_ANSWERBACK_BYTE_BY_BYTE */ if (0 != tcgetattr(terminalfd, &tty)) { debug("%s: %s", "tcgetattr (1) failed", strerror(errno)); } if (0 != tcgetattr(terminalfd, &old_tty)) { debug("%s: %s", "tcgetattr (2) failed", strerror(errno)); } tty.c_lflag &= ~(ICANON | ECHO); if (0 != tcsetattr(terminalfd, TCSANOW | TCSAFLUSH, &tty)) { debug("%s: %s", "tcsetattr (1) failed", strerror(errno)); } pv_write_retry(terminalfd, "\033[6n", 4); memset(cpr, 0, sizeof(cpr)); #ifdef CURSOR_ANSWERBACK_BYTE_BY_BYTE /* Read answerback byte by byte - fails on AIX */ for (got = 0, r = 0; got < (int) (sizeof(cpr) - 2); got += r) { r = read(terminalfd, cpr + got, 1); /* flawfinder: ignore */ /* flawfinder rationale: bounded to buffer size by "for" */ if (r <= 0) { debug("got=%d, r=%d: %s", got, r, strerror(errno)); break; } if (cpr[got] == 'R') break; } debug ("read answerback message from fd %d, length %d - buf = %02X %02X %02X %02X %02X %02X", terminalfd, got, cpr[0], cpr[1], cpr[2], cpr[3], cpr[4], cpr[5]); #else /* !CURSOR_ANSWERBACK_BYTE_BY_BYTE */ /* Read answerback in one big lump - may fail on Solaris */ r = read(terminalfd, cpr, sizeof(cpr) - 2); /* flawfinder: ignore */ /* flawfinder rationale: bounded to buffer size */ if (r <= 0) { debug("r=%d: %s", r, strerror(errno)); } else { debug ("read answerback message from fd %d, length %d - buf = %02X %02X %02X %02X %02X %02X", terminalfd, r, cpr[0], cpr[1], cpr[2], cpr[3], cpr[4], cpr[5]); } #endif /* !CURSOR_ANSWERBACK_BYTE_BY_BYTE */ ypos = (int) pv_getnum_count(cpr + 2, false); if (0 != tcsetattr(terminalfd, TCSANOW | TCSAFLUSH, &old_tty)) { debug("%s: %s", "tcsetattr (2) failed", strerror(errno)); } debug("%s: %d", "ypos", ypos); return ypos; } #ifdef HAVE_IPC /* * Initialise the IPC data, returning nonzero on error. * * To do this, we attach to the shared memory segment (creating it if it * does not exist). If we are the only process attached to it, then we * initialise it with the current cursor position. * * There is a race condition here: another process could attach before we've * had a chance to check, such that no process ends up getting an "attach * count" of one, and so no initialisation occurs. So, we lock the terminal * with pv_crs_lock() while we are attaching and checking. */ static int pv_crs_ipcinit(pvstate_t state, char *ttyfile, int terminalfd) { key_t key; /* * Base the key for the shared memory segment on our current tty, so * we don't end up interfering in any way with instances of `pv' * running on another terminal. */ key = ftok(ttyfile, (int) 'p'); if (-1 == key) { debug("%s: %s\n", "ftok failed", strerror(errno)); return 1; } pv_crs_lock(state, terminalfd); if (!state->control.cursor) { debug("%s", "early return - cursor has been disabled"); return 1; } state->cursor.shmid = shmget(key, sizeof(struct pvcursorstate_s), 0600 | IPC_CREAT); if (state->cursor.shmid < 0) { debug("%s: %s", "shmget failed", strerror(errno)); pv_crs_unlock(state, terminalfd); return 1; } /*@-nullpass@ */ /* splint doesn't know shmaddr can be NULL */ state->cursor.shared = shmat(state->cursor.shmid, NULL, 0); /*@+nullpass@ */ pv_crs_ipccount(state); /* * If nobody else is attached to the shared memory segment, we're * the first, so we need to initialise the shared memory with our * current Y cursor co-ordinate and with an initial false value for * the TOSTOP-added flag. */ if (state->cursor.pvcount < 2) { state->cursor.y_start = pv_crs_get_ypos(terminalfd); state->cursor.shared->y_topmost = state->cursor.y_start; state->cursor.shared->tty_tostop_added = false; state->cursor.y_lastread = state->cursor.y_start; debug("%s", "we are the first to attach"); } state->cursor.y_offset = state->cursor.pvcount - 1; if (state->cursor.y_offset < 0) state->cursor.y_offset = 0; /* * If anyone else had attached to the shared memory segment, we need * to read the top Y co-ordinate from it. */ if (state->cursor.pvcount > 1) { state->cursor.y_start = state->cursor.shared->y_topmost; state->cursor.y_lastread = state->cursor.y_start; debug("%s: %d", "not the first to attach - got top y", state->cursor.y_start); } pv_crs_unlock(state, terminalfd); return 0; } #endif /* HAVE_IPC */ /* * Initialise the terminal for cursor positioning. */ void pv_crs_init(pvstate_t state) { char *ttyfile; int terminalfd; state->cursor.lock_fd = -2; state->cursor.lock_file[0] = '\0'; if (!state->control.cursor) return; debug("%s", "init"); ttyfile = ttyname(STDERR_FILENO); if (NULL == ttyfile) { debug("%s: %s", "disabling cursor positioning because ttyname failed", strerror(errno)); state->control.cursor = false; return; } terminalfd = open(ttyfile, O_RDWR); /* flawfinder: ignore */ /* * flawfinder rationale: the file we open won't be truncated but * could be corrupted by writes attempting to get the current Y * position; but we get the filename from ttyname() and it could be * a symbolic link, so we can't do much more than trust it. */ if (terminalfd < 0) { pv_error(state, "%s: %s: %s", _("failed to open terminal"), ttyfile, strerror(errno)); state->control.cursor = false; return; } #ifdef HAVE_IPC if (pv_crs_ipcinit(state, ttyfile, terminalfd) != 0) { debug("%s", "ipcinit failed, setting noipc flag"); state->cursor.noipc = true; } /* * If we have already set the terminal TOSTOP attribute, set the * flag in shared memory to let the other instances know. */ if ((!state->cursor.noipc) && (1 == state->flag.clear_tty_tostop_on_exit) && (NULL != state->cursor.shared)) { debug("%s", "propagating local clear_tty_tostop_on_exit true value to shared tty_tostop_added flag"); state->cursor.shared->tty_tostop_added = true; } /* * If we are not using IPC, then we need to get the current Y * co-ordinate. If we are using IPC, then the pv_crs_ipcinit() * function takes care of this in a more multi-process-friendly way. */ if (state->cursor.noipc) { #else /* ! HAVE_IPC */ if (1) { #endif /* HAVE_IPC */ /* * Get current cursor position + 1. */ pv_crs_lock(state, terminalfd); state->cursor.y_start = pv_crs_get_ypos(terminalfd); /* * Move down a line while the terminal is locked, so that * other processes in the pipeline will get a different * initial ypos. */ if (state->cursor.y_start > 0) pv_tty_write(state, "\n", 1); pv_crs_unlock(state, terminalfd); if (state->cursor.y_start < 1) state->control.cursor = 0; } (void) close(terminalfd); } #ifdef HAVE_IPC /* * Set the "we need to reinitialise cursor positioning" flag. */ void pv_crs_needreinit(pvstate_t state) { state->cursor.needreinit += 2; if (state->cursor.needreinit > 3) state->cursor.needreinit = 3; } #endif #ifdef HAVE_IPC /* * Reinitialise the cursor positioning code (called if we are backgrounded * then foregrounded again). */ static void pv_crs_reinit(pvstate_t state) { debug("%s", "reinit"); if (1 == state->flag.suspend_stderr) { debug("%s", "reinit abandoned - stderr is suspended"); return; } pv_crs_lock(state, STDERR_FILENO); state->cursor.needreinit--; if (state->cursor.y_offset < 1) state->cursor.needreinit = 0; if (state->cursor.needreinit > 0) { pv_crs_unlock(state, STDERR_FILENO); return; } debug("%s", "reinit full"); state->cursor.y_start = pv_crs_get_ypos(STDERR_FILENO); if ((state->cursor.y_offset < 1) && (NULL != state->cursor.shared)) { state->cursor.shared->y_topmost = state->cursor.y_start; } state->cursor.y_lastread = state->cursor.y_start; pv_crs_unlock(state, STDERR_FILENO); } #endif /* * Output a single-line update (\0-terminated), using the ECMA-48 CSI "CUP" * sequence to move the cursor to the correct position to do so. */ void pv_crs_update(pvstate_t state, const char *output_line) { char cup_cmd[32]; /* flawfinder: ignore */ size_t cup_cmd_length, output_line_length; int y; /* * flawfinder rationale: the "cup_cmd" buffer is always zeroed * before each use, and is only written to by pv_snprintf() bounded * by its size; also, that function explictly zero-terminates the * string it writes. The write() call is also bounded. */ output_line_length = strlen(output_line); /* flawfinder: ignore */ /* flawfinder - output_line is explictly expected to be \0-terminated. */ #ifdef HAVE_IPC if (!state->cursor.noipc) { if (state->cursor.needreinit > 0) pv_crs_reinit(state); pv_crs_ipccount(state); if (NULL != state->cursor.shared) { if (state->cursor.y_lastread != state->cursor.shared->y_topmost) { state->cursor.y_start = state->cursor.shared->y_topmost; state->cursor.y_lastread = state->cursor.y_start; } } if (state->cursor.needreinit > 0) return; } #endif /* HAVE_IPC */ y = state->cursor.y_start; #ifdef HAVE_IPC /* * If the screen has scrolled, or is about to scroll, due to * multiple `pv' instances taking us near the bottom of the screen, * scroll the screen (only if we're the first `pv'), and then move * our initial Y co-ordinate up. */ if (((state->cursor.y_start + state->cursor.pvmax) > (int) (state->control.height)) && (!state->cursor.noipc) ) { int offs; offs = ((state->cursor.y_start + state->cursor.pvmax) - state->control.height); state->cursor.y_start -= offs; if (state->cursor.y_start < 1) state->cursor.y_start = 1; debug("%s: %d", "scroll offset", offs); /* * Scroll the screen if we're the first `pv'. */ if (0 == state->cursor.y_offset) { pv_crs_lock(state, STDERR_FILENO); memset(cup_cmd, 0, sizeof(cup_cmd)); (void) pv_snprintf(cup_cmd, sizeof(cup_cmd), "\033[%u;1H", state->control.height); cup_cmd_length = strlen(cup_cmd); /* flawfinder: ignore */ pv_tty_write(state, cup_cmd, cup_cmd_length); for (; offs > 0; offs--) { pv_tty_write(state, "\n", 1); } pv_crs_unlock(state, STDERR_FILENO); debug("%s", "we are the first - scrolled screen"); } } if (!state->cursor.noipc) y = state->cursor.y_start + state->cursor.y_offset; #endif /* HAVE_IPC */ /* * Keep the Y co-ordinate within sensible bounds, so we can never * overflow the "cup_cmd" buffer. */ if ((y < 1) || (y > 999999)) y = 1; memset(cup_cmd, 0, sizeof(cup_cmd)); (void) pv_snprintf(cup_cmd, sizeof(cup_cmd), "\033[%d;1H", y); cup_cmd_length = strlen(cup_cmd); /* flawfinder: ignore */ /* * flawfinder rationale: "cup_cmd" is only written to by * pv_snprintf(), which explicitly ensures that the string will be * \0-terminated, and the buffer is zeroed beforehand so if * pv_snprintf() fails to run the string will be of zero length. */ pv_crs_lock(state, STDERR_FILENO); pv_tty_write(state, cup_cmd, cup_cmd_length); pv_tty_write(state, output_line, output_line_length); pv_crs_unlock(state, STDERR_FILENO); } /* * Reposition the cursor to a final position. */ void pv_crs_fini(pvstate_t state) { char cup_cmd[32]; /* flawfinder: ignore */ unsigned int y; /* flawfinder - "cup_cmd" is zeroed, and only written by pv_snprintf() */ debug("%s", "fini"); y = (unsigned int) (state->cursor.y_start); #ifdef HAVE_IPC if ((state->cursor.pvmax > 0) && (!state->cursor.noipc)) y += state->cursor.pvmax - 1; #endif /* HAVE_IPC */ if (y > state->control.height) y = state->control.height; /* * Absolute bounds check. */ if ((y < 1) || (y > 999999)) y = 1; memset(cup_cmd, 0, sizeof(cup_cmd)); (void) pv_snprintf(cup_cmd, sizeof(cup_cmd), "\033[%u;1H\n", y); pv_crs_lock(state, STDERR_FILENO); pv_tty_write(state, cup_cmd, strlen(cup_cmd)); /* flawfinder: ignore */ /* flawfinder - pv_snprintf() always \0-terminates (see above). */ #ifdef HAVE_IPC /* * If any other "pv -c" instances have set the terminal TOSTOP * attribute, set our local flag so pv_sig_fini() will know about * it. */ if ((!state->cursor.noipc) && (NULL != state->cursor.shared) && state->cursor.shared->tty_tostop_added) { if (0 == state->flag.clear_tty_tostop_on_exit) { debug("%s", "propagating shared tty_tostop_added true value to local clear_tty_tostop_on_exit flag"); state->flag.clear_tty_tostop_on_exit = 1; } } pv_crs_ipccount(state); if (NULL != state->cursor.shared) { (void) shmdt(state->cursor.shared); } state->cursor.shared = NULL; /* * If we are the last instance detaching from the shared memory, * delete it so it's not left lying around. */ if (state->cursor.pvcount < 2) { struct shmid_ds shm_buf; memset(&shm_buf, 0, sizeof(shm_buf)); (void) shmctl(state->cursor.shmid, IPC_RMID, &shm_buf); } #endif /* HAVE_IPC */ pv_crs_unlock(state, STDERR_FILENO); if (state->cursor.lock_fd >= 0) { (void) close(state->cursor.lock_fd); /* * We can get away with removing this on exit because all * the other PVs will be finishing at the same sort of time. */ (void) remove(state->cursor.lock_file); } } pv-1.9.31/src/pv/display.c000066400000000000000000001134231474702661500152770ustar00rootroot00000000000000/* * Display functions. * * Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2025 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #include "config.h" #include "pv.h" #include "pv-internal.h" #include #include #include #include #include #include #include #ifdef HAVE_TERMIOS_H #include #endif #ifdef ENABLE_NCURSES #ifdef HAVE_TERM_H #include #endif #endif /* * If USE_POPEN_TPUTS is defined, then we call popen("tputs") if ncurses is * unavailable, when we need to know whether colours are supported. * * Since popen() is risky to call (in case $PATH has been altered), it is * safer to just assume colour is available if we can't check, so * USE_POPEN_TPUTS is undefined here by default. */ #undef USE_POPEN_TPUTS /* * We need sys/ioctl.h for ioctl() regardless of whether TIOCGWINSZ is * defined in termios.h, so we no longer use AC_HEADER_TIOCGWINSZ in * configure.in, and just include both header files if they are available. * (GH#74, 2023-08-06) */ #ifdef HAVE_SYS_IOCTL_H #include #endif /* * Output an error message. If we've displayed anything to the terminal * already, then put a newline before our error so we don't write over what * we've written. */ void pv_error(pvstate_t state, char *format, ...) { va_list ap; if (state->display.display_visible) fprintf(stderr, "\n"); fprintf(stderr, "%s: ", state->status.program_name); va_start(ap, format); (void) vfprintf(stderr, format, ap); /* flawfinder: ignore */ va_end(ap); fprintf(stderr, "\n"); /* * flawfinder: this function relies on callers always having a * static format string, not directly subject to outside influences. */ } /* * Return true if we are the foreground process on the terminal, or if we * aren't outputting to a terminal; false otherwise. */ bool pv_in_foreground(void) { pid_t our_process_group; pid_t tty_process_group; if (0 == isatty(STDERR_FILENO)) { debug("true: %s", "not a tty"); return true; } /*@-type@ *//* __pid_t vs pid_t, not significant */ our_process_group = getpgrp(); tty_process_group = tcgetpgrp(STDERR_FILENO); /*@+type@ */ if (tty_process_group == -1 && errno == ENOTTY) { debug("true: %s", "tty_process_group is -1, errno is ENOTTY"); return true; } if (our_process_group == tty_process_group) { debug("true: %s (%d)", "our_process_group == tty_process_group", our_process_group); return true; } /* * If the terminal process group ID doesn't match our own, assume * we're in the background. */ debug("false: our_process_group=%d, tty_process_group=%d", our_process_group, tty_process_group); return false; } /* * Write the given buffer to the given file descriptor, retrying until all * bytes have been written or an error has occurred. */ void pv_write_retry(int fd, const char *buf, size_t count) { while (count > 0) { ssize_t nwritten; nwritten = write(fd, buf, count); if (nwritten < 0) { if ((EINTR == errno) || (EAGAIN == errno)) { continue; } return; } if (nwritten < 1) return; count -= nwritten; buf += nwritten; } } /* * Write the given buffer to the terminal, like pv_write_retry(), unless * stderr is suspended. */ void pv_tty_write(pvstate_t state, const char *buf, size_t count) { while (0 == state->flag.suspend_stderr && count > 0) { ssize_t nwritten; nwritten = write(STDERR_FILENO, buf, count); if (nwritten < 0) { if ((EINTR == errno) || (EAGAIN == errno)) { continue; } return; } if (nwritten < 1) return; count -= nwritten; buf += nwritten; } } /* * Fill in *width and *height with the current terminal size, * if possible. */ void pv_screensize(unsigned int *width, unsigned int *height) { #ifdef TIOCGWINSZ struct winsize wsz; memset(&wsz, 0, sizeof(wsz)); if (0 != isatty(STDERR_FILENO)) { if (0 == ioctl(STDERR_FILENO, TIOCGWINSZ, &wsz)) { *width = wsz.ws_col; *height = wsz.ws_row; } } #endif } /* * Return the original value x so that it has been clamped between * [min..max] */ long pv_bound_long(long x, long min, long max) { return x < min ? min : x > max ? max : x; } /* * Given how many bytes have been transferred, the total byte count to * transfer, and the current average transfer rate, return the estimated * number of seconds until completion. */ long pv_seconds_remaining(const off_t so_far, const off_t total, const long double rate) { long double amount_left; if ((so_far < 1) || (rate < 0.001)) return 0; amount_left = (long double) (total - so_far) / rate; return (long) amount_left; } /* * Given a long double value, it is divided or multiplied by the ratio until * a value in the range 1.0 to 999.999... is found. The string "prefix" to * is updated to the corresponding SI prefix. * * If the count type is PV_TRANSFERCOUNT_BYTES, then the second byte of * "prefix" is set to "i" to denote MiB etc (IEEE1541). Thus "prefix" * should be at least 3 bytes long (to include the terminating null). */ void pv_si_prefix(long double *value, char *prefix, const long double ratio, pvtransfercount_t count_type) { static char *pfx_000 = NULL; /* kilo, mega, etc */ static char *pfx_024 = NULL; /* kibi, mibi, etc */ static char const *pfx_middle_000 = NULL; static char const *pfx_middle_024 = NULL; char *pfx; char const *pfx_middle; char const *pfx_ptr; long double cutoff; prefix[0] = ' '; /* Make the prefix start blank. */ prefix[1] = '\0'; /* * The prefix list strings have a space (no prefix) in the middle; * moving right from the space gives the prefix letter for each * increasing multiple of 1000 or 1024 - such as kilo, mega, giga - * and moving left from the space gives the prefix letter for each * decreasing multiple - such as milli, micro, nano. */ /* * Prefix list for multiples of 1000. */ if (NULL == pfx_000) { /*@-onlytrans@ */ pfx_000 = _("yzafpnum kMGTPEZY"); /* * splint: this is only looked up once in the program's run, * so the memory leak is negligible. */ /*@+onlytrans@ */ if (NULL == pfx_000) { debug("%s", "prefix list was NULL"); return; } pfx_middle_000 = strchr(pfx_000, ' '); } /* * Prefix list for multiples of 1024. */ if (NULL == pfx_024) { /*@-onlytrans@ */ pfx_024 = _("yzafpnum KMGTPEZY"); /*@+onlytrans@ *//* splint: see above. */ if (NULL == pfx_024) { debug("%s", "prefix list was NULL"); return; } pfx_middle_024 = strchr(pfx_024, ' '); } pfx = pfx_000; pfx_middle = pfx_middle_000; if (count_type == PV_TRANSFERCOUNT_BYTES) { /* bytes - multiples of 1024 */ pfx = pfx_024; pfx_middle = pfx_middle_024; } pfx_ptr = pfx_middle; if (NULL == pfx_ptr) { debug("%s", "prefix middle was NULL"); return; } /* * Force an empty prefix if the value is almost zero, to avoid * "0yB". NB we don't compare directly with zero because of * potential floating-point inaccuracies. * * See the "count_type" check below for the reason we add another * space in bytes mode. */ if ((*value > -0.00000001) && (*value < 0.00000001)) { if (count_type == PV_TRANSFERCOUNT_BYTES) { prefix[1] = ' '; prefix[2] = '\0'; } return; } /* * Cut-off for moving to the next prefix - a little less than the * ratio (970 for ratio=1000, 993 for ratio=1024). */ cutoff = ratio * 0.97; /* * Divide by the ratio until the value is a little below the ratio, * moving along the prefix list with each division to get the * associated prefix letter, so that for example 20000 becomes 20 * with a "k" (kilo) prefix. */ if (*value > 0) { /* Positive values */ while ((*value > cutoff) && (*(pfx_ptr += 1) != '\0')) { *value /= ratio; prefix[0] = *pfx_ptr; } } else { /* Negative values */ cutoff = 0 - cutoff; while ((*value < cutoff) && (*(pfx_ptr += 1) != '\0')) { *value /= ratio; prefix[0] = *pfx_ptr; } } /* * Multiply by the ratio until the value is at least 1, moving in * the other direction along the prefix list to get the associated * prefix letter - so for example a value of 0.5 becomes 500 with a * "m" (milli) prefix. */ if (*value > 0) { /* Positive values */ while ((*value < 1.0) && ((pfx_ptr -= 1) != (pfx - 1))) { *value *= ratio; prefix[0] = *pfx_ptr; } } else { /* Negative values */ while ((*value > -1.0) && ((pfx_ptr -= 1) != (pfx - 1))) { *value *= ratio; prefix[0] = *pfx_ptr; } } /* * Byte prefixes (kibi, mebi, etc) are of the form "KiB" rather than * "KB", so that's two characters, not one - meaning that for just * "B", the prefix is two spaces, not one. */ if (count_type == PV_TRANSFERCOUNT_BYTES) { prefix[1] = (prefix[0] == ' ' ? ' ' : 'i'); prefix[2] = '\0'; } } /* * Put a string in "buffer" (max length "bufsize") containing "amount" * formatted such that it's 3 or 4 digits followed by an SI suffix and then * whichever of "suffix_basic" or "suffix_bytes" is appropriate (whether * "count_type" is PV_TRANSFERTYPE_LINES for non-byte amounts or * PV_TRANSFERTYPE_BYTES for byte amounts). If "count_type" is * PV_TRANSFERTYPE_BYTES then the SI units are KiB, MiB etc and the divisor * is 1024 instead of 1000. * * The "format" string is in sprintf format and must contain exactly one % * parameter (a %s) which will expand to the string described above. */ void pv_describe_amount(char *buffer, size_t bufsize, char *format, long double amount, char *suffix_basic, char *suffix_bytes, pvtransfercount_t count_type) { char sizestr_buffer[256]; /* flawfinder: ignore */ char si_prefix[8]; /* flawfinder: ignore */ long double divider; long double display_amount; char *suffix; /* * flawfinder: sizestr_buffer and si_prefix are explicitly zeroed; * sizestr_buffer is only ever used with pv_snprintf() along with * its buffer size; si_prefix is only populated by pv_snprintf() * along with its size, and by pv_si_prefix() which explicitly only * needs 3 bytes. */ memset(sizestr_buffer, 0, sizeof(sizestr_buffer)); memset(si_prefix, 0, sizeof(si_prefix)); (void) pv_snprintf(si_prefix, sizeof(si_prefix), "%s", " "); if (count_type == PV_TRANSFERCOUNT_BYTES) { suffix = suffix_bytes; divider = 1024.0; } else if (count_type == PV_TRANSFERCOUNT_DECBYTES) { suffix = suffix_bytes; divider = 1000.0; } else { suffix = suffix_basic; divider = 1000.0; } display_amount = amount; pv_si_prefix(&display_amount, si_prefix, divider, count_type); /* Make sure we don't overrun our buffer. */ if (display_amount > 100000) display_amount = 100000; if (display_amount < -100000) display_amount = -100000; /* Fix for display of "1.01e+03" instead of "1010" */ if ((display_amount > 99.9) || (display_amount < -99.9)) { (void) pv_snprintf(sizestr_buffer, sizeof(sizestr_buffer), "%4ld%.2s%.16s", (long) display_amount, si_prefix, suffix); } else { /* * AIX blows up with %4.3Lg%.2s%.16s for some reason, so we * write display_amount separately first. */ char str_disp[64]; /* flawfinder: ignore - only used with pv_snprintf(). */ memset(str_disp, 0, sizeof(str_disp)); /* # to get 13.0GB instead of 13GB (#1477) */ (void) pv_snprintf(str_disp, sizeof(str_disp), "%#4.3Lg", display_amount); (void) pv_snprintf(sizestr_buffer, sizeof(sizestr_buffer), "%s%.2s%.16s", str_disp, si_prefix, suffix); } (void) pv_snprintf(buffer, bufsize, format, sizestr_buffer); } /* * Add a null-terminated string to the buffer if there is room for it, * updating the segment's offset and bytes values and returning the bytes * value, or treating the byte count as zero if there's insufficient space. */ pvdisplay_bytecount_t pv_formatter_segmentcontent(char *content, pvformatter_args_t formatter_info) { pvdisplay_bytecount_t bytes; bytes = strlen(content); /* flawfinder: ignore */ /* flawfinder - caller is required to null-terminate the string. */ if (formatter_info->offset >= formatter_info->buffer_size) bytes = 0; if ((formatter_info->offset + bytes) >= formatter_info->buffer_size) bytes = 0; formatter_info->segment->offset = formatter_info->offset; formatter_info->segment->bytes = bytes; if (0 == bytes) return 0; memmove(formatter_info->buffer + formatter_info->offset, content, bytes); return bytes; } /* * Format sequence lookup table. */ /*@keep@ */ static struct pvdisplay_component_s *pv__format_components(void) { /*@keep@ */ static struct pvdisplay_component_s format_component_array[] = { { "p", &pv_formatter_progress, true }, { "{progress}", &pv_formatter_progress, true }, { "{progress-amount-only}", &pv_formatter_progress_amount_only, false }, { "{progress-bar-only}", &pv_formatter_bar_default, true }, { "{bar-plain}", &pv_formatter_bar_plain, true }, { "{bar-block}", &pv_formatter_bar_block, true }, { "{bar-granular}", &pv_formatter_bar_granular, true }, { "{bar-shaded}", &pv_formatter_bar_shaded, true }, { "t", &pv_formatter_timer, false }, { "{timer}", &pv_formatter_timer, false }, { "e", &pv_formatter_eta, false }, { "{eta}", &pv_formatter_eta, false }, { "I", &pv_formatter_fineta, false }, { "{fineta}", &pv_formatter_fineta, false }, { "r", &pv_formatter_rate, false }, { "{rate}", &pv_formatter_rate, false }, { "a", &pv_formatter_average_rate, false }, { "{average-rate}", &pv_formatter_average_rate, false }, { "b", &pv_formatter_bytes, false }, { "{bytes}", &pv_formatter_bytes, false }, { "{transferred}", &pv_formatter_bytes, false }, { "T", &pv_formatter_buffer_percent, false }, { "{buffer-percent}", &pv_formatter_buffer_percent, false }, { "A", &pv_formatter_last_written, false }, { "{last-written}", &pv_formatter_last_written, false }, { "L", &pv_formatter_previous_line, true }, { "{previous-line}", &pv_formatter_previous_line, true }, { "N", &pv_formatter_name, false }, { "{name}", &pv_formatter_name, false }, { "{sgr:colour,...}", &pv_formatter_sgr, false }, { NULL, NULL, false } }; return format_component_array; } /* * Return a pointer to a malloc()ed string containing a space-separated list * of all supported format sequences. The caller should free() it. */ /*@null@ */ char *pv_format_sequences(void) { size_t component_idx, buffer_size, offset; struct pvdisplay_component_s *format_component_array; char *buffer; format_component_array = pv__format_components(); buffer_size = 0; for (component_idx = 0; NULL != format_component_array[component_idx].match; component_idx++) { size_t component_sequence_length = strlen(format_component_array[component_idx].match); /* flawfinder: ignore */ /* flawfinder - static strings, guaranteed null-terminated. */ buffer_size += 2 + component_sequence_length; /* 2 for '%' + ' ' */ } buffer = malloc(buffer_size + 1); if (NULL == buffer) return NULL; offset = 0; for (component_idx = 0; NULL != format_component_array[component_idx].match; component_idx++) { size_t component_sequence_length = strlen(format_component_array[component_idx].match); /* flawfinder: ignore - as above */ if (0 != offset) buffer[offset++] = ' '; buffer[offset++] = '%'; memmove(buffer + offset, format_component_array[component_idx].match, component_sequence_length); offset += component_sequence_length; } buffer[offset] = '\0'; return buffer; } /* * Initialise the output format structure, based on the current options. */ static void pv__format_init(pvstate_t state, /*@null@ */ const char *format_supplied, pvdisplay_t display) { struct pvdisplay_component_s *format_component_array; const char *display_format; size_t strpos; size_t segment; if (NULL == state) return; if (NULL == display) return; format_component_array = pv__format_components(); display->format_segment_count = 0; memset(display->format, 0, PV_FORMAT_ARRAY_MAX * sizeof(display->format[0])); display->showing_timer = false; display->showing_bytes = false; display->showing_rate = false; display->showing_last_written = false; display->showing_previous_line = false; display->format_uses_colour = false; display_format = NULL == format_supplied ? state->control.default_format : format_supplied; if (NULL == display_format) return; /* * Split the format string into static strings and calculated * components - a calculated component is is what replaces a * placeholder sequence like "%b". * * A "static string" is part of the original format string that is * copied to the display verbatim. Its width is calculated here. * * Each segment's contents are stored in either the format string * (if a static string) or an internal temporary buffer, starting at * "offset" and extending for "bytes" bytes. * * Later, in pv_format(), segments whose components are dynamic and * which aren't constrained to a fixed size are calculated after * first populating all the other components referenced by the * format segments. * * Then, that function generates the output string by sticking all * of these segments together. */ segment = 0; for (strpos = 0; display_format[strpos] != '\0' && segment < PV_FORMAT_ARRAY_MAX; strpos++, segment++) { pvdisplay_component_t component_type, component_idx; size_t str_start, str_bytes, chosen_size; const char *string_parameter = NULL; size_t string_parameter_bytes = 0; str_start = strpos; str_bytes = 0; chosen_size = 0; if ('%' == display_format[strpos]) { unsigned long number_prefix; size_t percent_sign_offset, sequence_start, sequence_length, sequence_colon_offset; #if HAVE_STRTOUL char *number_end_ptr; #endif percent_sign_offset = strpos; strpos++; /* * Check for a numeric prefix between the % and the * format character - currently only used with "%A" * and "%L". */ #if HAVE_STRTOUL number_end_ptr = NULL; number_prefix = strtoul(&(display_format[strpos]), &number_end_ptr, 10); if ((NULL == number_end_ptr) || (number_end_ptr[0] == '\0')) { number_prefix = 0; } else if (number_end_ptr > &(display_format[strpos])) { strpos += (number_end_ptr - &(display_format[strpos])); } #else /* !HAVE_STRTOUL */ while (pv_isdigit(display_format[strpos])) { number_prefix = number_prefix * 10; number_prefix += display_format[strpos] - '0'; strpos++; } #endif /* !HAVE_STRTOUL */ sequence_start = strpos; sequence_length = 0; sequence_colon_offset = 0; if ('\0' != display_format[strpos]) sequence_length = 1; if ('{' == display_format[strpos]) { while ('\0' != display_format[strpos] && '}' != display_format[strpos] && '%' != display_format[strpos]) { if (':' == display_format[strpos]) sequence_colon_offset = sequence_length; strpos++; sequence_length++; } } component_type = -1; for (component_idx = 0; NULL != format_component_array[component_idx].match; component_idx++) { size_t component_sequence_length = strlen(format_component_array[component_idx].match); /* flawfinder: ignore */ char *component_colon_pointer = strchr(format_component_array[component_idx].match, (int) ':'); /* flawfinder - static strings, guaranteed null-terminated. */ if ((component_sequence_length == sequence_length) && (0 == strncmp(format_component_array[component_idx].match, &(display_format[sequence_start]), sequence_length)) ) { component_type = component_idx; break; } if (sequence_colon_offset > 0 && NULL != component_colon_pointer) { size_t component_colon_offset = (size_t) (1 + component_colon_pointer - format_component_array[component_idx].match); if ((component_colon_offset == sequence_colon_offset) && (0 == strncmp(format_component_array[component_idx].match, &(display_format[sequence_start]), sequence_colon_offset)) ) { component_type = component_idx; string_parameter = &(display_format[sequence_start + sequence_colon_offset]); string_parameter_bytes = sequence_length - sequence_colon_offset; if (string_parameter_bytes > 0) string_parameter_bytes--; /* the closing '}' */ if (string_parameter_bytes > PVDISPLAY_BYTECOUNT_MAX) string_parameter_bytes = PVDISPLAY_BYTECOUNT_MAX; break; } } } if (-1 == component_type) { /* Unknown sequence - pass it through verbatim. */ str_start = percent_sign_offset; str_bytes = sequence_length + sequence_start - percent_sign_offset; if (2 == str_bytes && '%' == display_format[percent_sign_offset + 1]) { /* Special case: "%%" => "%". */ str_bytes = 1; } else if (str_bytes > 1 && '%' == display_format[strpos]) { /* Special case: "%{foo%p" => "%{foo" and go back one. */ str_bytes--; strpos--; } else if (str_bytes == 0 && '\0' == display_format[strpos]) { /* Special case: "%" at end of string = "%". */ str_bytes = 1; } } else { chosen_size = (size_t) number_prefix; } } else { const char *searchptr; int foundlength; searchptr = strchr(&(display_format[strpos]), '%'); if (NULL == searchptr) { foundlength = (int) strlen(&(display_format[strpos])); /* flawfinder: ignore */ /* flawfinder: display_format is explicitly \0-terminated. */ } else { foundlength = searchptr - &(display_format[strpos]); } component_type = -1; str_start = strpos; str_bytes = (size_t) foundlength; strpos += foundlength - 1; } if (chosen_size > PVDISPLAY_WIDTH_MAX) chosen_size = PVDISPLAY_WIDTH_MAX; display->format[segment].type = component_type; display->format[segment].chosen_size = chosen_size; display->format[segment].string_parameter = string_parameter; display->format[segment].string_parameter_bytes = string_parameter_bytes; if (-1 == component_type) { if (0 == str_bytes) continue; display->format[segment].offset = str_start; display->format[segment].bytes = str_bytes; display->format[segment].width = pv_strwidth(&(display_format[str_start]), str_bytes); debug("format[%d]:[%.*s], length=%d, width=%d", segment, str_bytes, display_format + str_start, str_bytes, display->format[segment].width); } else { char dummy_buffer[4]; /* flawfinder: ignore - unused. */ struct pvformatter_args_s formatter_info; display->format[segment].offset = 0; display->format[segment].bytes = 0; /* * Run the formatter function with a zero-sized * buffer, to invoke its side effects such as * setting display->showing_timer. * * These side effects are required for other parts * of the program to understand what is required, * such as the transfer functions knowning to track * the previous line, or numeric mode knowing which * additional display options are enabled. */ memset(&formatter_info, 0, sizeof(formatter_info)); dummy_buffer[0] = '\0'; formatter_info.state = state; formatter_info.display = display; formatter_info.segment = &(display->format[segment]); formatter_info.buffer = dummy_buffer; formatter_info.buffer_size = 0; formatter_info.offset = 0; /*@-compmempass@ */ (void) format_component_array[component_type].function(&formatter_info); /*@+compmempass@ */ /* * splint - the buffer we point formatter_info to is * on the stack so doesn't match the "dependent" * annotation, but there's no other appropriate * annotation that doesn't make splint think there's * a leak here. */ } display->format_segment_count++; } if (display->format_uses_colour && !state->control.checked_colour_support) { state->control.checked_colour_support = true; #ifdef ENABLE_NCURSES /* * If we have terminal info support, check whether the * current terminal supports colour - or just assume it's * supported if we're forcing output. */ if (true == state->control.force) { state->control.can_display_colour = true; debug("%s", "force mode - assuming terminal supports colour"); } else { char *term_env = NULL; term_env = getenv("TERM"); /* flawfinder: ignore */ /* * flawfinder - here we pass responsibility to the * ncurses library to behave OK with $TERM. */ state->control.can_display_colour = false; if (NULL != term_env) { int setup_err = 0; if ((0 == setupterm(term_env, STDERR_FILENO, &setup_err)) && (tigetnum("colors") > 1) ) { state->control.can_display_colour = true; debug("%s: %s", term_env, "terminal supports colour"); } else { state->control.can_display_colour = false; debug("%s: %s", term_env, "terminal does not support colour"); } } else { /* If TERM is unset, disable colour. */ state->control.can_display_colour = false; debug("%s", "no TERM variable - disabling colour support"); } } #else /* ! ENABLE_NCURSES */ #ifdef USE_POPEN_TPUTS /* (! ENABLE_NCURSES) && (USE_POPEN_TPUTS) */ /* * Without terminal info support, try running "tput colors" * to determine whether colour is available, unless --force * was supplied, in which case colour support is assumed. */ if (true == state->control.force) { state->control.can_display_colour = true; debug("%s", "force mode - assuming terminal supports colour"); } else { FILE *command_fptr; /*@-unrecog@ *//* splint doesn't know popen(). */ command_fptr = popen("tput colors 2>/dev/null", "r"); /* flawfinder: ignore */ /*@+unrecog@ */ /* * flawfinder - we acknowledge that popen() is risky * to call, though we have the mitigation that we're * calling it with a static string. */ if (NULL == command_fptr) { state->control.can_display_colour = false; debug("%s (%s)", "popen failed - disabling colour support", strerror(errno)); } else { int colour_count; if (1 == fscanf(command_fptr, "%d", &colour_count)) { if (colour_count > 1) { state->control.can_display_colour = true; debug("%s (%d)", "terminal supports colour", colour_count); } else { state->control.can_display_colour = false; debug("%s (%d)", "fewer than 2 colours available - disabling colour support"); } } else { state->control.can_display_colour = false; debug("%s", "tput did not produce a number - disabling colour support"); } /*@-unrecog@ *//* splint doesn't know pclose(). */ (void) pclose(command_fptr); /*@+unrecog@ */ } } #else /* (! ENABLE_NCURSES) && (! USE_POPEN_TPUTS) */ /* * Without terminal info support, just assume colour is * available. */ state->control.can_display_colour = true; debug("%s", "terminal info support not compiled in - assuming colour support"); #endif /* (! ENABLE_NCURSES) && (! USE_POPEN_TPUTS) */ #endif /* ! ENABLE_NCURSES */ } } /* * Update display->display_buffer with status information formatted * according to the state held within the given structure. * * If "reinitialise" is true, the format string is reparsed first. This * should be true for the first call, and true whenever the format is * changed. * * If "final" is true, this is the final update so the rate is given as an * an average over the whole transfer; otherwise the current rate is shown. * * Returns true if the display buffer can be used, false if not. * * When returning true, this function will have also set * display->display_string_len to the length of the string in * display->display_buffer, in bytes. */ bool pv_format(pvstate_t state, /*@null@ */ const char *format_supplied, pvdisplay_t display, bool reinitialise, bool final) { struct pvdisplay_component_s *format_component_array; char display_segments[PV_SIZEOF_FORMAT_SEGMENTS_BUF]; /* flawfinder: ignore - always bounded */ size_t segment_idx, dynamic_segment_count; const char *display_format; size_t static_portion_width, dynamic_segment_width; size_t display_buffer_offset, display_buffer_remaining; size_t new_display_string_bytes, new_display_string_width; struct pvformatter_args_s formatter_info; memset(&formatter_info, 0, sizeof(formatter_info)); display_segments[0] = '\0'; /* Quick safety check - state and display must exist. */ if (NULL == state) return false; if (NULL == display) return false; formatter_info.state = state; formatter_info.display = display; formatter_info.buffer = display_segments; formatter_info.buffer_size = sizeof(display_segments); formatter_info.offset = 0; format_component_array = pv__format_components(); /* Populate the display's "final" flag, for formatters. */ display->final_update = final; /* Reinitialise if we were asked to. */ if (reinitialise) pv__format_init(state, format_supplied, display); /* The format string is needed for the static segments. */ display_format = NULL == format_supplied ? state->control.default_format : format_supplied; if (NULL == display_format) return false; /* Determine the type of thing being counted for transfer, rate, etc. */ display->count_type = PV_TRANSFERCOUNT_BYTES; if (state->control.linemode) display->count_type = PV_TRANSFERCOUNT_LINES; else if (state->control.decimal_units) display->count_type = PV_TRANSFERCOUNT_DECBYTES; /* * Reallocate the output buffer if the display width changes. */ if (display->display_buffer != NULL && display->display_buffer_size < (size_t) ((state->control.width * 4))) { free(display->display_buffer); display->display_buffer = NULL; display->display_buffer_size = 0; } /* * Allocate output buffer if there isn't one. */ if (NULL == display->display_buffer) { char *new_buffer; size_t new_size; new_size = (size_t) ((4 * state->control.width) + 80); if (NULL != state->control.name) new_size += strlen(state->control.name); /* flawfinder: ignore */ /* flawfinder: name is always set by pv_strdup(), which bounds with a \0. */ new_buffer = malloc(new_size + 16); if (NULL == new_buffer) { pv_error(state, "%s: %s", _("buffer allocation failed"), strerror(errno)); state->status.exit_status |= PV_ERROREXIT_MEMORY; display->display_buffer = NULL; return false; } display->display_buffer = new_buffer; display->display_buffer_size = new_size; display->display_buffer[0] = '\0'; } /* Clear the SGR active codes flag, for the SGR formatter. */ display->sgr_code_active = false; /* * Populate the internal segments buffer with each component's * output, in two passes. */ /* First pass - all components with a fixed width. */ static_portion_width = 0; dynamic_segment_count = 0; for (segment_idx = 0; segment_idx < display->format_segment_count; segment_idx++) { pvdisplay_segment_t segment; struct pvdisplay_component_s *component; size_t bytes_added; bool fixed_width; segment = &(display->format[segment_idx]); if (-1 == segment->type) { static_portion_width += segment->width; continue; } component = &(format_component_array[segment->type]); fixed_width = true; if (component->dynamic && 0 == segment->chosen_size) fixed_width = false; if (!fixed_width) { dynamic_segment_count++; continue; } segment->width = segment->chosen_size; formatter_info.segment = segment; /*@-compmempass@ */ bytes_added = component->function(&formatter_info); /*@+compmempass@ *//* see previous ->function() note. */ segment->width = 0; if (bytes_added > 0) { segment->width = pv_strwidth(&(display_segments[formatter_info.offset]), bytes_added); } formatter_info.offset += bytes_added; static_portion_width += segment->width; } /* * Second pass, now the remaining width is known - all components * with a dynamic width. */ dynamic_segment_width = 0; if (state->control.width > static_portion_width) dynamic_segment_width = state->control.width - static_portion_width; /* * Divide the total remaining screen space by the number of dynamic * segments, so that multiple dynamic segments will share the space. */ if (dynamic_segment_count > 1) dynamic_segment_width /= dynamic_segment_count; debug("control.width=%d static_portion_width=%d dynamic_segment_width=%d dynamic_segment_count=%d", state->control.width, static_portion_width, dynamic_segment_width, dynamic_segment_count); for (segment_idx = 0; segment_idx < display->format_segment_count; segment_idx++) { pvdisplay_segment_t segment; struct pvdisplay_component_s *component; size_t bytes_added; bool fixed_width; segment = &(display->format[segment_idx]); if (-1 == segment->type) { static_portion_width += segment->width; continue; } component = &(format_component_array[segment->type]); fixed_width = true; if (component->dynamic && 0 == segment->chosen_size) fixed_width = false; if (fixed_width) continue; segment->width = dynamic_segment_width; formatter_info.segment = segment; /*@-compmempass@ */ bytes_added = component->function(&formatter_info); /*@+compmempass@ *//* see earlier ->function() note. */ formatter_info.offset += bytes_added; } /* * Populate the display buffer from the segments. */ memset(display->display_buffer, 0, display->display_buffer_size); display_buffer_offset = 0; display_buffer_remaining = display->display_buffer_size - 1; new_display_string_bytes = 0; new_display_string_width = 0; for (segment_idx = 0; segment_idx < display->format_segment_count; segment_idx++) { pvdisplay_segment_t segment; const char *content_buffer = display_format; segment = &(display->format[segment_idx]); if (0 == segment->bytes) continue; if (segment->bytes > display_buffer_remaining) continue; if (-1 == segment->type) { content_buffer = display_format; } else { content_buffer = display_segments; } memmove(display->display_buffer + display_buffer_offset, content_buffer + segment->offset, segment->bytes); display_buffer_offset += segment->bytes; display_buffer_remaining -= segment->bytes; new_display_string_bytes += segment->bytes; new_display_string_width += segment->width; debug("segment[%d]: bytes=%d, width=%d: [%.*s]", segment_idx, segment->bytes, segment->width, segment->bytes, display->display_buffer + display_buffer_offset - segment->bytes); } /* If the SGR active codes flag is set, we need to emit an SGR reset. */ if (display->sgr_code_active) { debug("%s", "SGR codes still active - adding reset"); (void) pv_strlcat(display->display_buffer, "\033[m", display->display_buffer_size); new_display_string_bytes += 3; if (new_display_string_bytes > display->display_buffer_size) new_display_string_bytes = display->display_buffer_size; display->sgr_code_active = false; } debug("%s: %d", "new display string length in bytes", (int) new_display_string_bytes); debug("%s: %d", "new display string width", (int) new_display_string_width); /* * If the width of our output shrinks, we need to keep appending * spaces at the end, so that we don't leave dangling bits behind. */ if ((new_display_string_width < display->display_string_width) && (state->control.width >= display->prev_screen_width)) { char spaces[32]; /* flawfinder: ignore - terminated, bounded */ int spaces_to_add; spaces_to_add = (int) (display->display_string_width - new_display_string_width); /* Upper boundary on number of spaces */ if (spaces_to_add > 15) { spaces_to_add = 15; } new_display_string_bytes += spaces_to_add; new_display_string_width += spaces_to_add; spaces[spaces_to_add] = '\0'; while (--spaces_to_add >= 0) { spaces[spaces_to_add] = ' '; } (void) pv_strlcat(display->display_buffer, spaces, display->display_buffer_size); } display->display_string_bytes = new_display_string_bytes; display->display_string_width = new_display_string_width; display->prev_screen_width = state->control.width; return true; } /* * Output status information on standard error. * * If "final" is true, this is the final update, so the rate is given as an * an average over the whole transfer; otherwise the current rate is shown. */ void pv_display(pvstate_t state, bool final) { bool reinitialise = false; if (NULL == state) return; pv_sig_checkbg(); pv_calculate_transfer_rate(state, final); /* * Enable colour on the main display, and disable it on the extra * display (process title, window title). */ state->display.colour_permitted = true; state->extra_display.colour_permitted = false; /* * If the display options need reparsing, do so to generate new * formatting parameters. */ if (0 != state->flag.reparse_display) { reinitialise = true; state->flag.reparse_display = 0; } if (!pv_format(state, state->control.format_string, &(state->display), reinitialise, final)) return; if (0 != state->control.extra_displays) { if (!pv_format(state, state->control.extra_format_string, &(state->extra_display), reinitialise, final)) return; } if (NULL == state->display.display_buffer) return; if (state->control.numeric) { pv_tty_write(state, state->display.display_buffer, state->display.display_string_bytes); pv_tty_write(state, "\n", 1); } else if (state->control.cursor) { if (state->control.force || pv_in_foreground()) { pv_crs_update(state, state->display.display_buffer); state->display.display_visible = true; } } else { if (state->control.force || pv_in_foreground()) { pv_tty_write(state, state->display.display_buffer, state->display.display_string_bytes); pv_tty_write(state, "\r", 1); state->display.display_visible = true; } } debug("%s: [%s]", "display", state->display.display_buffer); if ((0 != (PV_DISPLAY_WINDOWTITLE & state->control.extra_displays)) && (state->control.force || pv_in_foreground()) && (NULL != state->extra_display.display_buffer) ) { pv_tty_write(state, "\033]2;", 4); pv_tty_write(state, state->extra_display.display_buffer, state->extra_display.display_string_bytes); pv_tty_write(state, "\033\\", 2); state->extra_display.display_visible = true; debug("%s: [%s]", "windowtitle display", state->extra_display.display_buffer); } if ((0 != (PV_DISPLAY_PROCESSTITLE & state->control.extra_displays)) && (NULL != state->extra_display.display_buffer) ) { setproctitle("%s", state->extra_display.display_buffer); state->extra_display.display_visible = true; debug("%s: [%s]", "processtitle display", state->extra_display.display_buffer); } } pv-1.9.31/src/pv/elapsedtime.c000066400000000000000000000134261474702661500161300ustar00rootroot00000000000000/* * Functions relating to elapsed time. * * Copyright 2023-2025 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #include "config.h" #include "pv.h" #include "pv-internal.h" #include #include #include /* * Read the current elapsed time, relative to an unspecified point in the * past, and store it in the given timespec buffer. The time is guaranteed * to not go backwards and does not count time when the system was * suspended. See clock_gettime(2) with CLOCK_MONOTONIC. * * The read should not fail; if it does, the program is aborted with exit * status 16 (transfer error). */ void pv_elapsedtime_read(struct timespec *return_time) { /*@-unrecog@ *//* splint doesn't know clock_gettime */ if (0 != clock_gettime(CLOCK_MONOTONIC, return_time)) { fprintf(stderr, "%s: %s: %s\n", PACKAGE_NAME, "clock_gettime", strerror(errno)); /*@-exitarg@ *//* we explicitly want a special exit status */ exit(PV_ERROREXIT_TRANSFER); /*@+exitarg@ */ } /*@+unrecog@ */ } /* * Set the time in the given timespec to zero. */ void pv_elapsedtime_zero(struct timespec *zero_time) { if (NULL == zero_time) return; zero_time->tv_sec = 0; zero_time->tv_nsec = 0; } /* * Copy source_time into dest_time. Analogous to strcpy(3). */ void pv_elapsedtime_copy(struct timespec *dest_time, const struct timespec *source_time) { if (NULL == dest_time) return; if (NULL == source_time) return; dest_time->tv_sec = source_time->tv_sec; dest_time->tv_nsec = source_time->tv_nsec; } /* * Return -1, 0, or 1 depending on whether the first time is earlier than, * equal to, or later than the second time. Analogous to strcmp(3). */ int pv_elapsedtime_compare(const struct timespec *first_time, const struct timespec *second_time) { /* Treat NULL as a zero time. */ if ((NULL == first_time) && (NULL == second_time)) return 0; if ((NULL == first_time) && (NULL != second_time)) return -1; if ((NULL != first_time) && (NULL == second_time)) return 1; /* These should never happen, but check just in case. */ if (NULL == first_time) return 0; if (NULL == second_time) return 0; /* Check the seconds part, first */ if (first_time->tv_sec < second_time->tv_sec) return -1; if (first_time->tv_sec > second_time->tv_sec) return 1; /* Seconds are equal - compare nanoseconds. */ if (first_time->tv_nsec < second_time->tv_nsec) return -1; if (first_time->tv_nsec > second_time->tv_nsec) return 1; /* Nanoseconds are also equal - times are equal. */ return 0; } /* * Add first_time and second_time, writing the result to return_time. */ void pv_elapsedtime_add(struct timespec *return_time, const struct timespec *first_time, const struct timespec *second_time) { long long seconds, nanoseconds; if (NULL == return_time) return; seconds = 0; nanoseconds = 0; if (NULL != first_time) { seconds += first_time->tv_sec; nanoseconds += first_time->tv_nsec; } if (NULL != second_time) { seconds += second_time->tv_sec; nanoseconds += second_time->tv_nsec; } seconds += nanoseconds / 1000000000; nanoseconds = nanoseconds % 1000000000; /*@-type@ */ return_time->tv_sec = seconds; return_time->tv_nsec = nanoseconds; /*@+type@ */ /* * splint rationale: we know the types are different but should be * large enough and are relying on the compiler to do the casting * correctly, since the manual for timespec(3) states the types are * implementation-defined. */ } /* * Add a number of nanoseconds to the given timespec. */ void pv_elapsedtime_add_nsec(struct timespec *return_time, long long add_nanoseconds) { long long seconds, nanoseconds; if (NULL == return_time) return; seconds = return_time->tv_sec; nanoseconds = return_time->tv_nsec + add_nanoseconds; seconds += nanoseconds / 1000000000; nanoseconds = nanoseconds % 1000000000; /*@-type@ *//* see above */ return_time->tv_sec = seconds; return_time->tv_nsec = nanoseconds; /*@+type@ */ } /* * Set the return timespec to the first time minus the second time. */ void pv_elapsedtime_subtract(struct timespec *return_time, const struct timespec *first_time, const struct timespec *second_time) { long long seconds, nanoseconds; if (NULL == return_time) return; seconds = 0; nanoseconds = 0; if (NULL != first_time) { seconds += first_time->tv_sec; nanoseconds += first_time->tv_nsec; } if (NULL != second_time) { seconds -= second_time->tv_sec; nanoseconds -= second_time->tv_nsec; } seconds += nanoseconds / 1000000000; nanoseconds = nanoseconds % 1000000000; if (nanoseconds < 0) { seconds--; nanoseconds = 1000000000 + nanoseconds; } /*@-type@ *//* see above */ return_time->tv_sec = seconds; return_time->tv_nsec = nanoseconds; /*@+type@ */ } /* * Convert a timespec to seconds. */ long double pv_elapsedtime_seconds(const struct timespec *elapsed_time) { long double seconds; if (NULL == elapsed_time) return 0.0; seconds = (long double) elapsed_time->tv_sec; seconds += (long double) (elapsed_time->tv_nsec) / 1000000000.0L; return seconds; } /* * Sleep for a number of nanoseconds. */ void pv_nanosleep(long long nanoseconds) { #if HAVE_NANOSLEEP struct timespec sleep_for, time_remaining; memset(&sleep_for, 0, sizeof(sleep_for)); memset(&time_remaining, 0, sizeof(time_remaining)); sleep_for.tv_sec = 0; /*@-type@ */ sleep_for.tv_nsec = nanoseconds; /*@+type@ *//* splint rationale - best effort */ /*@-unrecog@ */ (void) nanosleep(&sleep_for, &time_remaining); /*@+unrecog@ *//* splint rationale - doesn't know of nanosleep() */ #else struct timeval tv; tv.tv_sec = 0; /*@-type@ */ tv.tv_usec = nanoseconds / 1000; /*@+type@ *//* splint rationale - best effort */ /*@-null@ */ (void) select(0, NULL, NULL, NULL, &tv); /*@+null@ *//* splint doesn't know about select() */ #endif } pv-1.9.31/src/pv/file.c000066400000000000000000000303631474702661500145520ustar00rootroot00000000000000/* * Functions for opening and closing files, and calculating their size. * * Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2025 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #include "config.h" #include "pv.h" #include "pv-internal.h" #include #include #include #include #include #include #include #include /*@-type@*/ /* splint has trouble with off_t and mode_t throughout this file. */ /* * Calculate the total number of bytes to be transferred by adding up the * sizes of all input files. If any of the input files are of indeterminate * size (such as if they are a pipe), the total size is set to zero. * * Any files that cannot be stat()ed or that access() says we can't read * will be skipped, and the total size will be set to zero. * * Returns the total size, or 0 if it is unknown. */ static off_t pv_calc_total_bytes(pvstate_t state) { off_t total; struct stat sb; unsigned int file_idx; total = 0; memset(&sb, 0, sizeof(sb)); /* * No files specified - check stdin. */ if ((state->files.file_count < 1) || (NULL == state->files.filename)) { if (0 == fstat(STDIN_FILENO, &sb)) total = sb.st_size; return total; } for (file_idx = 0; file_idx < state->files.file_count; file_idx++) { int rc; if (0 == strcmp(state->files.filename[file_idx], "-")) { rc = fstat(STDIN_FILENO, &sb); if (rc != 0) { total = 0; return total; } } else { rc = stat(state->files.filename[file_idx], &sb); if (0 == rc) { rc = access(state->files.filename[file_idx], R_OK); /* flawfinder: ignore */ /* * flawfinder rationale: we're not really * using access() to do permissions checks, * but to zero the total if we might be * unable to read the file later, so if an * attacker redirected one of the input * files in between this part and the actual * reading, the outcome would be that the * total byte count would be wrong or * missing, nothing useful. */ } } if (rc != 0) { debug("%s: %s", state->files.filename[file_idx], strerror(errno)); total = 0; return total; } if (S_ISBLK(sb.st_mode)) { int fd; /* * Get the size of block devices by opening * them and seeking to the end. */ if (0 == strcmp(state->files.filename[file_idx], "-")) { fd = open("/dev/stdin", O_RDONLY); /* flawfinder: ignore */ /* * flawfinder rationale: "/dev/stdin" may be * a symlink, so can't use O_NOFOLLOW, and * so we have to assume that it being under * "/dev" means the path is less likely to * be under the control of someone else. */ } else { fd = open(state->files.filename[file_idx], O_RDONLY); /* flawfinder: ignore */ /* flawfinder - see last open() below. */ } if (fd >= 0) { off_t end_position; end_position = lseek(fd, 0, SEEK_END); if (end_position > 0) { total += end_position; } (void) close(fd); } else { total = 0; return total; } } else if (S_ISREG(sb.st_mode)) { total += sb.st_size; } else { total = 0; } } /* * Patch from Peter Samuelson: if we cannot work out the size of the * input, but we are writing to a block device, then use the size of * the output block device. * * Further modified to check that output is not in append-only mode * and that we can seek back to the start after getting the size. */ if (total < 1) { int rc; rc = fstat(state->control.output_fd, &sb); if ((0 == rc) && S_ISBLK(sb.st_mode) && (0 == (fcntl(state->control.output_fd, F_GETFL) & O_APPEND))) { off_t end_position; end_position = lseek(state->control.output_fd, 0, SEEK_END); total = 0; if (end_position > 0) { total = end_position; } if (lseek(state->control.output_fd, 0, SEEK_SET) != 0) { pv_error(state, "%s: %s: %s", NULL == state->control.output_name ? "(null)" : state->control.output_name, _("failed to seek to start of output"), strerror(errno)); state->status.exit_status |= PV_ERROREXIT_ACCESS; } /* * If we worked out a size, then set the * stop-at-size flag to prevent a "no space left on * device" error when we reach the end of the output * device. */ if (total > 0) { state->control.stop_at_size = true; } } } return total; } /* * Count the total number of lines to be transferred by reading through all * input files. If any of the inputs are not regular files (such as if they * are a pipe or a block device), the total size is set to zero. * * Any files that cannot be stat()ed or that access() says we can't read * will be skipped, and the total size will be set to zero. * * Returns the total size, or 0 if it is unknown. */ static off_t pv_calc_total_lines(pvstate_t state) { off_t total; struct stat sb; unsigned int file_idx; total = 0; for (file_idx = 0; file_idx < state->files.file_count && NULL != state->files.filename; file_idx++) { int fd = -1; int rc = 0; if (0 == strcmp(state->files.filename[file_idx], "-")) { rc = fstat(STDIN_FILENO, &sb); if ((rc != 0) || (!S_ISREG(sb.st_mode))) { total = 0; return total; } fd = dup(STDIN_FILENO); } else { rc = stat(state->files.filename[file_idx], &sb); if ((rc != 0) || (!S_ISREG(sb.st_mode))) { total = 0; return total; } fd = open(state->files.filename[file_idx], O_RDONLY); /* flawfinder: ignore */ /* flawfinder - see last open() below. */ } if (fd < 0) { debug("%s: %s", state->files.filename[file_idx], strerror(errno)); total = 0; return total; } #if HAVE_POSIX_FADVISE /* Advise the OS that we will only be reading sequentially. */ (void) posix_fadvise(fd, 0, 0, POSIX_FADV_SEQUENTIAL); #endif while (true) { char scanbuf[1024]; /* flawfinder: ignore */ ssize_t numread, buf_idx; /* flawfinder - always bounded, below. */ numread = read(fd, scanbuf, sizeof(scanbuf)); /* flawfinder: ignore */ /* * flawfinder rationale: each time around the loop * we are always reading into the start of the * buffer, not moving along it, so the bounding is * OK. */ if (numread < 0) { pv_error(state, "%s: %s", state->files.filename[file_idx], strerror(errno)); state->status.exit_status |= PV_ERROREXIT_ACCESS; break; } else if (0 == numread) { break; } for (buf_idx = 0; buf_idx < numread; buf_idx++) { if (state->control.null_terminated_lines) { if ('\0' == scanbuf[buf_idx]) total++; } else { if ('\n' == scanbuf[buf_idx]) total++; } } } if (0 != lseek(fd, 0, SEEK_SET)) { pv_error(state, "%s: %s", state->files.filename[file_idx], strerror(errno)); state->status.exit_status |= PV_ERROREXIT_ACCESS; } (void) close(fd); } return total; } /* * Work out the total size of all data by adding up the sizes of all input * files, using either pv_calc_total_bytes() or pv_calc_total_lines() * depending on whether state->control.linemode is true. * * Returns the total size, or 0 if it is unknown. */ off_t pv_calc_total_size(pvstate_t state) { if (state->control.linemode) { return pv_calc_total_lines(state); } else { return pv_calc_total_bytes(state); } } /* * Close the given file descriptor and open the next one, whose number in * the list is "filenum", returning the new file descriptor (or negative on * error). It is an error if the next input file is the same as the file * the output is pointing to. * * Updates state->status.current_input_file in the process. */ int pv_next_file(pvstate_t state, unsigned int filenum, int oldfd) { struct stat isb; struct stat osb; int fd; bool input_file_is_output; if (oldfd >= 0) { if (0 != close(oldfd)) { pv_error(state, "%s: %s", _("failed to close file"), strerror(errno)); state->status.exit_status |= PV_ERROREXIT_TRANSITION; return -1; } } if (filenum >= state->files.file_count) { debug("%s: %d >= %d", "filenum too large", filenum, state->files.file_count); state->status.exit_status |= PV_ERROREXIT_TRANSITION; return -1; } if ((NULL == state->files.filename) || (0 == strcmp(state->files.filename[filenum], "-"))) { fd = STDIN_FILENO; } else { fd = open(state->files.filename[filenum], O_RDONLY); /* flawfinder: ignore */ /* * flawfinder rationale: the input file list is under the * control of the operator by its nature, so we can't refuse * to open symlinks etc as that would be counterintuitive. */ if (fd < 0) { pv_error(state, "%s: %s: %s", _("failed to read file"), state->files.filename[filenum], strerror(errno)); state->status.exit_status |= PV_ERROREXIT_ACCESS; return -1; } } if (0 != fstat(fd, &isb)) { pv_error(state, "%s: %s: %s", _("failed to stat file"), NULL == state->files.filename ? "-" : state->files.filename[filenum], strerror(errno)); (void) close(fd); state->status.exit_status |= PV_ERROREXIT_ACCESS; return -1; } if (0 != fstat(state->control.output_fd, &osb)) { pv_error(state, "%s: %s", _("failed to stat output file"), strerror(errno)); (void) close(fd); state->status.exit_status |= PV_ERROREXIT_ACCESS; return -1; } /* * Check that this new input file is not the same as output's * destination. This restriction is ignored for anything other * than a regular file or block device. */ input_file_is_output = true; if (isb.st_dev != osb.st_dev) input_file_is_output = false; if (isb.st_ino != osb.st_ino) input_file_is_output = false; if (0 != isatty(fd)) input_file_is_output = false; if ((!S_ISREG(isb.st_mode)) && (!S_ISBLK(isb.st_mode))) input_file_is_output = false; if (input_file_is_output) { pv_error(state, "%s: %s", _("input file is output file"), NULL == state->files.filename ? "-" : state->files.filename[filenum]); (void) close(fd); state->status.exit_status |= PV_ERROREXIT_OUROBOROS; return -1; } state->status.current_input_file = filenum; #ifdef O_DIRECT /* * Set or clear O_DIRECT on the file descriptor. */ if (0 != fcntl(fd, F_SETFL, (state->control.direct_io ? O_DIRECT : 0) | fcntl(fd, F_GETFL))) { /*@-compdef@ */ /* * splint - passed or returned storage is undefined - but at * this point we know the input file list is been populated, * so that's OK. */ debug("%s: %s: %s", pv_current_file_name(state), "fcntl", strerror(errno)); /*@+compdef@ */ } /* * We don't clear direct_io_changed here, to avoid race conditions * that could cause the input and output settings to differ. */ #endif /* O_DIRECT */ debug("%s: %d: %s: fd=%d", "next file opened", filenum, pv_current_file_name(state), fd); return fd; } /* * Return the name of the current file. The returned buffer may point to * internal state and must not be passed to free() or used after "state" is * freed. */ /*@keep@*/ const char *pv_current_file_name(pvstate_t state) { static char *str_none = NULL; static char *str_stdin = NULL; const char *input_file_name = NULL; /*@-observertrans@ */ /*@-onlytrans@ */ /*@-statictrans@ */ /* * Here we are doing bad things with regards to whether the returned * string is an allocated string from the state->files.filename array, * a constant string, or a returned string from gettext(), but it * has no impact. We explicitly document, above, that the returned * string expires with the state, and hence switch off the * associated splint warnings. */ if (NULL == str_none) str_none = _("(none)"); if (NULL == str_stdin) str_stdin = _("(stdin)"); /* Fallback in case of translation failure. */ if (NULL == str_none) str_none = "(none)"; if (NULL == str_stdin) str_stdin = "(stdin)"; if (state->status.current_input_file < 0) return str_none; if ((unsigned int) (state->status.current_input_file) >= state->files.file_count) return str_none; if (NULL == state->files.filename) { input_file_name = NULL; } else { input_file_name = state->files.filename[state->status.current_input_file]; } if (NULL == input_file_name) return str_none; if (0 == strcmp(input_file_name, "-")) return str_stdin; /*@-compdef@ */ return input_file_name; /*@+compdef@ */ /* * splint warns about state->files.filename being undefined, but we * know it's been populated fully by the time this function is * called. */ /*@+statictrans@ */ /*@+onlytrans@ */ /*@+observertrans@ */ } pv-1.9.31/src/pv/format/000077500000000000000000000000001474702661500147525ustar00rootroot00000000000000pv-1.9.31/src/pv/format/averagerate.c000066400000000000000000000023231474702661500174040ustar00rootroot00000000000000/* * Formatter function for average rate. * * Copyright 2024-2025 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #include "config.h" #include "pv.h" #include "pv-internal.h" /* * Average transfer rate. */ pvdisplay_bytecount_t pv_formatter_average_rate(pvformatter_args_t args) { char content[128]; /* flawfinder: ignore - always bounded */ content[0] = '\0'; if (0 == args->buffer_size) return 0; /*@-mustfreefresh@ */ if (args->state->control.numeric) { /* numeric - raw value without suffix. */ (void) pv_snprintf(content, sizeof(content), "%.4Lf", ((args->state->control.bits ? 8.0 : 1.0) * args->state->calc.average_rate)); } else if (args->state->control.bits && !args->state->control.linemode) { /* bits per second */ pv_describe_amount(content, sizeof(content), "(%s)", 8 * args->state->calc.average_rate, "", _("b/s"), args->display->count_type); } else { /* bytes or lines per second */ pv_describe_amount(content, sizeof(content), "(%s)", args->state->calc.average_rate, _("/s"), _("B/s"), args->display->count_type); } /*@+mustfreefresh@ *//* splint: see above. */ return pv_formatter_segmentcontent(content, args); } pv-1.9.31/src/pv/format/barstyle.c000066400000000000000000000135401474702661500167460ustar00rootroot00000000000000/* * Formatter functions for styled progress bars. * * Copyright 2024-2025 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #include "config.h" #include "pv.h" #include "pv-internal.h" #include #if defined(ENABLE_NLS) && defined(HAVE_WCHAR_H) #include #if defined(HAVE_WCTYPE_H) #include #endif #endif /* * Populate "style" with the named bar style, falling back to plain if the * name was not recognised. Returns true if the named style was found. * * Note that strings are copied into the structure, rather than just * updating pointers, to maintain separation of concern between different * parts of the code - and because on 64-bit architectures, the sizes of the * data types and their associated alignment padding tend to outweigh the * memory savings from using pointers and shared strings. */ static bool pv_barstyle(pvformatter_args_t args, pvbarstyle_t style, const char *name) { #define populate_string(item, str, w) { \ item.width = w; \ item.bytes = strlen(str); /* flawfinder: ignore */ \ if (item.bytes > 0 && item.bytes <= PV_BARSTYLE_SIZEOF_STRING) \ memcpy(item.string, str, item.bytes); /* flawfinder: ignore */ \ } /* * flawfinder - strlen() on null-terminated static strings is OK, * and with the memcpy(), we check the buffer is big enough. */ memset(style, 0, sizeof(*style)); if (args->state->control.can_display_utf8 && 0 == strcmp(name, "block")) { style->style_id = 2; populate_string(style->indicator, "◀▶", 2); populate_string(style->tip, "", 0); populate_string(style->filler[0], " ", 1); populate_string(style->filler[1], "â–ˆ", 1); style->filler_entries = 2; return true; } else if (args->state->control.can_display_utf8 && 0 == strcmp(name, "granular")) { style->style_id = 3; populate_string(style->indicator, "◀▶", 2); populate_string(style->tip, "", 0); populate_string(style->filler[0], " ", 1); populate_string(style->filler[1], "â–", 1); populate_string(style->filler[2], "â–Ž", 1); populate_string(style->filler[3], "â–", 1); populate_string(style->filler[4], "â–Œ", 1); populate_string(style->filler[5], "â–‹", 1); populate_string(style->filler[6], "â–Š", 1); populate_string(style->filler[7], "â–‰", 1); populate_string(style->filler[8], "â–ˆ", 1); style->filler_entries = 9; return true; } else if (args->state->control.can_display_utf8 && 0 == strcmp(name, "shaded")) { style->style_id = 4; populate_string(style->indicator, "â–’â–“â–’", 3); populate_string(style->tip, "", 0); populate_string(style->filler[0], "â–‘", 1); populate_string(style->filler[1], "â–’", 1); populate_string(style->filler[2], "â–“", 1); populate_string(style->filler[3], "â–ˆ", 1); style->filler_entries = 4; return true; } /* Default plain style. */ style->style_id = 1; populate_string(style->indicator, "<=>", 3); populate_string(style->tip, ">", 1); populate_string(style->filler[0], " ", 1); populate_string(style->filler[1], "=", 1); style->filler_entries = 2; if (0 == strcmp(name, "plain")) return true; return false; } /* * Return the index into args->display->barstyle for the style with the * given name, adding that style to the array if it's not there already and * there's room. * * If there is no room, returns zero, so the first style is re-used. */ int8_t pv_display_barstyle_index(pvformatter_args_t args, const char *name) { struct pvbarstyle_s style; int8_t barstyle_index; #ifdef ENABLE_DEBUGGING bool found; #endif memset(&style, 0, sizeof(style)); #ifdef ENABLE_DEBUGGING found = pv_barstyle(args, &style, name); if (!found) debug("%s: %s", name, "bar style not found, using plain"); #else (void) pv_barstyle(args, &style, name); #endif for (barstyle_index = 0; barstyle_index < PV_BARSTYLE_MAX && args->display->barstyle[barstyle_index].style_id > 0; barstyle_index++) { if (args->display->barstyle[barstyle_index].style_id == style.style_id) { debug("%s: %s: %d", name, "found in bar style array", barstyle_index); return barstyle_index; } } if (barstyle_index >= PV_BARSTYLE_MAX) { debug("%s: %s", name, "no room to add another bar style - returning 0"); return 0; } memcpy(&(args->display->barstyle[barstyle_index]), &style, sizeof(style)); /* flawfinder: ignore */ /* flawfinder - the destination is an array element of the right size. */ debug("%s: %s: %d", name, "added to bar style array", barstyle_index); return barstyle_index; } pvdisplay_bytecount_t pv_formatter_bar_default(pvformatter_args_t args) { if (0 == args->segment->parameter) { const char *default_name; default_name = args->state->control.default_bar_style; /*@-branchstate@ */ if (NULL == default_name) default_name = "plain"; /*@+branchstate@ */ /* splint - it doesn't matter that default_name may be static */ args->segment->parameter = 1 + pv_display_barstyle_index(args, default_name); } return pv_formatter_progress_bar_only(args); } pvdisplay_bytecount_t pv_formatter_bar_plain(pvformatter_args_t args) { if (0 == args->segment->parameter) args->segment->parameter = 1 + pv_display_barstyle_index(args, "plain"); return pv_formatter_progress_bar_only(args); } pvdisplay_bytecount_t pv_formatter_bar_block(pvformatter_args_t args) { if (0 == args->segment->parameter) args->segment->parameter = 1 + pv_display_barstyle_index(args, "block"); return pv_formatter_progress_bar_only(args); } pvdisplay_bytecount_t pv_formatter_bar_granular(pvformatter_args_t args) { if (0 == args->segment->parameter) args->segment->parameter = 1 + pv_display_barstyle_index(args, "granular"); return pv_formatter_progress_bar_only(args); } pvdisplay_bytecount_t pv_formatter_bar_shaded(pvformatter_args_t args) { if (0 == args->segment->parameter) args->segment->parameter = 1 + pv_display_barstyle_index(args, "shaded"); return pv_formatter_progress_bar_only(args); } pv-1.9.31/src/pv/format/bufferpercent.c000066400000000000000000000017431474702661500177550ustar00rootroot00000000000000/* * Formatter function for transfer buffer percentage utilisation. * * Copyright 2024-2025 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #include "config.h" #include "pv.h" #include "pv-internal.h" /* * Percentage transfer buffer utilisation. */ pvdisplay_bytecount_t pv_formatter_buffer_percent(pvformatter_args_t args) { char content[16]; /* flawfinder: ignore - always bounded */ content[0] = '\0'; if (0 == args->buffer_size) return 0; if (args->state->transfer.buffer_size > 0) { double pct_used = pv_percentage((off_t) (args->state->transfer.read_position - args->state->transfer.write_position), (off_t) (args->state->transfer.buffer_size)); (void) pv_snprintf(content, sizeof(content), "{%3.0f%%}", pct_used); } #ifdef HAVE_SPLICE if (args->state->transfer.splice_used) (void) pv_snprintf(content, sizeof(content), "{%s}", "----"); #endif return pv_formatter_segmentcontent(content, args); } pv-1.9.31/src/pv/format/bytes.c000066400000000000000000000024511474702661500162460ustar00rootroot00000000000000/* * Formatter function for bytes or lines transferred. * * Copyright 2024-2025 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #include "config.h" #include "pv.h" #include "pv-internal.h" /* * Number of bytes or lines transferred. */ pvdisplay_bytecount_t pv_formatter_bytes(pvformatter_args_t args) { char content[128]; /* flawfinder: ignore - always bounded */ args->display->showing_bytes = true; if (0 == args->buffer_size) return 0; content[0] = '\0'; /*@-mustfreefresh@ */ if (args->state->control.numeric) { /* Numeric mode - raw values only, no suffix. */ (void) pv_snprintf(content, sizeof(content), "%lld", (long long) ((args->state->control.bits ? 8 : 1) * args->state->transfer.transferred)); } else if (args->state->control.bits && !args->state->control.linemode) { pv_describe_amount(content, sizeof(content), "%s", (long double) (args->state->transfer.transferred * 8), "", _("b"), args->display->count_type); } else { pv_describe_amount(content, sizeof(content), "%s", (long double) (args->state->transfer.transferred), "", _("B"), args->display->count_type); } /*@+mustfreefresh@ *//* splint - false positive from gettext(). */ return pv_formatter_segmentcontent(content, args); } pv-1.9.31/src/pv/format/eta.c000066400000000000000000000034371474702661500156760ustar00rootroot00000000000000/* * Formatter function for ETA display. * * Copyright 2024-2025 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #include "config.h" #include "pv.h" #include "pv-internal.h" /* * Estimated time until completion. */ pvdisplay_bytecount_t pv_formatter_eta(pvformatter_args_t args) { char content[128]; /* flawfinder: ignore - always bounded */ long eta; content[0] = '\0'; /* * Don't try to calculate this if the size is not known. */ if (args->state->control.size < 1) return 0; if (0 == args->buffer_size) return 0; eta = pv_seconds_remaining((args->state->transfer.transferred - args->display->initial_offset), args->state->control.size - args->display->initial_offset, args->state->calc.current_avg_rate); /* * Bounds check, so we don't overrun the suffix buffer. This means * the ETA will always be less than 100,000 hours. */ eta = pv_bound_long(eta, 0, (long) 360000000L); /* * If the ETA is more than a day, include a day count as well as * hours, minutes, and seconds. */ /*@-mustfreefresh@ */ if (eta > 86400L) { (void) pv_snprintf(content, sizeof(content), "%.16s %ld:%02ld:%02ld:%02ld", _("ETA"), eta / 86400, (eta / 3600) % 24, (eta / 60) % 60, eta % 60); } else { (void) pv_snprintf(content, sizeof(content), "%.16s %ld:%02ld:%02ld", _("ETA"), eta / 3600, (eta / 60) % 60, eta % 60); } /*@+mustfreefresh@ *//* splint: see above. */ /* * If this is the final update, show a blank space where the ETA * used to be. */ if (args->display->final_update) { size_t erase_idx; for (erase_idx = 0; erase_idx < sizeof(content) && content[erase_idx] != '\0'; erase_idx++) { content[erase_idx] = ' '; } } return pv_formatter_segmentcontent(content, args); } pv-1.9.31/src/pv/format/fineta.c000066400000000000000000000043561474702661500163740ustar00rootroot00000000000000/* * Formatter function for the local time at which the transfer is expected * to complete. * * Copyright 2024-2025 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #include "config.h" #include "pv.h" #include "pv-internal.h" #include #include /* * Estimated local time of completion. */ pvdisplay_bytecount_t pv_formatter_fineta(pvformatter_args_t args) { char content[128]; /* flawfinder: ignore - always bounded */ time_t now, then; struct tm *time_ptr; long eta; const char *time_format; bool show_fineta; content[0] = '\0'; /* * Don't try to calculate this if the size is not known. */ if (args->state->control.size < 1) return 0; if (0 == args->buffer_size) return 0; now = time(NULL); show_fineta = true; time_format = NULL; /* * The completion clock time may be hidden by a failed localtime * lookup. */ eta = pv_seconds_remaining(args->state->transfer.transferred - args->display->initial_offset, args->state->control.size - args->display->initial_offset, args->state->calc.current_avg_rate); /* Bounds check - see pv_formatter_eta(). */ eta = pv_bound_long(eta, 0, (long) 360000000L); /* * Only include the date if the ETA is more than 6 hours * away. */ if (eta > (long) (6 * 3600)) { time_format = "%Y-%m-%d %H:%M:%S"; } else { time_format = "%H:%M:%S"; } then = now + eta; time_ptr = localtime(&then); if (NULL == time_ptr) { show_fineta = false; } else { /* * The localtime() function keeps data stored in a static * buffer that gets overwritten by time functions. */ struct tm time = *time_ptr; size_t content_bytes; /*@-mustfreefresh@ */ (void) pv_snprintf(content, sizeof(content), "%.16s ", _("FIN")); /*@+mustfreefresh@ *//* splint: see above. */ content_bytes = strlen(content); /* flawfinder: ignore */ /* flawfinder: always bounded with \0 by pv_snprintf(). */ (void) strftime(content + content_bytes, sizeof(content) - 1 - content_bytes, time_format, &time); } if (!show_fineta) { size_t erase_idx; for (erase_idx = 0; erase_idx < sizeof(content) && content[erase_idx] != '\0'; erase_idx++) { content[erase_idx] = ' '; } } return pv_formatter_segmentcontent(content, args); } pv-1.9.31/src/pv/format/lastwritten.c000066400000000000000000000027411474702661500175020ustar00rootroot00000000000000/* * Formatter function for showing the last bytes written. * * Copyright 2024-2025 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #include "config.h" #include "pv.h" #include "pv-internal.h" /* * Display the last few bytes written. * * As a side effect, this sets args->display->lastwritten_bytes to * the segment's chosen_size, if it was previously smaller than that. */ pvdisplay_bytecount_t pv_formatter_last_written(pvformatter_args_t args) { pvdisplay_bytecount_t bytes_to_show, read_offset, write_offset, remaining; args->display->showing_last_written = true; bytes_to_show = args->segment->chosen_size; if (0 == bytes_to_show) bytes_to_show = args->segment->width; if (0 == bytes_to_show) return 0; if (bytes_to_show > PV_SIZEOF_LASTWRITTEN_BUFFER) bytes_to_show = PV_SIZEOF_LASTWRITTEN_BUFFER; if (bytes_to_show > args->display->lastwritten_bytes) args->display->lastwritten_bytes = bytes_to_show; if (0 == args->buffer_size) return 0; if (args->offset + bytes_to_show >= args->buffer_size) return 0; args->segment->offset = args->offset; args->segment->bytes = bytes_to_show; read_offset = args->display->lastwritten_bytes - bytes_to_show; write_offset = args->offset; for (remaining = bytes_to_show; remaining > 0; remaining--) { char display_char = args->display->lastwritten_buffer[read_offset++]; args->buffer[write_offset++] = pv_isprint(display_char) ? display_char : '.'; } return bytes_to_show; } pv-1.9.31/src/pv/format/name.c000066400000000000000000000020271474702661500160370ustar00rootroot00000000000000/* * Formatter function for showing the name of the transfer. * * Copyright 2024-2025 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #include "config.h" #include "pv.h" #include "pv-internal.h" #include /* * Display the transfer's name. */ pvdisplay_bytecount_t pv_formatter_name(pvformatter_args_t args) { char string_format[32]; /* flawfinder: ignore - always bounded */ char content[512]; /* flawfinder: ignore - always bounded */ pvdisplay_bytecount_t field_width; if (0 == args->buffer_size) return 0; field_width = args->segment->chosen_size; if (field_width < 1) field_width = 9; if (field_width > 500) field_width = 500; memset(string_format, 0, sizeof(string_format)); (void) pv_snprintf(string_format, sizeof(string_format), "%%%d.500s:", field_width); content[0] = '\0'; if (args->state->control.name) { (void) pv_snprintf(content, sizeof(content), string_format, args->state->control.name); } return pv_formatter_segmentcontent(content, args); } pv-1.9.31/src/pv/format/previousline.c000066400000000000000000000022631474702661500176450ustar00rootroot00000000000000/* * Formatter function for the most recently written line. * * Copyright 2024-2025 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #include "config.h" #include "pv.h" #include "pv-internal.h" /* * Display the previously written line. */ pvdisplay_bytecount_t pv_formatter_previous_line(pvformatter_args_t args) { pvdisplay_bytecount_t bytes_to_show, read_offset, write_offset, remaining; args->display->showing_previous_line = true; if (0 == args->buffer_size) return 0; bytes_to_show = args->segment->chosen_size; if (0 == bytes_to_show) bytes_to_show = args->segment->width; if (0 == bytes_to_show) return 0; if (bytes_to_show > PV_SIZEOF_PREVLINE_BUFFER) bytes_to_show = PV_SIZEOF_PREVLINE_BUFFER; if (args->offset + bytes_to_show >= args->buffer_size) return 0; args->segment->offset = args->offset; args->segment->bytes = bytes_to_show; read_offset = 0; write_offset = args->offset; for (remaining = bytes_to_show; remaining > 0; remaining--) { char display_char = args->display->previous_line[read_offset++]; args->buffer[write_offset++] = pv_isprint(display_char) ? display_char : ' '; } return bytes_to_show; } pv-1.9.31/src/pv/format/progressbar.c000066400000000000000000000301641474702661500174530ustar00rootroot00000000000000/* * Formatter functions for progress bars. * * Copyright 2024-2025 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #include "config.h" #include "pv.h" #include "pv-internal.h" #include #if HAVE_MATH_H #include #endif /* Convenience macro for appending a string to the buffer. */ #define append_to_buffer(x) { \ if (buffer_offset < (buffer_size - x.bytes)) { \ memcpy(&(buffer[buffer_offset]), x.string, x.bytes); /* flawfinder: ignore */ \ buffer_offset += x.bytes; \ } \ } /* * flawfinder - we are checking that there is room in the destination * buffer, given its size and our current offset. */ /* * Write a progress bar to a buffer, in known-size or rate-gauge mode - a * bar, and a percentage (size) or max rate (gauge). The total width of the * content is bounded to the given width. Returns the number of bytes * written to the buffer. * * If "bar_sides" is false, only the bar itself is rendered, not the opening * and closing characters. * * If "include_bar" is false, the bar is omitted entirely. * * If "include_amount" is false, the percentage or rate after the bar is * omitted. * * This is only called by pv_formatter_progress(). */ static pvdisplay_bytecount_t pv_formatter_progress_knownsize(pvformatter_args_t args, char *buffer, pvdisplay_bytecount_t buffer_size, bool bar_sides, bool include_bar, bool include_amount) { char after_bar[32]; /* flawfinder: ignore - only populated by pv_snprintf(). */ pvdisplay_bytecount_t after_bar_bytes, buffer_offset; pvdisplay_width_t after_bar_width; pvdisplay_width_t bar_area_width, filled_bar_width, pad_count; double bar_percentage; pvbarstyle_t style; pvdisplay_bytecount_t full_cell_index; bool has_tip = false; buffer[0] = '\0'; if (args->segment->parameter > 0 && args->segment->parameter <= PV_BARSTYLE_MAX) { style = &(args->display->barstyle[args->segment->parameter - 1]); } else { style = &(args->display->barstyle[0]); } full_cell_index = style->filler_entries; if (full_cell_index > 0) full_cell_index--; if (1 == full_cell_index && style->tip.width > 0) has_tip = true; memset(after_bar, 0, sizeof(after_bar)); if (args->state->control.size > 0) { /* Percentage of data transferred. */ bar_percentage = (double) (args->state->calc.percentage); (void) pv_snprintf(after_bar, sizeof(after_bar), " %3ld%%", (int) bar_percentage); } else { /* Current rate vs max rate. */ bar_percentage = 0.0; if (args->state->calc.rate_max > 0) { bar_percentage = (double) (100.0 * args->state->calc.transfer_rate / args->state->calc.rate_max); } /*@-mustfreefresh@ */ if (args->state->control.bits && !args->state->control.linemode) { /* bits per second */ pv_describe_amount(after_bar, sizeof(after_bar), "/%s", 8.0 * args->state->calc.rate_max, "", _("b/s"), args->display->count_type); } else { /* bytes or lines per second */ pv_describe_amount(after_bar, sizeof(after_bar), "/%s", args->state->calc.rate_max, _("/s"), _("B/s"), args->display->count_type); } /*@+mustfreefresh@ *//* splint: see above about gettext(). */ } if (!include_amount) after_bar[0] = '\0'; after_bar_bytes = strlen(after_bar); /* flawfinder: ignore */ /* flawfinder: always \0-terminated by pv_snprintf() and the earlier memset(). */ after_bar_width = pv_strwidth(after_bar, after_bar_bytes); if (!include_bar) { /* * Only returning the "after bar" portion - the amount * (progress or max rate). */ if (buffer_size < after_bar_bytes) return 0; if (after_bar_bytes > 1) { /* NB we skip the leading space. */ memmove(buffer, after_bar + 1, after_bar_bytes - 1); buffer[after_bar_bytes - 1] = '\0'; return after_bar_bytes - 1; } return 0; } if (bar_sides) { if (args->segment->width < (after_bar_width + 2)) return 0; bar_area_width = args->segment->width - after_bar_width - 2; } else { if (args->segment->width < after_bar_width) return 0; bar_area_width = args->segment->width - after_bar_width; } filled_bar_width = (pvdisplay_width_t) ((bar_area_width * bar_percentage) / 100); /* Leave room for the tip of the bar. */ if (has_tip && filled_bar_width > 0) filled_bar_width -= style->tip.width; debug("percentage=%.2f width=%d bar_area_width=%d filled_bar_width=%d after_bar_width=%d", bar_percentage, args->segment->width, bar_area_width, filled_bar_width, after_bar_width); buffer_offset = 0; if (bar_sides) { /* The opening of the bar area. */ buffer[buffer_offset++] = '['; } /* The bar portion. */ pad_count = 0; while (pad_count < filled_bar_width && pad_count < bar_area_width) { append_to_buffer(style->filler[full_cell_index]); pad_count += style->filler[full_cell_index].width; if (0 == style->filler[full_cell_index].width) pad_count++; } /* The tip of the bar, if not at 100%. */ if (has_tip && pad_count < bar_area_width) { append_to_buffer(style->tip); pad_count += style->tip.width; } /* A partial cell, if there are intermediates and we're not at 100%. */ if (pad_count < bar_area_width && full_cell_index > 1 && !has_tip) { double exact_width = (((double) bar_area_width) * bar_percentage) / 100.0; double cell_portion = exact_width - (double) filled_bar_width; double cell_index_double = ((double) full_cell_index) * cell_portion; size_t cell_index = (size_t) cell_index_double; if (cell_index > full_cell_index) cell_index = full_cell_index; append_to_buffer(style->filler[cell_index]); pad_count += style->filler[cell_index].width; if (0 == style->filler[cell_index].width) pad_count++; } /* The spaces after the bar. */ while (pad_count < bar_area_width) { append_to_buffer(style->filler[0]); pad_count += style->filler[0].width; if (0 == style->filler[0].width) pad_count++; } if (bar_sides) { /* The closure of the bar area. */ if (buffer_offset < buffer_size - 1) buffer[buffer_offset++] = ']'; } /* The percentage. */ if (after_bar_bytes > 0 && after_bar_bytes < (buffer_size - 1 - buffer_offset)) { memmove(buffer + buffer_offset, after_bar, after_bar_bytes); buffer_offset += after_bar_bytes; } buffer[buffer_offset] = '\0'; return buffer_offset; } /* * Write a progress bar to a buffer, in unknown-size mode - just a moving * indicator. The total width of the content is bounded to the given width. * Returns the number of bytes written to the buffer. * * If "bar_sides" is false, only the bar itself is rendered, not the opening * and closing characters. * * This is only called by pv_formatter_progress(). */ static pvdisplay_bytecount_t pv_formatter_progress_unknownsize(pvformatter_args_t args, char *buffer, pvdisplay_bytecount_t buffer_size, bool bar_sides) { pvdisplay_bytecount_t buffer_offset; pvdisplay_width_t bar_area_width, pad_count; double indicator_position, padding_width; pvbarstyle_t style; buffer[0] = '\0'; if (args->segment->parameter > 0 && args->segment->parameter <= PV_BARSTYLE_MAX) { style = &(args->display->barstyle[args->segment->parameter - 1]); } else { style = &(args->display->barstyle[0]); } if (bar_sides) { if (args->segment->width < (style->indicator.width + 3)) return 0; bar_area_width = args->segment->width - (style->indicator.width + 2); } else { if (args->segment->width < (style->indicator.width + 2)) return 0; bar_area_width = args->segment->width - style->indicator.width; } /* * Note that pv_calculate_transfer_rate() sets the percentage when * the size is unknown to a value that goes 0 - 200 and resets, so * here we make values above 100 send the indicator back down again, * so it moves back and forth. */ indicator_position = args->state->calc.percentage; if (indicator_position > 200.0) #if HAVE_FMOD indicator_position = fmod(indicator_position, 200.0); #else { while (indicator_position > 200.0) indicator_position -= 200.0; } #endif if (indicator_position > 100.0) indicator_position = 200.0 - indicator_position; if (indicator_position < 0.0) indicator_position = 0.0; buffer_offset = 0; if (bar_sides) { /* The opening of the bar area. */ buffer[buffer_offset++] = '['; } /* The spaces before the indicator. */ pad_count = 0; padding_width = (((double) bar_area_width) * indicator_position) / 100.0; while (pad_count < bar_area_width && pad_count < (pvdisplay_width_t) padding_width) { append_to_buffer(style->filler[0]); pad_count += style->filler[0].width; if (0 == style->filler[0].width) pad_count++; } /* The indicator. */ if (buffer_offset < buffer_size - style->indicator.bytes) { append_to_buffer(style->indicator); } /* The spaces after the indicator. */ while (pad_count < bar_area_width) { append_to_buffer(style->filler[0]); pad_count += style->filler[0].width; if (0 == style->filler[0].width) pad_count++; } if (bar_sides) { /* The closure of the bar area. */ if (buffer_offset < buffer_size - 1) buffer[buffer_offset++] = ']'; } buffer[buffer_offset] = '\0'; return buffer_offset; } /* * Progress bar. */ pvdisplay_bytecount_t pv_formatter_progress(pvformatter_args_t args) { char content[4096]; /* flawfinder: ignore - always bounded */ pvdisplay_bytecount_t bytes; content[0] = '\0'; if (0 == args->segment->parameter) { const char *default_name; default_name = args->state->control.default_bar_style; /*@-branchstate@ */ if (NULL == default_name) default_name = "plain"; /*@+branchstate@ */ /* splint - it doesn't matter that default_name may be static */ args->segment->parameter = 1 + pv_display_barstyle_index(args, default_name); } if (0 == args->buffer_size) return 0; if (args->state->control.size > 0 || args->state->control.rate_gauge) { /* Known size or rate gauge - bar with percentage. */ bytes = pv_formatter_progress_knownsize(args, content, sizeof(content), true, true, true); } else { /* Unknown size - back-and-forth moving indicator. */ bytes = pv_formatter_progress_unknownsize(args, content, sizeof(content), true); } content[bytes] = '\0'; return pv_formatter_segmentcontent(content, args); } /* * Progress bar, without sides and without a number afterwards. */ pvdisplay_bytecount_t pv_formatter_progress_bar_only(pvformatter_args_t args) { char content[4096]; /* flawfinder: ignore - always bounded */ pvdisplay_bytecount_t bytes; content[0] = '\0'; if (0 == args->segment->parameter) { const char *default_name; default_name = args->state->control.default_bar_style; /*@-branchstate@ */ if (NULL == default_name) default_name = "plain"; /*@+branchstate@ */ /* splint - it doesn't matter that default_name may be static */ args->segment->parameter = 1 + pv_display_barstyle_index(args, default_name); } if (0 == args->buffer_size) return 0; if (args->state->control.size > 0 || args->state->control.rate_gauge) { /* Known size or rate gauge - bar with percentage. */ bytes = pv_formatter_progress_knownsize(args, content, sizeof(content), false, true, false); } else { /* Unknown size - back-and-forth moving indicator. */ bytes = pv_formatter_progress_unknownsize(args, content, sizeof(content), false); } content[bytes] = '\0'; return pv_formatter_segmentcontent(content, args); } /* * The number after the progress bar. */ pvdisplay_bytecount_t pv_formatter_progress_amount_only(pvformatter_args_t args) { char content[256]; /* flawfinder: ignore - always bounded */ pvdisplay_bytecount_t bytes; memset(content, 0, sizeof(content)); if (0 == args->buffer_size) return 0; if (args->state->control.numeric) { /* Numeric mode - percentage as a rounded integer with no suffix. */ (void) pv_snprintf(content, sizeof(content), "%.0f", args->state->calc.percentage); bytes = strlen(content); /* flawfinder: ignore */ /* flawfinder: always \0-terminated by pv_snprintf() and the earlier memset(). */ } else if (args->state->control.size > 0 || args->state->control.rate_gauge) { /* Known size or rate gauge - percentage or rate. */ bytes = pv_formatter_progress_knownsize(args, content, sizeof(content), false, false, true); } else { /* Unknown size - no number. */ return 0; } content[bytes] = '\0'; return pv_formatter_segmentcontent(content, args); } pv-1.9.31/src/pv/format/rate.c000066400000000000000000000024031474702661500160500ustar00rootroot00000000000000/* * Formatter function for the current rate of transfer. * * Copyright 2024-2025 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #include "config.h" #include "pv.h" #include "pv-internal.h" /* * Transfer rate. */ pvdisplay_bytecount_t pv_formatter_rate(pvformatter_args_t args) { char content[128]; /* flawfinder: ignore - always bounded */ args->display->showing_rate = true; content[0] = '\0'; if (0 == args->buffer_size) return 0; /*@-mustfreefresh@ */ if (args->state->control.numeric) { /* numeric - raw value without suffix. */ (void) pv_snprintf(content, sizeof(content), "%.4Lf", ((args->state->control.bits ? 8.0 : 1.0) * args->state->calc.transfer_rate)); } else if (args->state->control.bits && !args->state->control.linemode) { /* bits per second */ pv_describe_amount(content, sizeof(content), "[%s]", 8 * args->state->calc.transfer_rate, "", _("b/s"), args->display->count_type); } else { /* bytes or lines per second */ pv_describe_amount(content, sizeof(content), "[%s]", args->state->calc.transfer_rate, _("/s"), _("B/s"), args->display->count_type); } /*@+mustfreefresh@ *//* splint: see above. */ return pv_formatter_segmentcontent(content, args); } pv-1.9.31/src/pv/format/sgr.c000066400000000000000000000133301474702661500157110ustar00rootroot00000000000000/* * Formatter function for ECMA-48 SGR codes. * * Copyright 2024-2025 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #include "config.h" #include "pv.h" #include "pv-internal.h" #include struct sgr_keyword_map_s { /*@null@ */ const char *keyword; uint8_t bytes; uint8_t code; }; /* * Return an array mapping keywords to ECMA-48 SGR code numbers. */ /*@keep@ */ static struct sgr_keyword_map_s *sgr_keywords(void) { /*@keep@ */ static struct sgr_keyword_map_s keywords[] = { { "reset", 0, 0 }, { "none", 0, 0 }, { "bold", 0, 1 }, { "dim", 0, 2 }, { "italic", 0, 3 }, { "underscore", 0, 4 }, { "underline", 0, 4 }, { "blink", 0, 5 }, { "reverse", 0, 7 }, { "no-bold", 0, 22 }, /* same as no-dim */ { "no-dim", 0, 22 }, { "no-italic", 0, 23 }, { "no-underscore", 0, 24 }, { "no-underline", 0, 24 }, { "no-blink", 0, 25 }, { "no-reverse", 0, 27 }, { "black", 0, 30 }, { "red", 0, 31 }, { "green", 0, 32 }, { "brown", 0, 33 }, { "yellow", 0, 33 }, { "blue", 0, 34 }, { "magenta", 0, 35 }, { "cyan", 0, 36 }, { "white", 0, 37 }, { "fg-black", 0, 30 }, { "fg-red", 0, 31 }, { "fg-green", 0, 32 }, { "fg-brown", 0, 33 }, { "fg-yellow", 0, 33 }, { "fg-blue", 0, 34 }, { "fg-magenta", 0, 35 }, { "fg-cyan", 0, 36 }, { "fg-white", 0, 37 }, { "fg-default", 0, 39 }, { "bg-black", 0, 40 }, { "bg-red", 0, 41 }, { "bg-green", 0, 42 }, { "bg-brown", 0, 43 }, { "bg-yellow", 0, 43 }, { "bg-blue", 0, 44 }, { "bg-magenta", 0, 45 }, { "bg-cyan", 0, 46 }, { "bg-white", 0, 47 }, { "bg-default", 0, 49 }, { NULL, 0, 0 } }; int keyword_index; /* Calculate the lengths of each keyword on the first call. */ if (0 == keywords[0].bytes) { for (keyword_index = 0; NULL != keywords[keyword_index].keyword; keyword_index++) { keywords[keyword_index].bytes = strlen(keywords[keyword_index].keyword); /* flawfinder: ignore */ /* flawfinder - strlen() on a static null-terminated string is OK. */ } } /*@-compmempass@ */ return keywords; /*@+compmempass@ */ /* * splint - found no other way to pass static back without a false * positive warning about a memory leak. */ } /* * Display SGR codes if colour output is supported. */ pvdisplay_bytecount_t pv_formatter_sgr(pvformatter_args_t args) { /*@keep@ */ static struct sgr_keyword_map_s *keywords; char content[1024]; /* flawfinder: ignore */ pvdisplay_bytecount_t write_position, read_position, keyword_start, keyword_length; int numeric_value, code_count, most_recent_code; /* flawfinder - null-terminated and bounded with pv_snprintf(). */ if (!args->display->colour_permitted) return 0; args->display->format_uses_colour = true; if (!args->state->control.can_display_colour) return 0; if (NULL == args->segment->string_parameter) return 0; if (0 == args->segment->string_parameter_bytes) return 0; keywords = sgr_keywords(); write_position = 0; content[0] = '\0'; debug("%p+%d [%.*s]", args->segment->string_parameter, args->segment->string_parameter_bytes, args->segment->string_parameter_bytes, args->segment->string_parameter); read_position = 0; keyword_start = 0; keyword_length = 0; numeric_value = -1; code_count = 0; most_recent_code = -1; while (read_position < args->segment->string_parameter_bytes) { char read_char = args->segment->string_parameter[read_position++]; if ((',' == read_char) || (';' == read_char)) { keyword_length = read_position - keyword_start; if (keyword_length > 0) keyword_length--; } else { if ((read_char >= '0' && read_char <= '9') && (numeric_value >= 0 || keyword_start == read_position - 1)) { if (keyword_start == read_position - 1) numeric_value = 0; numeric_value = numeric_value * 10 + (int) (read_char - '0'); } else { numeric_value = -1; } if (read_position >= args->segment->string_parameter_bytes) { keyword_length = read_position - keyword_start; } } if (keyword_length > 0) { int code = -1; debug("keyword@%d+%d: [%.*s]; numeric=%d", keyword_start, keyword_length, keyword_length, &(args->segment->string_parameter[keyword_start]), numeric_value); if (numeric_value >= 0 && numeric_value < 255) { code = numeric_value; } else { int keyword_index; for (keyword_index = 0; -1 == code && NULL != keywords[keyword_index].keyword; keyword_index++) { if (keyword_length != keywords[keyword_index].bytes) continue; if (0 != strncmp(keywords[keyword_index].keyword, &(args->segment->string_parameter[keyword_start]), keyword_length)) continue; code = (int) (keywords[keyword_index].code); } } debug("code=%d", code); if (code >= 0) { if (code_count > 15) { write_position += pv_snprintf(content + write_position, sizeof(content) - write_position, "%s", "m"); code_count = 0; } if (0 == code_count) { write_position += pv_snprintf(content + write_position, sizeof(content) - write_position, "%s", "\033["); } else { write_position += pv_snprintf(content + write_position, sizeof(content) - write_position, "%s", ";"); } write_position += pv_snprintf(content + write_position, sizeof(content) - write_position, "%d", code); code_count++; most_recent_code = code; } keyword_length = 0; keyword_start = read_position; } } if (code_count > 0) write_position += pv_snprintf(content + write_position, sizeof(content) - write_position, "%s", "m"); if (most_recent_code > 0) { args->display->sgr_code_active = true; } else if (0 == most_recent_code) { args->display->sgr_code_active = false; } return pv_formatter_segmentcontent(content, args); } pv-1.9.31/src/pv/format/timer.c000066400000000000000000000040051474702661500162350ustar00rootroot00000000000000/* * Formatter function for the elapsed transfer time. * * Copyright 2024-2025 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #include "config.h" #include "pv.h" #include "pv-internal.h" /* * Elapsed time. */ pvdisplay_bytecount_t pv_formatter_timer(pvformatter_args_t args) { char content[128]; /* flawfinder: ignore - always bounded */ args->display->showing_timer = true; content[0] = '\0'; if (0 == args->buffer_size) return 0; /* * Bounds check, so we don't overrun the prefix buffer. This does * mean that the timer will stop at a 100,000 hours, but since * that's 11 years, it shouldn't be a problem. */ if (args->state->transfer.elapsed_seconds > (long double) 360000000.0L) args->state->transfer.elapsed_seconds = (long double) 360000000.0L; /* Also check it's not negative. */ if (args->state->transfer.elapsed_seconds < 0.0) args->state->transfer.elapsed_seconds = 0.0; if (args->state->control.numeric) { /* Numeric mode - show the number of seconds, unformatted. */ (void) pv_snprintf(content, sizeof(content), "%.4Lf", args->state->transfer.elapsed_seconds); } else if (args->state->transfer.elapsed_seconds > (long double) 86400.0L) { /* * If the elapsed time is more than a day, include a day count as * well as hours, minutes, and seconds. */ (void) pv_snprintf(content, sizeof(content), "%ld:%02ld:%02ld:%02ld", ((long) (args->state->transfer.elapsed_seconds)) / 86400, (((long) (args->state->transfer.elapsed_seconds)) / 3600) % 24, (((long) (args->state->transfer.elapsed_seconds)) / 60) % 60, ((long) (args->state->transfer.elapsed_seconds)) % 60); } else { (void) pv_snprintf(content, sizeof(content), "%ld:%02ld:%02ld", ((long) (args->state->transfer.elapsed_seconds)) / 3600, (((long) (args->state->transfer.elapsed_seconds)) / 60) % 60, ((long) (args->state->transfer.elapsed_seconds)) % 60); } return pv_formatter_segmentcontent(content, args); } pv-1.9.31/src/pv/loop.c000066400000000000000000000740701474702661500146070ustar00rootroot00000000000000/* * Functions providing the main transfer or file descriptor watching loop. * * Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2025 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #include "config.h" #include "pv.h" #include "pv-internal.h" #include #include #include #include #define _GNU_SOURCE 1 #include #include #include #include #include #include #if HAVE_MATH_H #include #endif #if HAVE_SQRTL #else /* * Square root of a long double. Adapted from iputils ping/ping_common.c. */ static long ldsqrt(long double value) { long double previous = (long double) LLONG_MAX; long double result = value; if (result > 0) { while (result < previous) { previous = result; result = (result + (value / result)) / 2; } } return result; } #endif /* * Pipe data from a list of files to standard output, giving information * about the transfer on standard error according to the given options. * * Returns nonzero on error. */ int pv_main_loop(pvstate_t state) { long lineswritten; off_t cansend; ssize_t written; long double target; bool eof_in, eof_out, final_update; struct timespec start_time, next_update, next_ratecheck, cur_time; struct timespec init_time, next_remotecheck, transfer_elapsed; int input_fd, output_fd; unsigned int file_idx; bool output_is_pipe; /* * "written" is ALWAYS bytes written by the last transfer. * * "lineswritten" is the lines written by the last transfer, * but is only updated in line mode. * * "state->transfer.total_written" is the total bytes written since * the start, or in line mode, the total lines written since the * start. * * The remaining variables are all unchanged by linemode. */ input_fd = -1; output_fd = state->control.output_fd; if (output_fd < 0) output_fd = STDOUT_FILENO; /* Determine whether the output is a pipe. */ output_is_pipe = false; { struct stat sb; memset(&sb, 0, sizeof(sb)); if (0 == fstat(output_fd, &sb)) { /*@-type@ */ if ((sb.st_mode & S_IFMT) == S_IFIFO) { output_is_pipe = true; debug("%s", "output is a pipe"); } /*@+type@ *//* splint says st_mode is __mode_t, not mode_t */ } else { debug("%s(%d): %s", "fstat", output_fd, strerror(errno)); } } /* * Note that we could reduce the size of the output pipe buffer like * this, to avoid the case where we write a load of data and it just * goes into the buffer so we think we're done, but the consumer * takes ages to process it: * * fcntl(output_fd, F_SETPIPE_SZ, 4096); * * If we can peek at how much has been consumed by the other end, we * don't need to. */ pv_crs_init(state); eof_in = false; eof_out = false; state->transfer.total_written = 0; lineswritten = 0; state->display.initial_offset = 0; state->transfer.written_but_not_consumed = 0; memset(&cur_time, 0, sizeof(cur_time)); memset(&start_time, 0, sizeof(start_time)); pv_elapsedtime_read(&cur_time); pv_elapsedtime_copy(&start_time, &cur_time); memset(&next_ratecheck, 0, sizeof(next_ratecheck)); memset(&next_remotecheck, 0, sizeof(next_remotecheck)); memset(&next_update, 0, sizeof(next_update)); pv_elapsedtime_copy(&next_ratecheck, &cur_time); pv_elapsedtime_copy(&next_remotecheck, &cur_time); pv_elapsedtime_copy(&next_update, &cur_time); if ((state->control.delay_start > 0) && (state->control.delay_start > state->control.interval)) { pv_elapsedtime_add_nsec(&next_update, (long long) (1000000000.0 * state->control.delay_start)); } else { pv_elapsedtime_add_nsec(&next_update, (long long) (1000000000.0 * state->control.interval)); } target = 0; final_update = false; file_idx = 0; /* * Open the first readable input file. */ input_fd = -1; while (input_fd < 0 && file_idx < state->files.file_count) { input_fd = pv_next_file(state, file_idx, -1); if (input_fd < 0) file_idx++; } /* * Exit early if there was no readable input file. */ if (input_fd < 0) { if (state->control.cursor) pv_crs_fini(state); return state->status.exit_status; } #if HAVE_POSIX_FADVISE /* Advise the OS that we will only be reading sequentially. */ (void) posix_fadvise(input_fd, 0, 0, POSIX_FADV_SEQUENTIAL); #endif #ifdef O_DIRECT /* * Set or clear O_DIRECT on the output. */ if (0 != fcntl(output_fd, F_SETFL, (state->control.direct_io ? O_DIRECT : 0) | fcntl(output_fd, F_GETFL))) { debug("%s: %s", "fcntl", strerror(errno)); } state->control.direct_io_changed = false; #endif /* O_DIRECT */ #if HAVE_STRUCT_STAT_ST_BLKSIZE /* * Set target buffer size if the initial file's block size can be * read and we weren't given a target buffer size. */ if (0 == state->control.target_buffer_size) { struct stat sb; memset(&sb, 0, sizeof(sb)); if (0 == fstat(input_fd, &sb)) { size_t sz; sz = (size_t) (sb.st_blksize * 32); if (sz > BUFFER_SIZE_MAX) { sz = BUFFER_SIZE_MAX; } state->control.target_buffer_size = sz; } } #endif if (0 == state->control.target_buffer_size) state->control.target_buffer_size = BUFFER_SIZE; /* * Repeat until eof_in is true, eof_out is true, and final_update is * true. */ while ((!(eof_in && eof_out)) || (!final_update)) { cansend = 0; /* * Check for remote messages from -R every short while. */ if (pv_elapsedtime_compare(&cur_time, &next_remotecheck) > 0) { pv_remote_check(state); pv_elapsedtime_add_nsec(&next_remotecheck, REMOTE_INTERVAL); } if (1 == state->flag.trigger_exit) break; if (state->control.rate_limit > 0) { pv_elapsedtime_read(&cur_time); if (pv_elapsedtime_compare(&cur_time, &next_ratecheck) > 0) { target += ((long double) (state->control.rate_limit)) / (long double) (1000000000.0 / (long double) (RATE_GRANULARITY)); long double burst_max = ((long double) (state->control.rate_limit * RATE_BURST_WINDOW)); if (target > burst_max) { target = burst_max; } pv_elapsedtime_add_nsec(&next_ratecheck, RATE_GRANULARITY); } cansend = (off_t) target; } /* * If we have to stop at "size" bytes, make sure we don't * try to write more than we're allowed to. */ if ((0 < state->control.size) && (state->control.stop_at_size)) { if ((state->control.size < (state->transfer.total_written + cansend)) || ((0 == cansend) && (0 == state->control.rate_limit))) { cansend = state->control.size - state->transfer.total_written; if (0 >= cansend) { debug("%s", "write limit reached (size explicitly set) - setting EOF flags"); eof_in = true; eof_out = true; } } } if ((0 < state->control.size) && (state->control.stop_at_size) && (0 >= cansend) && eof_in && eof_out) { written = 0; } else { written = pv_transfer(state, input_fd, &eof_in, &eof_out, cansend, &lineswritten); } /* End on write error. */ if (written < 0) { debug("%s: %s", "write error from pv_transfer", strerror(errno)); if (state->control.cursor) pv_crs_fini(state); return state->status.exit_status; } if (state->control.linemode) { state->transfer.total_written += lineswritten; if (state->control.rate_limit > 0) target -= lineswritten; } else { state->transfer.total_written += written; if (state->control.rate_limit > 0) target -= written; } #ifdef FIONREAD /* * If writing to a pipe, look at how much is sitting in the * pipe buffer waiting for the receiver to read. */ if (output_is_pipe) { int nbytes; nbytes = 0; if (0 != state->flag.pipe_closed) { if (0 != state->transfer.written_but_not_consumed) debug("%s", "clearing written_but_not_consumed because the output pipe was closed"); state->transfer.written_but_not_consumed = 0; } else if (0 == ioctl(output_fd, FIONREAD, &nbytes)) { if (nbytes >= 0) { if (((size_t) nbytes) != state->transfer.written_but_not_consumed) debug("%s: %d", "written_but_not_consumed is now", nbytes); state->transfer.written_but_not_consumed = (size_t) nbytes; } else { debug("%s: %d", "FIONREAD gave a negative byte count", nbytes); state->transfer.written_but_not_consumed = 0; } } else { debug("%s(%d,%s): %s", "ioctl", output_fd, "FIONREAD", strerror(errno)); state->transfer.written_but_not_consumed = 0; } } #endif state->transfer.transferred = state->transfer.total_written; if (output_is_pipe && !state->control.linemode) { /* * Writing bytes to a pipe - the amount transferred * to the receiver is the total amount we've * written, minus what's sitting in the pipe buffer * waiting for the receiver to consume it. */ state->transfer.transferred -= state->transfer.written_but_not_consumed; } else if (output_is_pipe && state->control.linemode && state->transfer.written_but_not_consumed > 0 && NULL != state->transfer.line_positions) { /* * Writing lines to a pipe - similar to above, but * we have to work out how many lines the * yet-to-be-consumed data in the buffer equates to. * * To do this, we walk backwards through our record * of the line positions in the output we've * written. */ off_t last_consumed_position = state->transfer.last_output_position - state->transfer.written_but_not_consumed; size_t lines_not_consumed = 0; size_t line_from_end = 0; /* * positions[head-1] = position of last separator written * positions[head-2] = position of second last separator written * etc * * We start at [head-1] and go backwards, wrapping * around as it's a circular buffer, stopping at the * length (number of positions stored), or when we * have gone before the last consumed position. */ for (line_from_end = 0; line_from_end < state->transfer.line_positions_length; line_from_end++) { size_t array_index; array_index = state->transfer.line_positions_head + state->transfer.line_positions_capacity - line_from_end - 1; while (array_index >= state->transfer.line_positions_capacity) array_index -= state->transfer.line_positions_capacity; if (state->transfer.line_positions[array_index] <= last_consumed_position) break; lines_not_consumed++; } debug("%s: %lld -> %lld", "written_but_not_consumed bytes to lines", (unsigned long long) (state->transfer.written_but_not_consumed), (unsigned long long) lines_not_consumed); state->transfer.transferred -= lines_not_consumed; } /* * EOF, and files remain - advance to the next file. */ while (eof_in && eof_out && file_idx < (state->files.file_count - 1)) { file_idx++; input_fd = pv_next_file(state, file_idx, input_fd); if (input_fd >= 0) { eof_in = false; eof_out = false; #if HAVE_POSIX_FADVISE /* Advise the OS that we will only be reading sequentially. */ (void) posix_fadvise(input_fd, 0, 0, POSIX_FADV_SEQUENTIAL); #endif } } /* Now check the current time. */ pv_elapsedtime_read(&cur_time); /* * If we've read everything and written everything, and the * output pipe buffer is empty, then set the final update * flag, and force a display update. */ if (eof_in && eof_out && 0 == state->transfer.written_but_not_consumed) { final_update = true; if ((state->display.display_visible) || (state->control.delay_start < 0.001)) { pv_elapsedtime_copy(&next_update, &cur_time); } } /* * Just go round the loop again if there's no display and * we're not reporting statistics. */ if (state->control.no_display && !state->control.show_stats) continue; /* * If -W was given, we don't output anything until we have * written a byte (or line, in line mode), at which point * we then count time as if we started when the first byte * was received. */ if (state->control.wait) { /* Restart the loop if nothing written yet. */ if (state->control.linemode) { if (lineswritten < 1) continue; } else { if (written < 1) continue; } state->control.wait = 0; /* * Reset the timer offset counter now that data * transfer has begun, otherwise if we had been * stopped and started (with ^Z / SIGTSTOP) * previously (while waiting for data), the timers * will be wrongly offset. * * While we reset the offset counter we must disable * SIGTSTOP so things don't mess up. */ pv_sig_nopause(); pv_elapsedtime_read(&start_time); pv_elapsedtime_zero(&(state->signal.toffset)); pv_sig_allowpause(); /* * Start the display, but only at the next interval, * not immediately. */ pv_elapsedtime_copy(&next_update, &start_time); pv_elapsedtime_add_nsec(&next_update, (long long) (1000000000.0 * state->control.interval)); } /* Restart the loop if it's not time to update the display. */ if (pv_elapsedtime_compare(&cur_time, &next_update) < 0) { continue; } pv_elapsedtime_add_nsec(&next_update, (long long) (1000000000.0 * state->control.interval)); /* Set the "next update" time to now, if it's in the past. */ if (pv_elapsedtime_compare(&next_update, &cur_time) < 0) pv_elapsedtime_copy(&next_update, &cur_time); /* * Calculate the effective start time: the time we actually * started, plus the total time we spent stopped. */ memset(&init_time, 0, sizeof(init_time)); pv_elapsedtime_add(&init_time, &start_time, &(state->signal.toffset)); /* * Now get the effective elapsed transfer time - current * time minus effective start time. */ memset(&transfer_elapsed, 0, sizeof(transfer_elapsed)); pv_elapsedtime_subtract(&transfer_elapsed, &cur_time, &init_time); state->transfer.elapsed_seconds = pv_elapsedtime_seconds(&transfer_elapsed); /* Resize the display, if a resize signal was received. */ if (1 == state->flag.terminal_resized) { unsigned int new_width, new_height; state->flag.terminal_resized = 0; new_width = (unsigned int) (state->control.width); new_height = state->control.height; pv_screensize(&new_width, &new_height); if (new_width > PVDISPLAY_WIDTH_MAX) new_width = PVDISPLAY_WIDTH_MAX; if (!state->control.width_set_manually) state->control.width = (pvdisplay_width_t) new_width; if (!state->control.height_set_manually) state->control.height = new_height; } if (state->control.no_display) { /* If there's no display, calculate rate for the statistics. */ pv_calculate_transfer_rate(state, final_update); } else { /* Produce the display. */ pv_display(state, final_update); } } debug("%s: %s=%s, %s=%s", "loop ended", "eof_in", eof_in ? "true" : "false", "eof_out", eof_out ? "true" : "false"); if (state->control.cursor) { pv_crs_fini(state); } else { if ((!state->control.numeric) && (!state->control.no_display) && (state->display.display_visible)) pv_tty_write(state, "\n", 1); } if (1 == state->flag.trigger_exit) state->status.exit_status |= PV_ERROREXIT_SIGNAL; if (input_fd >= 0) (void) close(input_fd); /* Calculate and display the transfer statistics. */ if (state->control.show_stats && state->calc.measurements_taken > 0) { char stats_buf[256]; /* flawfinder: ignore */ long double rate_mean, rate_variance, rate_deviation; int stats_size; /* flawfinder: made safe by use of pv_snprintf() */ rate_mean = state->calc.rate_sum / ((long double) (state->calc.measurements_taken)); rate_variance = (state->calc.ratesquared_sum / ((long double) (state->calc.measurements_taken))) - (rate_mean * rate_mean); #if HAVE_SQRTL rate_deviation = sqrtl(rate_variance); #else rate_deviation = ldsqrt(rate_variance); #endif debug("%s: %ld", "measurements taken", state->calc.measurements_taken); debug("%s: %.3Lf", "rate_sum", state->calc.rate_sum); debug("%s: %.3Lf", "ratesquared_sum", state->calc.ratesquared_sum); debug("%s: %.3Lf", "rate_mean", rate_mean); debug("%s: %.3Lf", "rate_variance", rate_variance); debug("%s: %.3Lf", "rate_deviation", rate_deviation); memset(stats_buf, 0, sizeof(stats_buf)); stats_size = pv_snprintf(stats_buf, sizeof(stats_buf), "%s = %.3Lf/%.3Lf/%.3Lf/%.3Lf %s\n", _("rate min/avg/max/mdev"), state->calc.rate_min, rate_mean, state->calc.rate_max, rate_deviation, state->control.bits ? _("b/s") : _("B/s")); if (stats_size > 0 && stats_size < (int) (sizeof(stats_buf))) pv_tty_write(state, stats_buf, (size_t) stats_size); } else if (state->control.show_stats && state->calc.measurements_taken < 1) { char msg_buf[256]; /* flawfinder: ignore */ int msg_size; /* flawfinder: made safe by use of pv_snprintf() */ memset(msg_buf, 0, sizeof(msg_buf)); msg_size = pv_snprintf(msg_buf, sizeof(msg_buf), "%s\n", _("rate not measured")); if (msg_size > 0 && msg_size < (int) (sizeof(msg_buf))) pv_tty_write(state, msg_buf, (size_t) msg_size); } return state->status.exit_status; } /* * Watch the progress of file descriptor state->control.watch_fd in process * state->control.watch_pid and show details about the transfer on standard error * according to the given options. * * Returns nonzero on error. */ int pv_watchfd_loop(pvstate_t state) { struct pvwatchfd_s info; off_t position_now; struct timespec next_update, cur_time; struct timespec init_time, next_remotecheck, transfer_elapsed; bool ended, first_check; int rc; memset(&info, 0, sizeof(info)); info.watch_pid = state->control.watch_pid; info.watch_fd = state->control.watch_fd; rc = pv_watchfd_info(state, &info, false); if (0 != rc) { state->status.exit_status |= PV_ERROREXIT_ACCESS; /*@-compdestroy@ */ return state->status.exit_status; /*@+compdestroy@ */ /* splint: no leak of info.state as it is unused so far. */ } /* * Use a size if one was passed, otherwise use the total size * calculated. */ if (0 >= state->control.size) state->control.size = info.size; if (state->control.size < 1) { char *fmt; while (NULL != (fmt = strstr(state->control.default_format, "%e"))) { debug("%s", "zero size - removing ETA"); /* strlen-1 here to include trailing \0 */ memmove(fmt, fmt + 2, strlen(fmt) - 1); /* flawfinder: ignore */ /* flawfinder: default_format is always \0 terminated */ state->flag.reparse_display = 1; } } memset(&cur_time, 0, sizeof(cur_time)); memset(&next_remotecheck, 0, sizeof(next_remotecheck)); memset(&next_update, 0, sizeof(next_update)); memset(&init_time, 0, sizeof(init_time)); memset(&transfer_elapsed, 0, sizeof(transfer_elapsed)); pv_elapsedtime_read(&cur_time); pv_elapsedtime_copy(&(info.start_time), &cur_time); pv_elapsedtime_copy(&next_remotecheck, &cur_time); pv_elapsedtime_copy(&next_update, &cur_time); pv_elapsedtime_add_nsec(&next_update, (long long) (1000000000.0 * state->control.interval)); ended = false; first_check = true; while (!ended) { /* * Check for remote messages from -R every short while. */ if (pv_elapsedtime_compare(&cur_time, &next_remotecheck) > 0) { pv_remote_check(state); pv_elapsedtime_add_nsec(&next_remotecheck, REMOTE_INTERVAL); } if (1 == state->flag.trigger_exit) break; position_now = pv_watchfd_position(&info); if (position_now < 0) { ended = true; } else { if (first_check) { state->display.initial_offset = position_now; first_check = false; } state->transfer.transferred = position_now; state->transfer.total_written = position_now; } pv_elapsedtime_read(&cur_time); /* Ended - force a display update. */ if (ended) { pv_elapsedtime_copy(&next_update, &cur_time); } /* * Restart the loop after a brief delay, if it's not time to * update the display. */ if (pv_elapsedtime_compare(&cur_time, &next_update) < 0) { pv_nanosleep(50000000); continue; } pv_elapsedtime_add_nsec(&next_update, (long long) (1000000000.0 * state->control.interval)); /* Set the "next update" time to now, if it's in the past. */ if (pv_elapsedtime_compare(&next_update, &cur_time) < 0) pv_elapsedtime_copy(&next_update, &cur_time); /* * Calculate the effective start time: the time we actually * started, plus the total time we spent stopped. */ pv_elapsedtime_add(&init_time, &(info.start_time), &(state->signal.toffset)); /* * Now get the effective elapsed transfer time - current * time minus effective start time. */ pv_elapsedtime_subtract(&transfer_elapsed, &cur_time, &init_time); state->transfer.elapsed_seconds = pv_elapsedtime_seconds(&transfer_elapsed); /* Resize the display, if a resize signal was received. */ if (1 == state->flag.terminal_resized) { unsigned int new_width, new_height; state->flag.terminal_resized = 0; new_width = (unsigned int) (state->control.width); new_height = state->control.height; pv_screensize(&new_width, &new_height); if (new_width > PVDISPLAY_WIDTH_MAX) new_width = PVDISPLAY_WIDTH_MAX; if (!state->control.width_set_manually) state->control.width = (pvdisplay_width_t) new_width; if (!state->control.height_set_manually) state->control.height = new_height; } pv_display(state, ended); } if (!state->control.numeric) pv_tty_write(state, "\n", 1); if (1 == state->flag.trigger_exit) state->status.exit_status |= PV_ERROREXIT_SIGNAL; /* * Free the state structure specific to this file descriptor. * Uunused so far - this is so that in future we could watch * multiple file descriptors similar to pv_watchpid_loop(). */ if (NULL != info.state) { pv_state_free(info.state); info.state = NULL; } /*@-compdestroy@ */ return state->status.exit_status; /*@+compdestroy@ */ /* splint: no leak of info.state as we just freed it above. */ } /* * Watch the progress of all file descriptors in process state->control.watch_pid * and show details about the transfers on standard error according to the * given options. * * Replaces format_string in "state" so that starts with "%N " if it doesn't * already do so. * * Returns nonzero on error. */ int pv_watchpid_loop(pvstate_t state) { const char *original_format_string; char new_format_string[512]; /* flawfinder: ignore */ struct pvwatchfd_s *info_array = NULL; int array_length = 0; int fd_to_idx[FD_SETSIZE]; struct timespec next_update, cur_time; int idx; int prev_displayed_lines, blank_lines; bool first_pass = true; /* * flawfinder rationale (new_format_string): zeroed with memset(), * only written to with pv_snprintf() which checks boundaries, and * explicitly terminated with \0. */ /* * Make sure the process exists first, so we can give an error if * it's not there at the start. */ if (kill(state->control.watch_pid, 0) != 0) { pv_error(state, "%s %u: %s", _("pid"), state->control.watch_pid, strerror(errno)); state->status.exit_status |= PV_ERROREXIT_ACCESS; return PV_ERROREXIT_ACCESS; } /* * Make sure there's a format string, and then insert %N into it if * it's not present. */ original_format_string = NULL != state->control.format_string ? state->control.format_string : state->control.default_format; memset(new_format_string, 0, sizeof(new_format_string)); if (NULL == original_format_string) { (void) pv_snprintf(new_format_string, sizeof(new_format_string), "%%N"); } else if (NULL == strstr(original_format_string, "%N")) { (void) pv_snprintf(new_format_string, sizeof(new_format_string), "%%N %s", original_format_string); } else { (void) pv_snprintf(new_format_string, sizeof(new_format_string), "%s", original_format_string); } new_format_string[sizeof(new_format_string) - 1] = '\0'; if (NULL != state->control.format_string) free(state->control.format_string); state->control.format_string = pv_strdup(new_format_string); /* * Get things ready for the main loop. */ memset(&cur_time, 0, sizeof(cur_time)); memset(&next_update, 0, sizeof(next_update)); pv_elapsedtime_read(&cur_time); pv_elapsedtime_copy(&next_update, &cur_time); pv_elapsedtime_add_nsec(&next_update, (long long) (1000000000.0 * state->control.interval)); for (idx = 0; idx < FD_SETSIZE; idx++) { fd_to_idx[idx] = -1; } prev_displayed_lines = 0; while (true) { int rc, fd, displayed_lines; if (1 == state->flag.trigger_exit) break; pv_elapsedtime_read(&cur_time); if (kill(state->control.watch_pid, 0) != 0) { if (first_pass) { pv_error(state, "%s %u: %s", _("pid"), state->control.watch_pid, strerror(errno)); state->status.exit_status |= PV_ERROREXIT_ACCESS; if (NULL != info_array) free(info_array); return PV_ERROREXIT_ACCESS; } break; } /* * Restart the loop after a brief delay, if it's not time to * update the display. */ if (pv_elapsedtime_compare(&cur_time, &next_update) < 0) { pv_nanosleep(50000000); continue; } pv_elapsedtime_add_nsec(&next_update, (long long) (1000000000.0 * state->control.interval)); /* Set the "next update" time to now, if it's in the past. */ if (pv_elapsedtime_compare(&next_update, &cur_time) < 0) pv_elapsedtime_copy(&next_update, &cur_time); /* Resize the display, if a resize signal was received. */ if (1 == state->flag.terminal_resized) { unsigned int new_width, new_height; state->flag.terminal_resized = 0; new_width = (unsigned int) (state->control.width); new_height = state->control.height; pv_screensize(&new_width, &new_height); if (new_width > PVDISPLAY_WIDTH_MAX) new_width = PVDISPLAY_WIDTH_MAX; state->control.width = (pvdisplay_width_t) new_width; state->control.height = new_height; for (idx = 0; NULL != info_array && idx < array_length; idx++) { if (NULL == info_array[idx].state) continue; info_array[idx].state->control.width = state->control.width; info_array[idx].state->control.height = state->control.height; pv_watchpid_setname(state, &(info_array[idx])); info_array[idx].state->flag.reparse_display = 1; } } rc = pv_watchpid_scanfds(state, state->control.watch_pid, &array_length, &info_array, fd_to_idx); if (rc != 0) { if (first_pass) { pv_error(state, "%s %u: %s", _("pid"), state->control.watch_pid, strerror(errno)); state->status.exit_status |= PV_ERROREXIT_ACCESS; if (NULL != info_array) free(info_array); return PV_ERROREXIT_ACCESS; } break; } first_pass = false; displayed_lines = 0; for (fd = 0; fd < FD_SETSIZE && NULL != info_array; fd++) { off_t position_now; struct timespec init_time, transfer_elapsed; if (displayed_lines >= (int) (state->control.height)) break; idx = fd_to_idx[fd]; if (idx < 0) continue; if (info_array[idx].watch_fd < 0) { /* * Non-displayable fd - just remove if * changed */ if (pv_watchfd_changed(&(info_array[idx]))) { fd_to_idx[fd] = -1; info_array[idx].watch_pid = 0; if (NULL != info_array[idx].state) pv_state_free(info_array[idx].state); /*@-mustfreeonly@ *//* not a leak - we've just free()d it. */ info_array[idx].state = NULL; /*@+mustfreeonly@ */ debug("%s %d: %s", "fd", fd, "removing"); } continue; } if (NULL == info_array[idx].state) { debug("%s %d: %s", "fd", fd, "null state - skipping"); continue; } /* * Displayable fd - display, or remove if changed */ position_now = pv_watchfd_position(&(info_array[idx])); if (position_now < 0) { fd_to_idx[fd] = -1; info_array[idx].watch_pid = 0; if (NULL != info_array[idx].state) pv_state_free(info_array[idx].state); /*@-mustfreeonly@ *//* not a leak - we've just free()d it. */ info_array[idx].state = NULL; /*@+mustfreeonly@ */ debug("%s %d: %s", "fd", fd, "removing"); continue; } info_array[idx].position = position_now; memset(&init_time, 0, sizeof(init_time)); memset(&transfer_elapsed, 0, sizeof(transfer_elapsed)); /* * Calculate the effective start time: the time we actually * started, plus the total time we spent stopped. */ pv_elapsedtime_add(&init_time, &(info_array[idx].start_time), &(state->signal.toffset)); /* * Now get the effective elapsed transfer time - current * time minus effective start time. */ pv_elapsedtime_subtract(&transfer_elapsed, &cur_time, &init_time); if (NULL != info_array[idx].state) { info_array[idx].state->transfer.elapsed_seconds = pv_elapsedtime_seconds(&transfer_elapsed); } if (displayed_lines > 0) { debug("%s", "adding newline"); pv_tty_write(state, "\n", 1); } if (NULL == info_array[idx].state) { debug("%s %d [%d]: %s / %Ld", "fd", fd, idx, "(null state)", position_now); } else { debug("%s %d [%d]: %Lf / %Ld", "fd", fd, idx, info_array[idx].state->transfer.elapsed_seconds, position_now); } if (NULL != info_array[idx].state) { info_array[idx].state->transfer.transferred = position_now; info_array[idx].state->transfer.total_written = position_now; pv_display(info_array[idx].state, false); displayed_lines++; } } /* * Write blank lines if we're writing fewer lines than last * time. */ blank_lines = prev_displayed_lines - displayed_lines; prev_displayed_lines = displayed_lines; if (blank_lines > 0) debug("%s: %d", "adding blank lines", blank_lines); while (blank_lines > 0) { pvdisplay_width_t blank_count; if (displayed_lines > 0) pv_tty_write(state, "\n", 1); for (blank_count = 0; blank_count < state->control.width; blank_count++) pv_tty_write(state, " ", 1); pv_tty_write(state, "\r", 1); blank_lines--; displayed_lines++; } debug("%s: %d", "displayed lines", displayed_lines); while (displayed_lines > 1) { pv_tty_write(state, "\033[A", 3); displayed_lines--; } } /* * Clean up our displayed lines on exit. */ blank_lines = prev_displayed_lines; while (blank_lines > 0) { pvdisplay_width_t blank_count; for (blank_count = 0; blank_count < state->control.width; blank_count++) pv_tty_write(state, " ", 1); pv_tty_write(state, "\r", 1); blank_lines--; if (blank_lines > 0) pv_tty_write(state, "\n", 1); } while (prev_displayed_lines > 1) { pv_tty_write(state, "\033[A", 3); prev_displayed_lines--; } /* * Free the per-fd state. */ for (idx = 0; NULL != info_array && idx < array_length; idx++) { if (NULL == info_array[idx].state) continue; pv_state_free(info_array[idx].state); info_array[idx].state = NULL; } if (NULL != info_array) free(info_array); return 0; } pv-1.9.31/src/pv/number.c000066400000000000000000000164211474702661500151220ustar00rootroot00000000000000/* * Functions for converting strings to numbers. * * Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2025 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #include "config.h" #include "pv.h" #include /* * This function is used instead of the macro from because * including causes weird versioned glibc dependencies on certain * Red Hat systems, complicating package management. */ bool pv_isdigit(char c) { return ((c >= '0') && (c <= '9')) ? true : false; } /* * Return the numeric value of "str", as an off_t, where "str" is expected * to be a sequence of digits (without a thousands separator), possibly with * a fractional part, optionally followed by a units suffix such as "K" for * kibibytes. If "decimal_units" is true, suffixes are interpreted as * multiples of 1000, rather than multiples of 1024. */ off_t pv_getnum_size(const char *str, bool decimal_units) { off_t integral_part = 0; off_t fractional_part = 0; unsigned int fractional_divisor = 1; unsigned int binary_shift = 0; off_t decimal_multiplier = 0; size_t readpos = 0; if (NULL == str) return (off_t) 0; /* Skip any non-numeric leading characters. */ while (str[readpos] != '\0' && (!pv_isdigit(str[readpos]))) readpos++; /* * Parse the integral part of the number - the digits before the * decimal mark or units. */ for (; pv_isdigit(str[readpos]); readpos++) { integral_part = integral_part * 10; integral_part += (off_t) (str[readpos] - '0'); } /* * If the next character is a decimal mark, skip over it and parse * the following digits as the fractional part of the number. * * Note that we hard-code the decimal mark as '.' or ',' so this * will fail if there are any locales whose decimal mark is not one * of those two characters. */ if (('.' == str[readpos]) || (',' == str[readpos])) { readpos++; for (; pv_isdigit(str[readpos]); readpos++) { /* Stop counting below 0.0001. */ if (fractional_divisor < 10000) { fractional_part = fractional_part * 10; fractional_part += (off_t) (str[readpos] - '0'); fractional_divisor = fractional_divisor * 10; } } } /* * Parse any units given (K=KiB=*1024, M=MiB=1024KiB, G=GiB=1024MiB, * T=TiB=1024GiB; replace 1024 with 1000 if decimal_units is true). */ if (str[readpos] != '\0') { /* Skip any spaces or tabs after the digits. */ while ((' ' == str[readpos]) || ('\t' == str[readpos])) readpos++; switch (str[readpos]) { case 'k': case 'K': binary_shift = 10; decimal_multiplier = 1000; break; case 'm': case 'M': binary_shift = 20; decimal_multiplier = 1000000; break; case 'g': case 'G': binary_shift = 30; decimal_multiplier = 1000000000; break; case 't': case 'T': binary_shift = 40; decimal_multiplier = 1000000000000; break; default: break; } } /* * If decimal_units is false, zero decimal_multiplier; if true, zero * binary_shift. This is so we only do one or the other. */ if (decimal_units) { binary_shift = 0; } else { decimal_multiplier = 0; } /* * Binary left-shift the supplied number by "binary_shift" times, i.e. * apply the given units (KiB, MiB, etc) to it, but never shift left * more than 30 at a time to avoid overflows. */ while (binary_shift > 0) { unsigned int shiftby; shiftby = binary_shift; if (shiftby > 30) shiftby = 30; /*@-shiftimplementation@ */ /* * splint note: ignore the fact that the types we are * shifting are signed, because we know they are definitely * not negative. */ integral_part = (off_t) (integral_part << shiftby); fractional_part = (off_t) (fractional_part << shiftby); /*@+shiftimplementation@ */ binary_shift -= shiftby; } /* * Multiply the supplied number by the decimal multiplier. */ if (decimal_multiplier > 0) { integral_part = integral_part * decimal_multiplier; fractional_part = fractional_part * decimal_multiplier; } /* * Add the fractional part, divided by its divisor, to the integral * part, now that we've multiplied everything by the appropriate * units. */ fractional_part = fractional_part / fractional_divisor; integral_part += fractional_part; debug("%s [%s] = %ld", str, decimal_units ? "decimal" : "binary", integral_part); return integral_part; } /* * Return the numeric value of "str", as a double, where "str" is expected * to be a positive decimal number expressing a time interval. */ double pv_getnum_interval(const char *str) { double result = 0.0; double step = 1; if (NULL == str) return 0.0; /* Skip any non-digit characters at the start. */ while (str[0] != '\0' && (!pv_isdigit(str[0]))) str++; /* Parse the digits before the decimal mark. */ for (; pv_isdigit(str[0]); str++) { result = result * 10; result += (double) (str[0] - '0'); } /* If there is no decimal mark, return the value as-is. */ if ((str[0] != '.') && (str[0] != ',')) return result; /* Move past the decimal mark. */ str++; /* Parse the digits after the decimal mark, up to 0.0000001. */ for (; pv_isdigit(str[0]) && step < 1000000; str++) { step = step * 10; result += ((double) (str[0] - '0')) / step; } return result; } /* * Return the numeric value of "str", as an unsigned int, following the same * rules as pv_getnum_size(), expecting "str" to express a value to be used * as a count (such as number of screen columns, or size of a buffer). */ unsigned int pv_getnum_count(const char *str, bool decimal_units) { return (unsigned int) pv_getnum_size(str, decimal_units); } /* * Return true if the given string is a valid number of the given type. */ bool pv_getnum_check(const char *str, pv_numtype type) { if (NULL == str) return false; /* Skip leading spaces and tabs. */ while ((' ' == str[0]) || ('\t' == str[0])) str++; /* If the next character isn't a digit, this isn't a number. */ if (!pv_isdigit(str[0])) return false; /* Skip over the digits. */ for (; pv_isdigit(str[0]); str++); /* * If there's a decimal mark (see note in pv_getnum_size() above), * check that too. */ if (('.' == str[0]) || (',' == str[0])) { /* Bare integers should have no decimal mark. */ if (type == PV_NUMTYPE_BARE_INTEGER) return false; /* Skip the decimal mark, then all digits. */ str++; for (; pv_isdigit(str[0]); str++); } /* If the string ends here, this is a valid number. */ if ('\0' == str[0]) return true; /* A units suffix is only allowed for ANY_WITH_SUFFIX. */ if (type != PV_NUMTYPE_ANY_WITH_SUFFIX) return false; /* Skip trailing spaces or tabs. */ while ((' ' == str[0]) || ('\t' == str[0])) str++; /* Check the units suffix is one we know about. */ switch (str[0]) { case 'k': case 'K': case 'm': case 'M': case 'g': case 'G': case 't': case 'T': str++; break; default: return false; } /* If the string has trailing text, it's not a valid number. */ if (str[0] != '\0') return false; return true; } /* * Return a value representing "amount" as a percentage of "total", i.e. * 100*amount/total. If "total" is zero or less, return 0. */ double pv_percentage(off_t amount, const off_t total) { double amount_as_double; if (total < 1) return 0.0; amount_as_double = (double) amount; amount_as_double *= 100.0; amount_as_double /= (double) total; return amount_as_double; } pv-1.9.31/src/pv/proctitle.c000066400000000000000000000062771474702661500156470ustar00rootroot00000000000000/* * Functions for setting the process title. * * Copyright 2024-2025 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #include "config.h" #include "pv.h" #include #include #include #include #if ! HAVE_SETPROCTITLE extern char **environ; /*@null@*/ static char **base_argv = NULL; static size_t space_available = 0; /* * Assuming the environment comes after the command line arguments, we make * a duplicate of the environment array and all its values, so we can use * the space the environment used to occupy for the process title. * * The logic for this was derived from util-linux-ng. */ /*@-mustfreefresh@ */ /*@-nullstate@ */ void initproctitle(int argc, char **argv) { char **original_environment = environ; char **new_environment; size_t env_array_size, env_index; /* Find the number of entries in the environment array. */ for (env_array_size = 0; environ[env_array_size] != NULL; env_array_size++) continue; /* Allocate a new environment array. */ new_environment = (char **) malloc(sizeof(char *) * (env_array_size + 1)); if (NULL == new_environment) return; /* Duplicate the strings in the environment. */ for (env_index = 0; original_environment[env_index] != NULL; env_index++) { new_environment[env_index] = pv_strdup(original_environment[env_index]); if (NULL == new_environment[env_index]) return; } new_environment[env_index] = NULL; base_argv = argv; /* Work out how much room we have. */ if (env_index > 0) { /* From argv[0] to the end of the last environment value. */ space_available = (size_t) (original_environment[env_index - 1] + strlen(original_environment[env_index - 1]) - argv[0]); /* flawfinder: ignore */ } else if (argc > 0) { /* No environment; from argv[0] to the end of the last argument. */ space_available = (size_t) (argv[argc - 1] + strlen(argv[argc - 1]) - argv[0]); /* flawfinder: ignore */ } /* * flawfinder - we have to trust that the environment and argument * strings are null-terminated, since that's what the OS is supposed * to guarantee. */ environ = new_environment; } /*@+nullstate@ */ /*@+mustfreefresh@ */ /* * Set the process title visible to ps(1), by overwriting argv[0] with the * given printf() format string. */ void setproctitle(const char *format, ...) { char title[1024]; /* flawfinder: ignore */ size_t length; va_list ap; /* flawfinder - buffer is zeroed and users of it are bounded. */ if (NULL == base_argv) return; memset(title, 0, sizeof(title)); va_start(ap, format); (void) vsnprintf(title, sizeof(title) - 1, format, ap); /* flawfinder: ignore */ va_end(ap); /* * flawfinder - the format is explicitly caller-supplied. Callers * of this function are all passing fixed format strings and not * user-supplied formats. */ length = strlen(title); /* flawfinder: ignore */ /* flawfinder - we left a byte at the end to force null-termination. */ if (length > space_available - 2) length = space_available - 2; (void) pv_snprintf(base_argv[0], space_available, "%s -- %s", PACKAGE_NAME, title); if (space_available > length) memset(base_argv[0] + length, 0, space_available - length); } #endif pv-1.9.31/src/pv/signal.c000066400000000000000000000365301474702661500151120ustar00rootroot00000000000000/* * Signal handling functions. * * Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2025 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #include "config.h" #include "pv.h" #include "pv-internal.h" #include #include #include #include #include #include #include #ifdef HAVE_IPC void pv_crs_needreinit(pvstate_t); #endif /*@null@*/ static pvstate_t pv_sig_state = NULL; /* * Ensure that terminal attribute TOSTOP is set. If we have to set it, * record that fact by setting "clear_tty_tostop_on_exit" to 1, so that in * pv_sig_fini() we can turn it back off again. * * In "-c" mode with IPC, then if we have to set TOSTOP, we also tell the * other PV instances about it via the shared "tty_tostop_added" flag, so * those instances can set their own on-exit flag, meaning that if any of * the PV instances set it, the last one to exit will clear it. */ static void pv_sig_ensure_tty_tostop() { struct termios terminal_attributes; if (NULL == pv_sig_state) return; /* Can't look at terminal flags if backgrounded. */ if (1 == pv_sig_state->flag.suspend_stderr) return; if (0 != tcgetattr(STDERR_FILENO, &terminal_attributes)) { debug("%s: %s", "failed to read terminal attributes", strerror(errno)); return; } /* Can't set terminal flags if backgrounded. */ if (1 == pv_sig_state->flag.suspend_stderr) return; if (0 == (terminal_attributes.c_lflag & TOSTOP)) { terminal_attributes.c_lflag |= TOSTOP; if (0 == tcsetattr(STDERR_FILENO, TCSANOW, &terminal_attributes)) { pv_sig_state->flag.clear_tty_tostop_on_exit = 1; debug("%s", "set terminal TOSTOP attribute"); #if HAVE_IPC /* * In "-c" mode with IPC, make all "pv -c" instances * aware that we set TOSTOP, so the last one can * clear it on exit. */ if (pv_sig_state->control.cursor && (NULL != pv_sig_state->cursor.shared) && (!pv_sig_state->cursor.noipc)) { pv_sig_state->cursor.shared->tty_tostop_added = true; } #endif } else { debug("%s: %s", "failed to set terminal TOSTOP attribute", strerror(errno)); } } } /* * Handle SIGTTOU (tty output for background process) by setting the flag to * suspend writes to stderr, so that we can be stopped and backgrounded * without messing up the terminal. On a subsequent SIGCONT we will try * writing to the terminal again, in case we get backgrounded and later get * foregrounded again. * * When we get backgrounded and cause a SIGTTOU, the rest of the pipeline * gets stopped too, so transfers involving pipelines need us to send a * SIGCONT to the rest of the process group here, otherwise backgrounding * stops transfers involving pipes. */ static void pv_sig_ttou( /*@unused@ */ __attribute__((unused)) int s) { if (NULL == pv_sig_state) return; if (1 != pv_sig_state->flag.suspend_stderr) { debug("%s", "SIGTTOU - suspending stderr"); pv_sig_state->flag.suspend_stderr = 1; /* Also tell the SIGCONT handler to do nothing next time. */ pv_sig_state->flag.skip_next_sigcont++; /* Raise an immediate SIGCONT to bring the rest of the pipeline back up. */ /*@-unrecog@ *//* splint doesn't know about killpg() */ if (0 != killpg(getpgrp(), SIGCONT)) { debug("%s: %s", "killpg", strerror(errno)); } /*@+unrecog@ */ } else { debug("%s", "SIGTTOU - but stderr was already suspended"); } } /* * Handle SIGTSTP (stop typed at tty) by storing the time the signal * happened for later use by pv_sig_cont(), and then stopping the process. */ static void pv_sig_tstp( /*@unused@ */ __attribute__((unused)) int s) { if (NULL == pv_sig_state) return; pv_elapsedtime_read(&(pv_sig_state->signal.tstp_time)); if (0 != raise(SIGSTOP)) { debug("%s: %s", "raise", strerror(errno)); } } /* * Handle SIGCONT (continue if stopped) by adding the elapsed time since the * last SIGTSTP to the elapsed time offset, and by trying to write to the * terminal again. */ static void pv_sig_cont( /*@unused@ */ __attribute__((unused)) int s) { struct timespec current_time; struct timespec time_spent_stopped; if (NULL == pv_sig_state) return; if (pv_sig_state->flag.skip_next_sigcont > 0) { debug("%s: %d", "SIGCONT received but ignored - current value of skip_next_sigcont", pv_sig_state->flag.skip_next_sigcont); pv_sig_state->flag.skip_next_sigcont--; return; } else if (pv_sig_state->flag.skip_next_sigcont < 0) { pv_sig_state->flag.skip_next_sigcont = 0; debug("%s", "skip_next_sigcont underrun cleared"); } debug("%s: %d", "SIGCONT received - current value of suspend_stderr", pv_sig_state->flag.suspend_stderr); pv_sig_state->flag.terminal_resized = 1; /* * We can only make the time adjustments if this SIGCONT followed a * SIGTSTP such that we have a stop time. */ if (0 != pv_sig_state->signal.tstp_time.tv_sec) { memset(¤t_time, 0, sizeof(current_time)); memset(&time_spent_stopped, 0, sizeof(time_spent_stopped)); pv_elapsedtime_read(¤t_time); /* time spent stopped = current time - time SIGTSTP received */ pv_elapsedtime_subtract(&time_spent_stopped, ¤t_time, &(pv_sig_state->signal.tstp_time)); /* add time spent stopped the total stopped-time count */ pv_elapsedtime_add(&(pv_sig_state->signal.toffset), &(pv_sig_state->signal.toffset), &time_spent_stopped); /* reset the SIGTSTP receipt time */ pv_elapsedtime_zero(&(pv_sig_state->signal.tstp_time)); } /* * Try resuming our use of stderr, if we had suspended it, but only * if we're now in the foreground. */ if (1 == pv_sig_state->flag.suspend_stderr) { if (pv_in_foreground()) { debug("%s", "SIGCONT - resuming stderr"); pv_sig_state->flag.suspend_stderr = 0; } else { debug("%s", "SIGCONT but still in background - not resuming stderr"); } } if (0 == pv_sig_state->flag.suspend_stderr) { pv_sig_ensure_tty_tostop(); #ifdef HAVE_IPC pv_crs_needreinit(pv_sig_state); #endif } } #ifdef SIGWINCH /* * Handle SIGWINCH (window size changed) by setting a flag. */ static void pv_sig_winch( /*@unused@ */ __attribute__((unused)) int s) { if (NULL == pv_sig_state) return; pv_sig_state->flag.terminal_resized = 1; } #endif /* * Handle termination signals by setting the abort flag. */ static void pv_sig_term( /*@unused@ */ __attribute__((unused)) int s) { if (NULL == pv_sig_state) return; pv_sig_state->flag.trigger_exit = 1; } #ifdef PV_REMOTE_CONTROL /* * Handle a SIGUSR2 by setting a flag to say we received it, after recording * the sending PID. */ static void pv_sig_usr2( /*@unused@ */ __attribute__((unused)) int sig, siginfo_t * info, /*@unused@ */ __attribute__((unused)) void *ucontext) { if (NULL == pv_sig_state) return; if (NULL == info) return; pv_sig_state->signal.sender = info->si_pid; pv_sig_state->signal.rxusr2 = 1; } /* * Return true if a SIGUSR2 signal has been received since the last time * this function was called, populating *pid with the sending PID if so. */ bool pv_sigusr2_received(pvstate_t state, pid_t * pid) { if (NULL == state) return false; if (0 == state->signal.rxusr2) return false; if (NULL != pid) *pid = state->signal.sender; state->signal.rxusr2 = 0; return true; } #endif /* * Handle alarm signals by doing nothing. * * Note that we have to use a signal handler like this, instead of using * SIG_IGN, because if we ignore the signal entirely, it does nothing, * including not interrupting blocking write() calls - which is what we're * using alarm signals for in the first place. */ static void pv_sig_alrm( /*@unused@ */ __attribute__((unused)) int s) { debug("%s", "SIGALRM received"); /* Do nothing. */ } /* * Initialise signal handling. */ void pv_sig_init(pvstate_t state) { static struct sigaction sa; memset(&sa, 0, sizeof(sa)); /* * Note that wherever we use a "struct sigaction", we declare it * static and explicitly zero it before use, because it may contain * deeper structures (e.g. "sigset_t") which trigger splint * warnings about potential memory leaks. */ pv_sig_state = state; pv_sig_state->flag.suspend_stderr = 0; pv_elapsedtime_zero(&(pv_sig_state->signal.tstp_time)); pv_elapsedtime_zero(&(pv_sig_state->signal.toffset)); /* * Note that we cast all sigemptyset() and sigaction() return values * to void, because there's nothing we can reasonably do about any * conceivable error they may return. */ /* * Ignore SIGPIPE, so we don't die if the output is a pipe and the * other end closes unexpectedly. */ sa.sa_handler = SIG_IGN; (void) sigemptyset(&(sa.sa_mask)); sa.sa_flags = 0; (void) sigaction(SIGPIPE, &sa, &(pv_sig_state->signal.old_sigpipe)); /* * Handle SIGTTOU by continuing with output switched off, so that we * can be stopped and backgrounded without messing up the terminal. */ pv_sig_state->flag.skip_next_sigcont = 0; sa.sa_handler = pv_sig_ttou; (void) sigemptyset(&(sa.sa_mask)); sa.sa_flags = 0; (void) sigaction(SIGTTOU, &sa, &(pv_sig_state->signal.old_sigttou)); /* * Handle SIGTSTP by storing the time the signal happened for later * use by pv_sig_cont(), and then stopping the process. */ sa.sa_handler = pv_sig_tstp; (void) sigemptyset(&(sa.sa_mask)); sa.sa_flags = 0; (void) sigaction(SIGTSTP, &sa, &(pv_sig_state->signal.old_sigtstp)); /* * Handle SIGCONT by adding the elapsed time since the last SIGTSTP * to the elapsed time offset, and by trying to write to the * terminal again. */ sa.sa_handler = pv_sig_cont; (void) sigemptyset(&(sa.sa_mask)); sa.sa_flags = 0; (void) sigaction(SIGCONT, &sa, &(pv_sig_state->signal.old_sigcont)); /* * Handle SIGWINCH by setting a flag to let the main loop know it * has to reread the terminal size. */ #ifdef SIGWINCH sa.sa_handler = pv_sig_winch; (void) sigemptyset(&(sa.sa_mask)); sa.sa_flags = 0; (void) sigaction(SIGWINCH, &sa, &(pv_sig_state->signal.old_sigwinch)); #endif /* * Handle SIGINT, SIGHUP, SIGTERM by setting a flag to let the * main loop know it should quit now. */ sa.sa_handler = pv_sig_term; (void) sigemptyset(&(sa.sa_mask)); sa.sa_flags = 0; (void) sigaction(SIGINT, &sa, &(pv_sig_state->signal.old_sigint)); sa.sa_handler = pv_sig_term; (void) sigemptyset(&(sa.sa_mask)); sa.sa_flags = 0; (void) sigaction(SIGHUP, &sa, &(pv_sig_state->signal.old_sighup)); sa.sa_handler = pv_sig_term; (void) sigemptyset(&(sa.sa_mask)); sa.sa_flags = 0; (void) sigaction(SIGTERM, &sa, &(pv_sig_state->signal.old_sigterm)); #ifdef PV_REMOTE_CONTROL /* * Handle SIGUSR2 by setting a flag to say the signal has been * received, and storing the sending process's PID. */ memset(&sa, 0, sizeof(sa)); sa.sa_sigaction = pv_sig_usr2; (void) sigemptyset(&(sa.sa_mask)); /*@-unrecog@ *//* splint doesn't know about SA_SIGINFO */ sa.sa_flags = SA_SIGINFO; /*@+unrecog@ */ (void) sigaction(SIGUSR2, &sa, &(pv_sig_state->signal.old_sigusr2)); memset(&sa, 0, sizeof(sa)); #endif /* * Ensure that the TOSTOP terminal attribute is set, so that a * SIGTTOU signal will be raised if we try to write to the terminal * while backgrounded (see the SIGTTOU handler above). */ pv_sig_ensure_tty_tostop(); /* * Handle SIGALRM by doing nothing, so we can use alarms or interval * timers to interrupt blocking writes (returning EINTR). */ sa.sa_handler = pv_sig_alrm; (void) sigemptyset(&(sa.sa_mask)); sa.sa_flags = 0; (void) sigaction(SIGALRM, &sa, &(pv_sig_state->signal.old_sigalrm)); } /* * Shut down signal handling. If we had set the TOSTOP terminal attribute, * and we're in the foreground, also turn that off (though if we're in * cursor "-c" mode, only do that if we're the last PV instance, otherwise * leave the terminal alone). */ void pv_sig_fini( /*@unused@ */ __attribute__((unused)) pvstate_t state) { bool need_to_clear_tostop = false; if (NULL == pv_sig_state) return; (void) sigaction(SIGPIPE, &(pv_sig_state->signal.old_sigpipe), NULL); (void) sigaction(SIGTTOU, &(pv_sig_state->signal.old_sigttou), NULL); (void) sigaction(SIGTSTP, &(pv_sig_state->signal.old_sigtstp), NULL); (void) sigaction(SIGCONT, &(pv_sig_state->signal.old_sigcont), NULL); #ifdef SIGWINCH (void) sigaction(SIGWINCH, &(pv_sig_state->signal.old_sigwinch), NULL); #endif (void) sigaction(SIGINT, &(pv_sig_state->signal.old_sigint), NULL); (void) sigaction(SIGHUP, &(pv_sig_state->signal.old_sighup), NULL); (void) sigaction(SIGTERM, &(pv_sig_state->signal.old_sigterm), NULL); #ifdef PV_REMOTE_CONTROL (void) sigaction(SIGUSR2, &(pv_sig_state->signal.old_sigusr2), NULL); #endif (void) sigaction(SIGALRM, &(pv_sig_state->signal.old_sigalrm), NULL); need_to_clear_tostop = (1 == pv_sig_state->flag.clear_tty_tostop_on_exit) ? true : false; if (pv_sig_state->control.cursor) { #ifdef HAVE_IPC /* * We won't clear TOSTOP if other "pv -c" instances * were still running when pv_crs_fini() ran. * * TODO: we need a better way to determine if we're the last * "pv" left. */ if (pv_sig_state->control.cursor && pv_sig_state->cursor.pvcount > 1) { need_to_clear_tostop = false; } #else /* !HAVE_IPC */ /* * Without IPC we can't tell whether the other "pv -c" * instances in the pipeline have finished so we will just * have to clear TOSTOP anyway. */ #endif /* !HAVE_IPC */ } debug("%s=%s", "need_to_clear_tostop", need_to_clear_tostop ? "true" : "false"); if (need_to_clear_tostop && pv_in_foreground()) { struct termios terminal_attributes; debug("%s", "about to to clear TOSTOP terminal attribute if it is set"); if (0 != tcgetattr(STDERR_FILENO, &terminal_attributes)) { debug("%s: %s", "tcgetattr", strerror(errno)); } else if (0 != (terminal_attributes.c_lflag & TOSTOP)) { terminal_attributes.c_lflag -= TOSTOP; if (0 == tcsetattr(STDERR_FILENO, TCSANOW, &terminal_attributes)) { debug("%s", "cleared TOSTOP terminal attribute"); } else { debug("%s: %s", "failed to clear TOSTOP terminal attribute", strerror(errno)); } } pv_sig_state->flag.clear_tty_tostop_on_exit = 0; } } /* * Stop reacting to SIGTSTP and SIGCONT. */ void pv_sig_nopause(void) { sigset_t signal_set, signal_oldset; debug("%s", "blocking SIGTSTP, SIGCONT"); (void) sigemptyset(&signal_set); (void) sigaddset(&signal_set, SIGTSTP); (void) sigaddset(&signal_set, SIGCONT); if (0 != sigprocmask(SIG_BLOCK, &signal_set, &signal_oldset)) { debug("%s: %s", "failed to set signal mask", strerror(errno)); } } /* * Start catching SIGTSTP and SIGCONT again. */ void pv_sig_allowpause(void) { sigset_t signal_set, signal_oldset; debug("%s", "unblocking SIGTSTP, SIGCONT"); (void) sigemptyset(&signal_set); (void) sigaddset(&signal_set, SIGTSTP); (void) sigaddset(&signal_set, SIGCONT); if (0 != sigprocmask(SIG_UNBLOCK, &signal_set, &signal_oldset)) { debug("%s: %s", "failed to set signal mask", strerror(errno)); } } /* * If we have suspended stderr, check every second or so to see whether we * can write to the terminal again - this is so that if we get backgrounded, * then foregrounded again, we start writing to the terminal again. */ void pv_sig_checkbg(void) { static time_t next_check = 0; if (NULL == pv_sig_state) return; if (time(NULL) < next_check) return; next_check = time(NULL) + 1; if (0 == pv_sig_state->flag.suspend_stderr) return; if (!pv_in_foreground()) return; debug("%s: %s", "pv_sig_checkbg", "attempting to resume stderr"); pv_sig_state->flag.suspend_stderr = 0; pv_sig_ensure_tty_tostop(); #ifdef HAVE_IPC pv_crs_needreinit(pv_sig_state); #endif } pv-1.9.31/src/pv/state.c000066400000000000000000000410011474702661500147420ustar00rootroot00000000000000/* * State management functions. * * Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2025 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #include "config.h" #include "pv.h" #include "pv-internal.h" /* We do not set this because it breaks "dd" - see below. */ /* #undef MAKE_OUTPUT_NONBLOCKING */ #include #include #include #include #include #include /* alloc / realloc history buffer */ static void pv_alloc_history(pvstate_t state) { if (NULL != state->calc.history) free(state->calc.history); state->calc.history = NULL; state->calc.history = calloc((size_t) (state->calc.history_len), sizeof(state->calc.history[0])); if (NULL == state->calc.history) { /*@-mustfreefresh@ */ /* * splint note: the gettext calls made by _() cause memory * leak warnings, but in this case it's unavoidable, and * mitigated by the fact we only translate each string once. */ fprintf(stderr, "%s: %s: %s\n", state->status.program_name, _("history structure allocation failed"), strerror(errno)); /*@+mustfreefresh@ */ return; } state->calc.history_first = state->calc.history_last = 0; state->calc.history[0].elapsed_sec = 0.0; /* to be safe, memset() not recommended for doubles */ } /* * Clear the calculated parts of a state structure. */ void pv_state_reset(pvstate_t state) { if (NULL == state) return; state->flag.reparse_display = 1; state->status.current_input_file = -1; state->display.initial_offset = 0; state->display.display_visible = false; state->extra_display.initial_offset = 0; state->extra_display.display_visible = false; /* * Explicitly set important floating point values to 0, as memset() * is not recommended for this. */ state->calc.transfer_rate = 0.0; state->calc.average_rate = 0.0; state->calc.prev_elapsed_sec = 0.0; state->calc.prev_rate = 0.0; state->calc.prev_trans = 0.0; state->calc.current_avg_rate = 0.0; state->calc.rate_min = 0.0; state->calc.rate_max = 0.0; state->calc.rate_sum = 0.0; state->calc.ratesquared_sum = 0.0; state->calc.measurements_taken = 0; state->calc.prev_transferred = 0; state->calc.percentage = 0.0; state->calc.history_first = state->calc.history_last = 0; if (NULL != state->calc.history) { state->calc.history[0].elapsed_sec = 0.0; } state->transfer.elapsed_seconds = 0.0; state->transfer.read_position = 0; state->transfer.write_position = 0; state->transfer.to_write = 0; state->transfer.written = 0; state->transfer.total_written = 0; state->transfer.written_but_not_consumed = 0; state->transfer.read_errors_in_a_row = 0; state->transfer.last_read_skip_fd = 0; #ifdef HAVE_SPLICE state->transfer.splice_failed_fd = -1; #endif /* HAVE_SPLICE */ state->transfer.line_positions_length = 0; state->transfer.line_positions_head = 0; state->transfer.last_output_position = 0; } /* * Create a new state structure, and return it, or 0 (NULL) on error. */ pvstate_t pv_state_alloc(const char *program_name) { pvstate_t state; state = calloc(1, sizeof(*state)); if (NULL == state) return NULL; memset(state, 0, sizeof(*state)); /* splint 3.1.2 thinks this is required for some reason. */ if (NULL != state->status.program_name) { free(state->status.program_name); } state->status.program_name = pv_strdup(program_name); if (NULL == state->status.program_name) { free(state); return NULL; } state->control.watch_pid = 0; state->control.watch_fd = -1; state->control.output_fd = -1; #ifdef HAVE_IPC state->cursor.shmid = -1; state->cursor.pvcount = 1; #endif /* HAVE_IPC */ state->cursor.lock_fd = -1; pv_state_reset(state); /* * Get the current working directory, if possible, as a base for * showing relative filenames with --watchfd. */ if (NULL == getcwd(state->status.cwd, PV_SIZEOF_CWD - 1)) { /* failed - will always show full path */ state->status.cwd[0] = '\0'; } if ('\0' == state->status.cwd[1]) { /* CWD is root directory - always show full path */ state->status.cwd[0] = '\0'; } state->status.cwd[PV_SIZEOF_CWD - 1] = '\0'; return state; } /* * Free a state structure, after which it can no longer be used. */ void pv_state_free(pvstate_t state) { if (0 == state) return; /* * Close the output file first, so we can report any errors while we * still know the program name and output filename. */ if (state->control.output_fd >= 0) { if (STDOUT_FILENO != state->control.output_fd) { if (close(state->control.output_fd) < 0) { fprintf(stderr, "%s: %s: %s\n", state->status.program_name, NULL == state->control.output_name ? "(null)" : state->control.output_name, strerror(errno)); } } state->control.output_fd = -1; } if (NULL != state->control.output_name) { free(state->control.output_name); state->control.output_name = NULL; } if (NULL != state->status.program_name) free(state->status.program_name); state->status.program_name = NULL; if (NULL != state->display.display_buffer) free(state->display.display_buffer); state->display.display_buffer = NULL; if (NULL != state->extra_display.display_buffer) free(state->extra_display.display_buffer); state->extra_display.display_buffer = NULL; if (NULL != state->control.name) { free(state->control.name); state->control.name = NULL; } if (NULL != state->control.default_bar_style) { free(state->control.default_bar_style); state->control.default_bar_style = NULL; } if (NULL != state->control.format_string) { free(state->control.format_string); state->control.format_string = NULL; } if (NULL != state->control.extra_format_string) { free(state->control.extra_format_string); state->control.extra_format_string = NULL; } /*@-keeptrans@ */ if (NULL != state->transfer.transfer_buffer) free(state->transfer.transfer_buffer); state->transfer.transfer_buffer = NULL; /*@+keeptrans@ */ /* splint - explicitly freeing this structure, so free() here is OK. */ if (NULL != state->transfer.line_positions) free(state->transfer.line_positions); state->transfer.line_positions = NULL; if (NULL != state->calc.history) free(state->calc.history); state->calc.history = NULL; if (NULL != state->files.filename) { unsigned int file_idx; for (file_idx = 0; file_idx < state->files.file_count; file_idx++) { /*@-unqualifiedtrans@ */ free(state->files.filename[file_idx]); /*@+unqualifiedtrans@ */ /* splint: see similar code below. */ } free(state->files.filename); state->files.filename = NULL; } free(state); return; } /* * Set the formatting string, given a set of old-style formatting options. */ void pv_state_set_format(pvstate_t state, bool progress, bool timer, bool eta, bool fineta, bool rate, bool average_rate, bool bytes, bool bufpercent, size_t lastwritten, /*@null@ */ const char *name) { #define PV_ADDFORMAT(x,y) if (x) { \ if (state->control.default_format[0] != '\0') \ (void) pv_strlcat(state->control.default_format, " ", sizeof(state->control.default_format)); \ (void) pv_strlcat(state->control.default_format, y, sizeof(state->control.default_format)); \ } state->control.default_format[0] = '\0'; if (false == state->control.numeric) { /* Standard progress display mode (without "--numeric"). */ /* * Add the format strings for the enabled options in a * standard order. */ PV_ADDFORMAT(name, "%N"); PV_ADDFORMAT(bytes, "%b"); PV_ADDFORMAT(bufpercent, "%T"); PV_ADDFORMAT(timer, "%t"); PV_ADDFORMAT(rate, "%r"); PV_ADDFORMAT(average_rate, "%a"); PV_ADDFORMAT(progress, "%p"); PV_ADDFORMAT(eta, "%e"); PV_ADDFORMAT(fineta, "%I"); if (lastwritten > 0) { char buf[16]; /* flawfinder: ignore */ memset(buf, 0, sizeof(buf)); (void) pv_snprintf(buf, sizeof(buf), "%%%uA", (unsigned int) lastwritten); PV_ADDFORMAT(lastwritten > 0, buf); /* * flawfinder rationale: large enough for string, * zeroed before use, only written to by * pv_snprintf() with the right buffer length. */ } } else { /* Numeric mode has different behaviour. */ PV_ADDFORMAT(timer, "%t"); PV_ADDFORMAT(bytes, "%b"); PV_ADDFORMAT(rate, "%r"); PV_ADDFORMAT(!(bytes || rate), "%{progress-amount-only}"); } debug("%s: [%s]", "default format set", state->control.default_format); /* Free any previously set name. */ if (NULL != state->control.name) { free(state->control.name); state->control.name = NULL; } /* Set a new name if one was given. */ if (NULL != name) state->control.name = pv_strdup(name); /* Tell pv_format() that the format has changed. */ state->flag.reparse_display = 1; } void pv_state_force_set(pvstate_t state, bool val) { state->control.force = val; } void pv_state_cursor_set(pvstate_t state, bool val) { state->control.cursor = val; } void pv_state_show_stats_set(pvstate_t state, bool val) { state->control.show_stats = val; } void pv_state_numeric_set(pvstate_t state, bool val) { state->control.numeric = val; } void pv_state_wait_set(pvstate_t state, bool val) { state->control.wait = val; } void pv_state_delay_start_set(pvstate_t state, double val) { state->control.delay_start = val; } void pv_state_rate_gauge_set(pvstate_t state, bool val) { state->control.rate_gauge = val; } void pv_state_linemode_set(pvstate_t state, bool val) { state->control.linemode = val; } void pv_state_bits_set(pvstate_t state, bool bits) { state->control.bits = bits; } void pv_state_decimal_units_set(pvstate_t state, bool decimal_units) { state->control.decimal_units = decimal_units; } void pv_state_null_terminated_lines_set(pvstate_t state, bool val) { state->control.null_terminated_lines = val; } void pv_state_no_display_set(pvstate_t state, bool val) { state->control.no_display = val; } void pv_state_skip_errors_set(pvstate_t state, unsigned int val) { state->control.skip_errors = val; } void pv_state_error_skip_block_set(pvstate_t state, off_t val) { state->control.error_skip_block = val; } void pv_state_stop_at_size_set(pvstate_t state, bool val) { state->control.stop_at_size = val; } void pv_state_sync_after_write_set(pvstate_t state, bool val) { state->control.sync_after_write = val; } void pv_state_direct_io_set(pvstate_t state, bool val) { state->control.direct_io = val; state->control.direct_io_changed = true; } void pv_state_discard_input_set(pvstate_t state, bool val) { state->control.discard_input = val; } void pv_state_rate_limit_set(pvstate_t state, off_t val) { state->control.rate_limit = val; } void pv_state_target_buffer_size_set(pvstate_t state, size_t val) { state->control.target_buffer_size = val; } void pv_state_no_splice_set(pvstate_t state, bool val) { state->control.no_splice = val; } void pv_state_size_set(pvstate_t state, off_t val) { state->control.size = val; } void pv_state_interval_set(pvstate_t state, double val) { state->control.interval = val; } void pv_state_width_set(pvstate_t state, unsigned int val, bool was_set_manually) { if (val > PVDISPLAY_WIDTH_MAX) val = PVDISPLAY_WIDTH_MAX; state->control.width = (pvdisplay_width_t) val; state->control.width_set_manually = was_set_manually; } void pv_state_height_set(pvstate_t state, unsigned int val, bool was_set_manually) { state->control.height = val; state->control.height_set_manually = was_set_manually; } void pv_state_name_set(pvstate_t state, /*@null@ */ const char *val) { if (NULL != state->control.name) { free(state->control.name); state->control.name = NULL; } if (NULL != val) state->control.name = pv_strdup(val); } void pv_state_default_bar_style_set(pvstate_t state, /*@null@ */ const char *val) { if (NULL != state->control.default_bar_style) { free(state->control.default_bar_style); state->control.default_bar_style = NULL; } if (NULL != val) state->control.default_bar_style = pv_strdup(val); } void pv_state_format_string_set(pvstate_t state, /*@null@ */ const char *val) { if (NULL != state->control.format_string) { free(state->control.format_string); state->control.format_string = NULL; } if (NULL != val) state->control.format_string = pv_strdup(val); } void pv_state_extra_display_set(pvstate_t state, /*@null@ */ const char *val) { const char *word_start; size_t offset; if (NULL != state->control.extra_format_string) { free(state->control.extra_format_string); state->control.extra_format_string = NULL; } state->control.extra_displays = 0; if (NULL == val) return; word_start = val; while (NULL != word_start && '\0' != word_start[0]) { offset = 0; while ('\0' != word_start[offset] && ',' != word_start[offset] && ':' != word_start[offset]) offset++; if (((11 == offset) && (0 == strncmp(word_start, "windowtitle", 11))) || ((6 == offset) && (0 == strncmp(word_start, "window", 6))) ) { debug("%s", "enabling windowtitle"); state->control.extra_displays |= PV_DISPLAY_WINDOWTITLE; } else if (((12 == offset) && (0 == strncmp(word_start, "processtitle", 12))) || ((9 == offset) && (0 == strncmp(word_start, "proctitle", 9))) || ((7 == offset) && (0 == strncmp(word_start, "process", 7))) || ((4 == offset) && (0 == strncmp(word_start, "proc", 4))) ) { debug("%s", "enabling processtitle"); state->control.extra_displays |= PV_DISPLAY_PROCESSTITLE; } switch (word_start[offset]) { case ',': offset++; break; case ':': offset++; debug("%s: [%s]", "setting extra_format_string", word_start + offset); state->control.extra_format_string = pv_strdup(word_start + offset); word_start = NULL; break; default: word_start = NULL; break; } if (NULL != word_start) word_start += offset; } } void pv_state_watch_pid_set(pvstate_t state, pid_t val) { state->control.watch_pid = val; } void pv_state_watch_fd_set(pvstate_t state, int val) { state->control.watch_fd = val; } void pv_state_output_set(pvstate_t state, int fd, const char *name) { /* * Close any previous output file first, so we can report any errors * before we store the new output filename. */ if (state->control.output_fd >= 0 && state->control.output_fd != STDOUT_FILENO) { if (close(state->control.output_fd) < 0) { fprintf(stderr, "%s: %s: %s\n", state->status.program_name, NULL == state->control.output_name ? "(null)" : state->control.output_name, strerror(errno)); } } if (NULL != state->control.output_name) free(state->control.output_name); state->control.output_fd = fd; state->control.output_name = pv_strdup(name); #ifdef MAKE_OUTPUT_NONBLOCKING /* * Try and make the output use non-blocking I/O. * * Note that this can cause problems with (broken) applications * such as dd when used in a pipeline. */ fcntl(state->control.output_fd, F_SETFL, O_NONBLOCK | fcntl(state->control.output_fd, F_GETFL)); #endif /* MAKE_OUTPUT_NONBLOCKING */ } void pv_state_average_rate_window_set(pvstate_t state, unsigned int val) { if (val < 1) val = 1; state->control.average_rate_window = val; if (val >= 20) { state->calc.history_len = (size_t) (val / 5 + 1); state->control.history_interval = 5; } else { state->calc.history_len = (size_t) (val + 1); state->control.history_interval = 1; } pv_alloc_history(state); } void pv_state_set_can_display_utf8(pvstate_t state, bool val) { state->control.can_display_utf8 = val; } /* * Set the array of input files. */ void pv_state_inputfiles(pvstate_t state, unsigned int input_file_count, const char **input_files) { unsigned int file_idx; if (NULL != state->files.filename) { for (file_idx = 0; file_idx < state->files.file_count; file_idx++) { /*@-unqualifiedtrans@ */ free(state->files.filename[file_idx]); /*@+unqualifiedtrans@ */ /* * TODO: find a way to tell splint the array * contents are "only" and "null" as well as the * array itself. */ } free(state->files.filename); state->files.filename = NULL; state->files.file_count = 0; } state->files.filename = calloc((size_t) (input_file_count + 1), sizeof(char *)); if (NULL == state->files.filename) { /*@-mustfreefresh@ *//* see similar _() issue above */ fprintf(stderr, "%s: %s: %s\n", state->status.program_name, _("file list allocation failed"), strerror(errno)); /*@+mustfreefresh@ */ return; } for (file_idx = 0; file_idx < input_file_count; file_idx++) { /*@-nullstate@ */ state->files.filename[file_idx] = pv_strdup(input_files[file_idx]); if (NULL == state->files.filename[file_idx]) { /*@-mustfreefresh@ *//* see similar _() issue above */ fprintf(stderr, "%s: %s: %s\n", state->status.program_name, _("file list allocation failed"), strerror(errno)); /*@+mustfreefresh@ */ return; } } state->files.file_count = input_file_count; } /*@+nullstate@*/ /* splint: see unqualifiedtrans note by free() above. */ pv-1.9.31/src/pv/string.c000066400000000000000000000173671474702661500151520ustar00rootroot00000000000000/* * Functions for portably managing strings. * * Copyright 2023-2025 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #include "config.h" #include "pv.h" #include #include #include #include #if defined(ENABLE_NLS) && defined(HAVE_WCHAR_H) #include #if defined(HAVE_WCTYPE_H) #include #endif #endif /* * Wrapper for sprintf(), falling back to sprintf() on systems without that * function. * * Returns -1 if "str" or "format" are NULL or if "size" is 0. * * Otherwise, ensures that the buffer "str" is always terminated with a '\0' * byte, before returning whatever the system's vsnprintf() or vsprintf() * returned. */ int pv_snprintf(char *str, size_t size, const char *format, ...) { va_list ap; int ret; if (NULL == str) return -1; if (0 == size) return -1; if (NULL == format) return -1; str[0] = '\0'; va_start(ap, format); #ifdef HAVE_VSNPRINTF ret = vsnprintf(str, size, format, ap); /* flawfinder: ignore */ #else /* ! HAVE_VSNPRINTF */ ret = vsprintf(str, format, ap); /* flawfinder: ignore */ #endif /* HAVE_VSNPRINTF */ va_end(ap); str[size - 1] = '\0'; /* * flawfinder rationale: this function replaces snprintf so * explicitly takes a non-constant format; also it explicitly * \0-terminates the output buffer, as flawfinder warns that some * sprintf() variants do not. */ return ret; } /* * Implementation of strlcat() where it is unavailable: append a string to a * buffer, constraining the buffer to a particular size and ensuring * termination with '\0'. * * Appends the string "src" to the buffer "dst", assuming "dst" is "dstsize" * bytes long, and ensuring that "dst" is always terminated with a '\0' * byte. * * Returns the intended length of the string, not including the terminating * '\0', i.e. strlen(src)+strlen(dst), regardless of whether truncation * occurred. * * Note that this implementation has the side effect that "dst" will always * be terminated with a '\0' even if "src" was zero bytes long. */ size_t pv_strlcat(char *dst, const char *src, size_t dstsize) { #ifdef HAVE_STRLCAT size_t result; result = strlcat(dst, src, dstsize); if ((NULL != dst) && (dstsize > 0)) dst[dstsize - 1] = '\0'; return result; #else size_t dstlen, srclen, available; if (NULL == dst) return 0; if (NULL == src) return 0; if (0 == dstsize) return 0; dst[dstsize - 1] = '\0'; dstlen = strlen(dst); /* flawfinder: ignore */ srclen = strlen(src); /* flawfinder: ignore */ /* * flawfinder rationale: src must explicitly be \0 terminated, so * this is up to the caller; with dst, we enforce \0 termination * before calling strlen(). */ available = dstsize - dstlen; if (available > 1) (void) pv_snprintf(dst + dstlen, available, "%.*s", available - 1, src); return dstlen + srclen; #endif } /* * Allocate and return a duplicate of a \0-terminated string, ensuring that * the duplicate is also \0-terminated. Returns NULL on error. */ /*@null@ */ /*@only@ */ char *pv_strdup(const char *original) { size_t length; char *duplicate; if (NULL == original) { errno = EINVAL; return NULL; } length = strlen(original); /* flawfinder: ignore */ /* * flawfinder rationale: the original string is explicitly required * to be \0 terminated. */ duplicate = calloc(1, 1 + length); if (NULL == duplicate) return NULL; memcpy(duplicate, original, length); /* flawfinder: ignore */ /* * flawfinder rationale: the buffer is explicitly allocated to be * large enough. */ duplicate[length] = '\0'; return duplicate; } /* * Return a pointer to the last matching character in the buffer, or NULL if * not found. */ /*@null@ */ /*@temp@ */ void *pv_memrchr(const void *buffer, int match, size_t length) { #ifdef HAVE_MEMRCHR /*@-unrecog@ *//* splint doesn't know of memrchr() */ return memrchr(buffer, match, length); /*@+unrecog@ */ #else unsigned char *ptr; if (length < 1) return NULL; ptr = ((unsigned char *) buffer) + length - 1; while (ptr >= (unsigned char *) buffer) { if ((int) (ptr[0]) == match) return (void *) ptr; ptr--; } return NULL; #endif } /* * Return the number of display columns needed to show the * non-null-terminated string "string" whose length in bytes is "bytes". * * Skips ECMA-48 CSI (ESC [ ...) sequences, but any other control characters * are treated as printable. * * To do this, we convert it to a wide character string, and use the wide * character display width function "wcswidth()" on it. * * If NLS is disabled, or the string cannot be converted, this just returns * the value of "bytes". * * Note that this function uses internal buffers if the string is short * enough, otherwise it has to call malloc() and free(), so it becomes less * efficient with larger strings. */ size_t pv_strwidth(const char *string, size_t bytes) { char *allocated_raw = NULL; static char internal_raw[256]; /* flawfinder: ignore - bounded */ char *raw_string = NULL; size_t read_pos, write_pos; size_t raw_bytes, width; #if defined(ENABLE_NLS) && defined(HAVE_WCHAR_H) size_t wide_char_count; size_t wide_string_buffer_size; wchar_t *allocated_wide = NULL; static wchar_t internal_wide[256]; /* flawfinder: ignore - bounded */ wchar_t *wide_string = NULL; #endif /* defined(ENABLE_NLS) && defined(HAVE_WCHAR_H) */ if (NULL == string) return 0; if (0 == bytes) return 0; if (bytes < sizeof(internal_raw) - 1) { raw_string = internal_raw; } else { allocated_raw = calloc(1, 1 + bytes); if (NULL == allocated_raw) return bytes; raw_string = allocated_raw; } /* Copy the original string, skipping ECMA-48 CSI sequences. */ for (read_pos = 0, write_pos = 0; read_pos < bytes; read_pos++) { if ((string[read_pos] != '\033') || (read_pos >= bytes - 1) || (string[read_pos + 1] != '[')) { raw_string[write_pos++] = string[read_pos]; continue; } read_pos += 2; while ((read_pos < bytes - 1) && ((string[read_pos] >= '0' && string[read_pos] <= '9') || (';' == string[read_pos]) ) ) { read_pos++; } } raw_string[write_pos] = '\0'; raw_bytes = write_pos; width = raw_bytes; #if defined(ENABLE_NLS) && defined(HAVE_WCHAR_H) /*@-nullpass@ */ /* * splint note: mbstowcs() manual page on Linux explicitly says it * takes NULL. */ wide_char_count = mbstowcs(NULL, raw_string, 0); /*@+nullpass@ */ if (wide_char_count == (size_t) -1) { debug("%s: %s: %s", "mbstowcs", raw_string, strerror(errno)); if (NULL != allocated_raw) free(allocated_raw); return raw_bytes; } wide_string_buffer_size = sizeof(*wide_string) * (1 + wide_char_count); if (wide_string_buffer_size < sizeof(internal_wide)) { wide_string = internal_wide; } else { allocated_wide = malloc(wide_string_buffer_size); if (NULL == allocated_wide) { perror("malloc"); if (NULL != allocated_raw) free(allocated_raw); return raw_bytes; } wide_string = allocated_wide; } memset(wide_string, 0, wide_string_buffer_size); if (mbstowcs(wide_string, raw_string, 1 + wide_char_count) == (size_t) -1) { debug("%s: %s: %s", "mbstowcs", raw_string, strerror(errno)); } else if (NULL != wide_string) { /*@-unrecog@ *//* splint seems unable to see the prototype. */ width = wcswidth(wide_string, wide_char_count); /*@+unrecog@ */ } else { width = 0; } if (NULL != allocated_wide) free(allocated_wide); #endif /* defined(ENABLE_NLS) && defined(HAVE_WCHAR_H) */ if (NULL != allocated_raw) free(allocated_raw); return width; } /* * Return true if the character is printable. This function is used instead * of the macro from to avoid causing versioned glibc dependencies * on some systems. */ bool pv_isprint(char c) { return ((c >= (char) 32) && (c <= (char) 126)) ? true : false; } pv-1.9.31/src/pv/transfer.c000066400000000000000000001125671474702661500154660ustar00rootroot00000000000000/* * Functions for transferring data between file descriptors. * * Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2025 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #include "config.h" #include "pv.h" #include "pv-internal.h" #include #include #include #include #include #include #include #include #include #include #include /* * splint note: In a few places we use "#if SPLINT" to substitute other code * while analysing with splint, to work around the issues it has with * FD_ZERO, FD_SET, FD_ISSET - these macros expand to code it does not like, * such as using << with an fd which may be negative, or comparing an * unsigned integer with a size_t, and it doesn't seem to work to turn off * those specific warnings where these macros are used. */ /* * Return >0 if data is ready to read on fd_in, or write on fd_out, before * "usec" microseconds have elapsed, 0 if not, or negative on error. Either * or both of "fd_in" and "fd_out" may be negative to ignore that side. If * fd_in_ready and/or fd_out_ready are not NULL, they will be populated with * true or false depending on whether data is ready on those sides. */ static int is_data_ready(int fd_in, /*@null@ */ bool *fd_in_ready, int fd_out, /*@null@ */ bool *fd_out_ready, long usec) { struct timeval tv; fd_set readfds; fd_set writefds; fd_set exceptfds; int max_fd; int result; max_fd = -1; if (fd_in > max_fd) max_fd = fd_in; if (fd_out > max_fd) max_fd = fd_out; memset(&tv, 0, sizeof(tv)); #if SPLINT /* splint doesn't like FD_ZERO and FD_SET. */ memset(&readfds, 0, sizeof(readfds)); memset(&writefds, 0, sizeof(writefds)); memset(&exceptfds, 0, sizeof(exceptfds)); #else /* !SPLINT */ FD_ZERO(&readfds); FD_ZERO(&writefds); FD_ZERO(&exceptfds); if (fd_in >= 0) FD_SET(fd_in, &readfds); if (fd_out >= 0) FD_SET(fd_out, &writefds); #endif /* !SPLINT */ tv.tv_sec = usec / 1000000; tv.tv_usec = usec % 1000000; if (NULL != fd_in_ready) *fd_in_ready = false; if (NULL != fd_out_ready) *fd_out_ready = false; result = select(max_fd + 1, &readfds, &writefds, &exceptfds, &tv); if (result > 0) { if ((fd_in >= 0) && (NULL != fd_in_ready) #ifndef SPLINT && (FD_ISSET(fd_in, &readfds)) #endif ) { *fd_in_ready = true; } if ((fd_out >= 0) && (NULL != fd_out_ready) #ifndef SPLINT && (FD_ISSET(fd_out, &writefds)) #endif ) { *fd_out_ready = true; } } return result; } /* * Read up to "count" bytes from file descriptor "fd" into the buffer "buf", * and return the number of bytes read, like read(). * * Unlike read(), if we have read less than "count" bytes, we check to see * if there's any more to read, and keep trying, to make sure we fill the * buffer as full as we can. * * We stop retrying if the time elapsed since this function was entered * reaches TRANSFER_READ_TIMEOUT seconds. */ static ssize_t pv__transfer_read_repeated(int fd, char *buf, size_t count) { struct timespec start_time; ssize_t total_read; memset(&start_time, 0, sizeof(start_time)); pv_elapsedtime_read(&start_time); total_read = 0; while (count > 0) { ssize_t nread; struct timespec cur_time, transfer_elapsed; long double elapsed_seconds; nread = read(fd, buf, (size_t) (count > MAX_READ_AT_ONCE ? MAX_READ_AT_ONCE : count)); /* flawfinder: ignore */ /* * flawfinder rationale: reads stop after "count" bytes, and * we handle negative and zero results from read(), so it is * bounded to the buffer size the caller told us to use. */ if (nread < 0) return nread; total_read += nread; buf += nread; count -= nread; if (0 == nread) return total_read; memset(&cur_time, 0, sizeof(cur_time)); memset(&transfer_elapsed, 0, sizeof(transfer_elapsed)); elapsed_seconds = 0.0; pv_elapsedtime_read(&cur_time); pv_elapsedtime_subtract(&transfer_elapsed, &cur_time, &start_time); elapsed_seconds = pv_elapsedtime_seconds(&transfer_elapsed); if (elapsed_seconds > TRANSFER_READ_TIMEOUT) { debug("%s %d: %s (%f %s)", "fd", fd, "stopping read - timer expired", (double) elapsed_seconds, "sec elapsed"); return total_read; } if (count > 0) { debug("%s %d: %s (%ld %s, %ld %s)", "fd", fd, "trying another read after partial buffer fill", nread, "read", count, "remaining"); if (is_data_ready(fd, NULL, -1, NULL, 0) < 1) break; } } return total_read; } /* * Write up to "count" bytes to file descriptor "fd" from the buffer "buf", * and return the number of bytes written, like write(). * * Unlike write(), if we have written less than "count" bytes, we check to * see if we can write any more, and keep trying, to make sure we empty the * buffer as much as we can. * * While this is called after a successful write-possible select(), write() is * not guaranteed to succeed for _all_ sizes; we may end up returning 0 if this * occurs. (The first write() may return -1 / EINTR if the consumer doesn't * read any data before our timeout and the buffer of whatever stdout is is * near-full.) (see https://codeberg.org/a-j-wood/pv/pulls/93) * * If "sync_after_write" is true, we call fdatasync() after each write() (or * fsync() if _POSIX_SYNCHRONIZED_IO is not > 0). * * We stop retrying if the time elapsed since this function was entered * reaches TRANSFER_WRITE_TIMEOUT seconds. */ static ssize_t pv__transfer_write_repeated(int fd, char *buf, size_t count, bool sync_after_write) { struct timespec start_time; ssize_t total_written; memset(&start_time, 0, sizeof(start_time)); pv_elapsedtime_read(&start_time); total_written = 0; while (count > 0) { ssize_t nwritten; struct timespec cur_time, transfer_elapsed; long double elapsed_seconds; size_t asked_to_write; asked_to_write = count > MAX_WRITE_AT_ONCE ? MAX_WRITE_AT_ONCE : count; nwritten = write(fd, buf, asked_to_write); #ifdef HAVE_FDATASYNC if (sync_after_write && nwritten >= 0) { /* * Ignore non IO errors, such as EBADFD (bad file * descriptor), EINVAL (non syncable fd, such as a * pipe), etc - only return an error on EIO. */ #if defined(_POSIX_SYNCHRONIZED_IO) && _POSIX_SYNCHRONIZED_IO > 0 if ((fdatasync(fd) < 0) && (EIO == errno)) { return -1; } #else if ((fsync(fd) < 0) && (EIO == errno)) { return -1; } #endif } #endif /* HAVE_FDATASYNC */ if (nwritten < 0) { if ((EINTR == errno) || (EAGAIN == errno)) { /* * Interrupted by a signal - probably our * alarm or interval timer - so just return * what we've written so far. */ return total_written; } else { /* * Legitimate error - return negative. */ return nwritten; } } total_written += nwritten; buf += nwritten; count -= nwritten; if (0 == nwritten) return total_written; memset(&cur_time, 0, sizeof(cur_time)); memset(&transfer_elapsed, 0, sizeof(transfer_elapsed)); elapsed_seconds = 0.0; pv_elapsedtime_read(&cur_time); pv_elapsedtime_subtract(&transfer_elapsed, &cur_time, &start_time); elapsed_seconds = pv_elapsedtime_seconds(&transfer_elapsed); if (elapsed_seconds > TRANSFER_WRITE_TIMEOUT) { debug("%s %d: %s (%f %s)", "fd", fd, "stopping write - timer expired", (double) elapsed_seconds, "sec elapsed"); return total_written; } /* * Running the select() here seems to make PV eat a lot of * CPU in some cases, so instead we just go round the loop * again and rely on our alarm or interval timer to * interrupt us if we run out of time - also on our elapsed * time check. */ if (count > 0) { debug("%s %d: %s (%ld %s, %ld %s)", "fd", fd, "trying another write after partial buffer flush", nwritten, "written", count, "remaining"); #if 0 /* removed after 1.6.0 - see comment above */ if (is_data_ready(-1, NULL, fd, NULL, 0) < 1) { break; } #endif /* end of removed section */ } } return total_written; } /* * Read some data from the given file descriptor. Returns zero if there was * a transient error and we need to return 0 from pv_transfer, otherwise * returns 1. * * At most, the number of bytes read will be the number of bytes remaining * in the input buffer. If state->control.rate_limit is >0, and/or "allowed" is >0, * then the maximum number of bytes read will be the number remaining unused * in the input buffer or the value of "allowed", whichever is smaller. * * If splice() was successfully used, sets state->transfer.splice_used to true; if it * failed, then state->transfer.splice_failed_fd is updated to the current fd so * splice() won't be tried again until the next input file. * * Updates state->transfer.read_position by the number of bytes read, unless splice() * was used, in which case it does not since there's nothing in the buffer * (and it also adds the bytes to state->transfer.written since they've been written * to the output). * * On read error, updates state->status.exit_status, and if allowed by * state->control.skip_errors, tries to skip past the problem. * * If the end of the input file is reached or the error is unrecoverable, * sets *eof_in to true. If all data in the buffer has been written at this * point, then also sets *eof_out to true. */ static int pv__transfer_read(pvstate_t state, int fd, bool *eof_in, bool *eof_out, off_t allowed) { bool do_not_skip_errors; size_t bytes_can_read; off_t amount_to_skip, amount_skipped, orig_offset, skip_offset; ssize_t nread; #ifdef HAVE_SPLICE size_t bytes_to_splice; #endif /* HAVE_SPLICE */ do_not_skip_errors = false; if (0 == state->control.skip_errors) do_not_skip_errors = true; bytes_can_read = state->transfer.buffer_size - state->transfer.read_position; nread = 0; #ifdef HAVE_SPLICE state->transfer.splice_used = false; if ((!state->control.linemode) && (!state->control.no_splice) && (fd != state->transfer.splice_failed_fd) && (0 == state->transfer.to_write)) { if (state->control.rate_limit > 0 || allowed != 0) { bytes_to_splice = (size_t) allowed; } else { bytes_to_splice = bytes_can_read; } /*@-nullpass@ */ /*@-type@ */ /* splint doesn't know about splice */ nread = splice(fd, NULL, state->control.output_fd, NULL, bytes_to_splice, SPLICE_F_MORE); /*@+type@ */ /*@+nullpass@ */ state->transfer.splice_used = true; if ((nread < 0) && (EINVAL == errno)) { debug("%s %d: %s", "fd", fd, "splice failed with EINVAL - disabling"); state->transfer.splice_failed_fd = fd; state->transfer.splice_used = false; /* * Fall through to read() below. */ } else if (nread > 0) { state->transfer.written = nread; #ifdef HAVE_FDATASYNC if (state->control.sync_after_write) { /* * Ignore non IO errors, such as EBADFD (bad file * descriptor), EINVAL (non syncable fd, such as a * pipe), etc - only treat EIO as a failure. * Since this is a write error, not a read * error, we cannot skip it, so set * "do_not_skip_errors". */ if ((fdatasync(state->control.output_fd) < 0) && (EIO == errno)) { nread = -1; do_not_skip_errors = true; } } #endif /* HAVE_FDATASYNC */ } else if ((-1 == nread) && (EAGAIN == errno)) { /* nothing read yet - do nothing */ } else { /* EOF might not really be EOF, it seems */ state->transfer.splice_used = false; } } if (!state->transfer.splice_used) { nread = pv__transfer_read_repeated(fd, state->transfer.transfer_buffer + state->transfer.read_position, bytes_can_read); } #else nread = pv__transfer_read_repeated(fd, state->transfer.transfer_buffer + state->transfer.read_position, bytes_can_read); #endif /* HAVE_SPLICE */ if (0 == nread) { /* * If read returned 0, we've reached the end of this input * file. If we've also written all the data in the transfer * buffer, we set eof_out as well, so that the main loop can * move on to the next input file. */ *eof_in = true; if (state->transfer.write_position >= state->transfer.read_position) *eof_out = true; return 1; } else if (nread > 0) { /* * Read returned >0, so we successfully read data - clear * the error counter and update our record of how much data * we've got in the buffer. */ state->transfer.read_errors_in_a_row = 0; #ifdef HAVE_SPLICE /* * If we used splice(), there isn't any more data in the * buffer than there was before. */ if (!state->transfer.splice_used) state->transfer.read_position += nread; #else state->transfer.read_position += nread; #endif /* HAVE_SPLICE */ return 1; } /* * If we reach this point, nread<0, so there was an error. */ /* * If a read error occurred but it was EINTR or EAGAIN, just wait a * bit and then return zero, since this was a transient error. */ if ((EINTR == errno) || (EAGAIN == errno)) { debug("%s %d: %s: %s", "fd", fd, "transient error - waiting briefly", strerror(errno)); (void) is_data_ready(-1, NULL, -1, NULL, 10000); return 0; } /* * The read error is not transient, so update the program's final * exit status, regardless of whether we're skipping errors, and * increment the error counter. */ state->status.exit_status |= PV_ERROREXIT_TRANSFER; state->transfer.read_errors_in_a_row++; /* * If we aren't skipping errors, show the error and pretend we * reached the end of this file. */ if (do_not_skip_errors) { pv_error(state, "%s: %s: %s", pv_current_file_name(state), _("read failed"), strerror(errno)); *eof_in = true; if (state->transfer.write_position >= state->transfer.read_position) { *eof_out = true; } return 1; } /* * Try to skip past the error. */ amount_skipped = -1; if (!state->transfer.read_error_warning_shown) { /*@-compdef@ */ pv_error(state, "%s: %s: %s", pv_current_file_name(state), _("warning: read errors detected"), strerror(errno)); /*@+compdef@ */ /* splint - see previous pv_current_file_name() call. */ state->transfer.read_error_warning_shown = true; } orig_offset = (off_t) lseek(fd, 0, SEEK_CUR); /* * If the file is not seekable, we can't skip past the error, so we * will have to abandon the attempt and pretend we reached the end * of the file. */ if (0 > orig_offset) { /*@-compdef@ */ pv_error(state, "%s: %s: %s", pv_current_file_name(state), _("file is not seekable"), strerror(errno)); /*@+compdef@ */ /* splint - see previous pv_current_file_name() calls. */ *eof_in = true; if (state->transfer.write_position >= state->transfer.read_position) { *eof_out = true; } return 1; } /* * If a non-zero error skip block size was given, just use that, * otherwise start small and ramp up based on the number of errors * in a row. */ if (state->control.error_skip_block > 0) { amount_to_skip = state->control.error_skip_block; } else { if (state->transfer.read_errors_in_a_row < 10) { amount_to_skip = (off_t) (state->transfer.read_errors_in_a_row < 5 ? 1 : 2); } else if (state->transfer.read_errors_in_a_row < 20) { unsigned int shift_by = (unsigned int) (state->transfer.read_errors_in_a_row - 10); amount_to_skip = (off_t) (1 << shift_by); } else { amount_to_skip = 512; } } /* * Round the skip amount down to the start of the next block of the * skip amount size. For instance if the skip amount is 512, but * our file offset is 257, we'll jump to 512 instead of 769. */ if (amount_to_skip > 1) { skip_offset = orig_offset + amount_to_skip; skip_offset -= (skip_offset % amount_to_skip); if (skip_offset > orig_offset) { amount_to_skip = skip_offset - orig_offset; } } /* * Trim the skip amount so we wouldn't read too much. */ if (amount_to_skip > (off_t) bytes_can_read) amount_to_skip = (off_t) bytes_can_read; /*@+longintegral@ */ /* splint complains about __off_t vs off_t */ skip_offset = (off_t) lseek(fd, (off_t) (orig_offset + amount_to_skip), SEEK_SET); /*@-longintegral@ */ /* * If the skip we just tried didn't work, try only skipping 1 byte * in case we were trying to go past the end of the input file. */ if (skip_offset < 0) { amount_to_skip = 1; /*@+longintegral@ */ /* see above */ skip_offset = (off_t) lseek(fd, (off_t) (orig_offset + amount_to_skip), SEEK_SET); /*@-longintegral@ */ } if (skip_offset < 0) { /* * Failed to skip - lseek() returned an error, so mark the * file as having ended. */ *eof_in = true; /* * EINVAL means the file has ended since we've tried to go * past the end of it, so we don't bother with a warning * since it just means we've reached the end anyway. */ if (EINVAL != errno) { /*@-compdef@ */ pv_error(state, "%s: %s: %s", pv_current_file_name(state), _("failed to seek past error"), strerror(errno)); /*@+compdef@ */ /* splint - see previous pv_current_file_name() calls. */ } } else { amount_skipped = skip_offset - orig_offset; } /* * If we succeeded in skipping some bytes, zero the equivalent part * of the transfer buffer, and update the buffer position. */ if (amount_skipped > 0) { memset(state->transfer.transfer_buffer + state->transfer.read_position, 0, (size_t) amount_skipped); state->transfer.read_position += amount_skipped; if (state->control.skip_errors < 2) { /*@-compdef@ */ pv_error(state, "%s: %s: %ld - %ld (%ld %s)", pv_current_file_name(state), _("skipped past read error"), (long) orig_offset, (long) skip_offset, (long) amount_skipped, _("B")); /*@+compdef@ */ /* splint - see previous pv_current_file_name() calls. */ } } else { /* * Failed to skip - mark file as ended. */ *eof_in = true; if (state->transfer.write_position >= state->transfer.read_position) { *eof_out = true; } } return 1; } /* * Write state->transfer.to_write bytes of data from the transfer buffer to the output. * Returns zero if there was a transient error and we need to return 0 from * pv_transfer, otherwise returns 1. * * Updates state->transfer.write_position by moving it on by the number of bytes * written; adds the number of bytes written to state->transfer.written; sets * *eof_out to true, on output EOF, or when the write position catches up * with the read position AND *eof_in is true (meaning we've reached the end * of data). * * On error, sets *eof_out to true, sets state->transfer.written to -1, and updates * state->status.exit_status. * * If state->control.discard_input is true, does not actually write anything. */ static int pv__transfer_write(pvstate_t state, bool *eof_in, bool *eof_out, long *lineswritten) { ssize_t nwritten; int write_errno; if (NULL == state->transfer.transfer_buffer) { pv_error(state, "%s", _("no transfer buffer allocated")); state->status.exit_status |= PV_ERROREXIT_MEMORY; *eof_out = true; state->transfer.written = -1; return 1; } nwritten = 0; write_errno = 0; if (state->control.discard_input) { nwritten = state->transfer.to_write; } else if (state->transfer.to_write > 0) { /* * Set an interval timer or an alarm to interrupt the write * with a signal if the write takes too long, so we can * continue producing progress information. */ #if HAVE_SETITIMER struct itimerval new_timer; /*@-unrecog@ */ /* splint doesn't know setitimer or ITIMER_REAL */ memset(&new_timer, 0, sizeof(new_timer)); new_timer.it_value.tv_sec = (time_t) (state->control.interval); new_timer.it_value.tv_usec = (suseconds_t) (((long) (state->control.interval * 1000000.0)) % 1000000); /* * We have to set the interval so that the timer continues * to repeat while writes are attempted, especially as it's * possible that the initial timer run will expire * immediately if the period is less than 1 second. */ new_timer.it_interval.tv_sec = new_timer.it_value.tv_sec; new_timer.it_interval.tv_usec = new_timer.it_value.tv_usec; debug("%s: [%lds,%ldus]", "setting interval timer", (long) (new_timer.it_value.tv_sec), (long) (new_timer.it_value.tv_usec)); if (0 != setitimer(ITIMER_REAL, &new_timer, NULL)) { pv_error(state, "%s: %s", _("failed to set interval timer"), strerror(errno)); } #else /* ! HAVE_SETITIMER */ (void) alarm(1); debug("%s", "setting alarm"); #endif /* HAVE_SETITIMER */ debug("%s: %ld %s", "beginning write attempt", (long) (state->transfer.to_write), "bytes"); nwritten = pv__transfer_write_repeated(state->control.output_fd, state->transfer.transfer_buffer + state->transfer.write_position, (size_t) (state->transfer.to_write), state->control.sync_after_write); if (nwritten < 0) { write_errno = (int) errno; debug("%s: %ld: %s", "bytes written", (long) nwritten, strerror(errno)); } else { debug("%s: %ld", "bytes written", (long) nwritten); } #if HAVE_SETITIMER memset(&new_timer, 0, sizeof(new_timer)); new_timer.it_interval.tv_sec = 0; new_timer.it_interval.tv_usec = 0; new_timer.it_value.tv_sec = 0; new_timer.it_value.tv_usec = 0; if (0 != setitimer(ITIMER_REAL, &new_timer, NULL)) { pv_error(state, "%s: %s", _("failed to clear interval timer"), strerror(errno)); } /*@+unrecog@ */ #else /* ! HAVE_SETITIMER */ debug("%s", "cancelling alarm"); (void) alarm(0); #endif /* HAVE_SETITIMER */ } if (nwritten > 0) { bool tracking_lines = false; if ((state->control.linemode) && (lineswritten != NULL)) tracking_lines = true; else if (state->display.showing_previous_line) tracking_lines = true; /* * Write returned >0 - data successfully written. */ if (tracking_lines) { char separator; char *ptr; long lines = 0; /* * Tracking lines - either line mode, or we're * showing the last line in the display, or both. * So we need to look through what we've just * written to either count how many lines there * were, or get the content of the most recent * complete line, or both. */ /* Allocate buffer to remember line positions. */ if (NULL == state->transfer.line_positions && NULL != lineswritten) { state->transfer.line_positions_capacity = MAX_LINE_POSITIONS; /*@-mustfreeonly@ */ state->transfer.line_positions = calloc((size_t) (state->transfer.line_positions_capacity), sizeof(off_t)); if (NULL == state->transfer.line_positions) { pv_error(state, "%s: %s", _("line position buffer allocation failed"), strerror(errno)); } /*@+mustfreeonly@ */ /* splint doesn't see we only call calloc() when line_positions is NULL. */ } if (state->control.null_terminated_lines) { separator = '\0'; } else { separator = '\n'; } ptr = (char *) (state->transfer.transfer_buffer + state->transfer.write_position - 1); for (ptr++; ptr - (char *) state->transfer.transfer_buffer - state->transfer.write_position < (size_t) nwritten; ptr++, state->transfer.last_output_position++) { if (*ptr != separator) { /* * If we're displaying the previous * line ("%L"), add to our line * buffer. */ if (state->display.showing_previous_line && state->display.next_line_len < PV_SIZEOF_PREVLINE_BUFFER - 1) { state->display.next_line[state->display.next_line_len] = *ptr; state->display.next_line_len++; } continue; } /* Separator found - increment line count. */ ++lines; /* * If we're displaying the previous line * ("%L"), update the previous-line buffer * with the line we just completed, and * start a new one. */ if (state->display.showing_previous_line) { memset(state->display.previous_line, 0, PV_SIZEOF_PREVLINE_BUFFER); if (state->display.next_line_len > PV_SIZEOF_PREVLINE_BUFFER - 1) state->display.next_line_len = PV_SIZEOF_PREVLINE_BUFFER - 1; if (state->display.next_line_len > 0) { memcpy(state->display.previous_line, state->display.next_line, /* flawfinder: ignore */ state->display.next_line_len); debug("%s: [%s]", "updated previous_line", state->display.previous_line); } state->display.next_line_len = 0; /* * flawfinder - next_line_len is * guaranteed to be less than the * size of the previous_line buffer * since we check it just before * memcpy(), and we ensure that the * last byte in the buffer is \0. */ } if (NULL == state->transfer.line_positions) continue; /* Store the position of the separator. */ state->transfer.line_positions[state->transfer.line_positions_head] = state->transfer.last_output_position; state->transfer.line_positions_head++; /* Circular buffer - wrap around. */ if (state->transfer.line_positions_head >= state->transfer.line_positions_capacity) { state->transfer.line_positions_head = 0; } /* Increment count of line positions, if below capacity. */ if (state->transfer.line_positions_length < state->transfer.line_positions_capacity) { state->transfer.line_positions_length++; } } if (NULL != lineswritten) *lineswritten += lines; } state->transfer.write_position += nwritten; state->transfer.written += nwritten; /* * If we're monitoring the output, update our copy of the * last few bytes we've written. */ if (state->display.showing_last_written && (nwritten > 0)) { size_t new_portion_size, old_portion_size; new_portion_size = (size_t) nwritten; if (new_portion_size > state->display.lastwritten_bytes) new_portion_size = state->display.lastwritten_bytes; old_portion_size = state->display.lastwritten_bytes - new_portion_size; /* * Make room for the new portion. */ if (old_portion_size > 0) { memmove(state->display.lastwritten_buffer, state->display.lastwritten_buffer + new_portion_size, old_portion_size); } /* * Copy the new data in. */ memcpy(state->display.lastwritten_buffer + /* flawfinder: ignore */ old_portion_size, state->transfer.transfer_buffer + state->transfer.write_position - new_portion_size, new_portion_size); /* * flawfinder rationale: calculations above ensure * that old_portion_size + new_portion_size is * always <= lastwritten_bytes, and * lastwritten_bytes is guaranteed by * pv__format_init() to be no more than * PV_SIZEOF_LASTWRITTEN_BUFFER, which is the size * of lastwritten_buffer, so the memcpy() will * always fit into the buffer. */ } /* * If we've written all the data in the buffer, reset the * read pointer to the start, and if the input file is at * EOF, set eof_out as well to indicate that we've written * everything for this input file. */ if (state->transfer.write_position >= state->transfer.read_position) { state->transfer.write_position = 0; state->transfer.read_position = 0; if (*eof_in) *eof_out = true; } return 1; } /* * If we reach this point, nwritten<=0, so there may be an error. */ /* * If a write error occurred but it was EINTR or EAGAIN, or write(2) * blocked on first write such that nwritten == 0, just wait a bit and * then return zero, since this was a transient error. */ if ((0 == nwritten) || (EINTR == write_errno) || (EAGAIN == write_errno)) { if (0 == nwritten) { debug("%s", "attempted write blocked - waiting briefly"); } else { debug("%s: %s", "transient write error - waiting briefly", strerror(write_errno)); } (void) is_data_ready(-1, NULL, -1, NULL, 10000); return 0; } /* * SIGPIPE means we've finished. Don't output an error because it's * not really our error to report. */ if (EPIPE == write_errno) { *eof_in = true; *eof_out = true; state->flag.pipe_closed = 1; return 0; } pv_error(state, "%s: %s", _("write failed"), strerror(write_errno)); state->status.exit_status |= PV_ERROREXIT_TRANSFER; *eof_out = true; state->transfer.written = -1; return 1; } /* * Return a pointer to a newly allocated buffer of the given size, aligned * appropriately for the current input and output file descriptors * (important if using O_DIRECT). * * Falls back to unaligned allocation if it was not possible to get an * aligned buffer, or if the relevant operating system features were not * available. With O_DIRECT, this means that transfers could fail with an * "Invalid argument" error (EINVAL). * * Returns NULL on complete allocation failure. */ /*@null@*/ /*@only@*/ static char *pv__allocate_aligned_buffer(int outfd, int infd, size_t target_size) { char *newptr; #if defined(HAVE_FPATHCONF) && defined(HAVE_POSIX_MEMALIGN) && defined(_PC_REC_XFER_ALIGN) long input_alignment, output_alignment, min_alignment; long required_alignment; input_alignment = infd >= 0 ? fpathconf(infd, _PC_REC_XFER_ALIGN) : -1; output_alignment = fpathconf(outfd, _PC_REC_XFER_ALIGN); #if defined(HAVE_SYSCONF) && defined(_SC_PAGESIZE) min_alignment = sysconf(_SC_PAGESIZE); #else /* ! defined(HAVE_SYSCONF) && defined(_SC_PAGESIZE) */ min_alignment = 8192; #endif /* defined(HAVE_SYSCONF) && defined(_SC_PAGESIZE) */ if (input_alignment > output_alignment) { required_alignment = input_alignment; } else if (output_alignment > input_alignment) { required_alignment = output_alignment; } else if (input_alignment < min_alignment) { required_alignment = min_alignment; } else { required_alignment = input_alignment; } /* Ensure the alignment is at least the page size. */ if (required_alignment < min_alignment) { required_alignment = min_alignment; } newptr = NULL; /*@-unrecog@ */ /* splice doesn't know of posix_memalign(). */ if (0 != posix_memalign((void **) (&newptr), (size_t) required_alignment, target_size)) { newptr = malloc(target_size); } /*@+unrecog@ */ #else /* ! defined(HAVE_FPATHCONF) && defined(HAVE_POSIX_MEMALIGN) && defined(_PC_REC_XFER_ALIGN) */ newptr = malloc(target_size); #endif /* defined(HAVE_FPATHCONF) && defined(HAVE_POSIX_MEMALIGN) && defined(_PC_REC_XFER_ALIGN) */ /* Initialise the buffer with zeroes. */ if (NULL != newptr) memset(newptr, 0, target_size); return newptr; } /* * Transfer some data from "fd" to standard output, timing out after 9/100 * of a second. If state->control.rate_limit is >0, and/or "allowed" is >0, only up * to "allowed" bytes can be written. The variables that "eof_in" and * "eof_out" point to are used to flag that we've finished reading and * writing respectively. * * Returns the number of bytes written, or negative on error (in which case * state->status.exit_status is updated). In line mode, the number of lines written * will be put into *lineswritten. */ ssize_t pv_transfer(pvstate_t state, int fd, bool *eof_in, bool *eof_out, off_t allowed, long *lineswritten) { bool ready_to_read, ready_to_write; int check_read_fd, check_write_fd; int n; if (NULL == state) return 0; #ifdef O_DIRECT /* * Set or clear O_DIRECT on the input and output file descriptors, * if the setting has changed. */ if (state->control.direct_io_changed) { if (!(*eof_in)) { if (0 != fcntl(fd, F_SETFL, (state->control.direct_io ? O_DIRECT : 0) | fcntl(fd, F_GETFL))) { /*@-compdef@ */ debug("%s: %s: %s", pv_current_file_name(state), "fcntl", strerror(errno)); /*@+compdef@ */ /* splint - see previous pv_current_file_name() calls. */ } } if (!(*eof_out)) { if (0 != fcntl(state->control.output_fd, F_SETFL, (state->control.direct_io ? O_DIRECT : 0) | fcntl(state->control.output_fd, F_GETFL))) { debug("%s: %s: %s", NULL == state->control.output_name ? "(null)" : state->control.output_name, "fcntl", strerror(errno)); } } state->control.direct_io_changed = false; } #endif /* O_DIRECT */ /* * Reinitialise the error skipping variables if the file descriptor * has changed since the last time we were called. */ if (fd != state->transfer.last_read_skip_fd) { state->transfer.last_read_skip_fd = fd; state->transfer.read_errors_in_a_row = 0; state->transfer.read_error_warning_shown = false; } /* * Allocate a new buffer, aligned appropriately for the input file * (important if using O_DIRECT). */ if (NULL == state->transfer.transfer_buffer) { state->transfer.transfer_buffer = pv__allocate_aligned_buffer(state->control.output_fd, fd, state->control.target_buffer_size + 32); if (NULL == state->transfer.transfer_buffer) { pv_error(state, "%s: %s", _("buffer allocation failed"), strerror(errno)); state->status.exit_status |= PV_ERROREXIT_MEMORY; return -1; } state->transfer.buffer_size = state->control.target_buffer_size; } /* * Reallocate the buffer if the buffer size has changed * mid-transfer. We have to do this by allocating a new buffer, * copying to it, and freeing the old one (potentially leaking * memory) because the buffer may need to be aligned for O_DIRECT, * and we can't realloc() an aligned buffer. */ if (state->transfer.buffer_size < state->control.target_buffer_size) { char *newptr; newptr = pv__allocate_aligned_buffer(state->control.output_fd, fd, state->control.target_buffer_size + 32); if (NULL == newptr) { /* * Reset target if realloc failed so we don't keep * trying to realloc over and over. */ debug("realloc: %s", strerror(errno)); state->control.target_buffer_size = state->transfer.buffer_size; } else { debug("%s: %ld", "buffer resized", state->transfer.buffer_size); /* * Copy the old buffer contents into the new buffer, * and free the old one. */ if (state->transfer.buffer_size > 0) { memcpy(newptr, state->transfer.transfer_buffer, state->transfer.buffer_size); /* flawfinder: ignore */ } /* * flawfinder rationale: number of bytes copied is * definitely always smaller than the new buffer * size. */ free(state->transfer.transfer_buffer); state->transfer.transfer_buffer = newptr; state->transfer.buffer_size = state->control.target_buffer_size; } } if ((state->control.linemode) && (lineswritten != NULL)) *lineswritten = 0; if ((*eof_in) && (*eof_out)) return 0; check_read_fd = -1; check_write_fd = -1; /* * If the input file is not at EOF and there's room in the buffer, * look for incoming data from it. */ if ((!(*eof_in)) && (state->transfer.read_position < state->transfer.buffer_size)) { check_read_fd = fd; } /* * Work out how much we're allowed to write, based on the amount of * data left in the buffer. If rate limiting is active or "allowed" * is >0, then this puts an upper limit on how much we're allowed to * write. */ state->transfer.to_write = (ssize_t) (state->transfer.read_position - state->transfer.write_position); if ((state->control.rate_limit > 0) || (allowed > 0)) { if ((off_t) (state->transfer.to_write) > allowed) { state->transfer.to_write = (ssize_t) allowed; } } /* * If we don't think we've finished writing and there's anything * we're allowed to write, look for the output becoming writable. */ if ((!(*eof_out)) && (state->transfer.to_write > 0)) { check_write_fd = state->control.output_fd; } ready_to_read = false; ready_to_write = false; n = is_data_ready(check_read_fd, &ready_to_read, check_write_fd, &ready_to_write, 90000); if (n < 0) { /* * Ignore transient errors by returning 0 immediately. */ if (EINTR == errno) return 0; /* * Any other error is a problem and we must report back. */ /*@-compdef@ */ pv_error(state, "%s: %s: %d: %s", pv_current_file_name(state), _("select call failed"), n, strerror(errno)); /*@+compdef@ */ /* splint - see previous pv_current_file_name() calls. */ state->status.exit_status |= PV_ERROREXIT_TRANSFER; return -1; } state->transfer.written = 0; /* * If there is data to read, try to read some in. Return early if * there was a transient read error. * * NB this can update state->transfer.written because of splice(). */ if (ready_to_read) { if (pv__transfer_read(state, fd, eof_in, eof_out, allowed) == 0) return 0; } /* * In line mode, only write up to and including the last newline, * so that we're writing output line-by-line. */ if ((state->transfer.to_write > 0) && (state->control.linemode) && !(state->control.null_terminated_lines)) { char *start; char *end; start = (char *) (state->transfer.transfer_buffer + state->transfer.write_position); end = pv_memrchr(start, (int) '\n', (size_t) (state->transfer.to_write)); if (NULL != end) { state->transfer.to_write = (ssize_t) ((end - start) + 1); } } /* * If there is data to write, and the output is ready to receive it, * and we didn't use splice() this time, write some data. * Return early if there was a transient write error. */ if (ready_to_write #ifdef HAVE_SPLICE && (!state->transfer.splice_used) #endif /* HAVE_SPLICE */ && (state->transfer.read_position > state->transfer.write_position) && (state->transfer.to_write > 0) && (NULL != lineswritten)) { if (pv__transfer_write(state, eof_in, eof_out, lineswritten) == 0) return 0; } #ifdef MAXIMISE_BUFFER_FILL /* * Rotate the written bytes out of the buffer so that it can be * filled up completely by the next read. */ if (state->transfer.write_position > 0) { if (state->transfer.write_position < state->transfer.read_position) { memmove(state->transfer.transfer_buffer, state->transfer.transfer_buffer + state->transfer.write_position, state->transfer.read_position - state->transfer.write_position); state->transfer.read_position -= state->transfer.write_position; state->transfer.write_position = 0; } else { state->transfer.write_position = 0; state->transfer.read_position = 0; } } #endif /* MAXIMISE_BUFFER_FILL */ return state->transfer.written; } pv-1.9.31/src/pv/watchpid.c000066400000000000000000000447511474702661500154440ustar00rootroot00000000000000/* * Functions for watching file descriptors in other processes. * * Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2025 Andrew Wood * * License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'. */ #include "config.h" #include "pv.h" #include "pv-internal.h" #include #include #include #include #define _GNU_SOURCE 1 #include #include #include #include #include #include #include #include #ifdef __APPLE__ #include #include #endif /*@-type@*/ /* splint has trouble with off_t and mode_t. */ /* * Set info->size to the size of the file info->file_fdpath points to, * assuming that info->sb_fd has been populated by stat(), or to 0 if the * file size could not be determined or the file was opened in write mode; * returns false if the file was not a block device or regular file. */ static bool filesize(pvwatchfd_t info) { if (S_ISBLK(info->sb_fd.st_mode)) { int fd; /* * Get the size of block devices by opening * them and seeking to the end. */ fd = open(info->file_fdpath, O_RDONLY); /* flawfinder: ignore */ /* * flawfinder: redirection check below; risk is minimal as * we are not actually reading any data here. */ if (fd >= 0) { /* * TOCTOU mitigation: check it's still a block * device before trying to seek to the end. * Otherwise treat it as unreadable and set the size * to 0. */ struct stat check_fd_sb; memset(&check_fd_sb, 0, sizeof(check_fd_sb)); info->size = 0; if (0 == fstat(fd, &check_fd_sb) && S_ISBLK(check_fd_sb.st_mode)) { info->size = lseek(fd, 0, SEEK_END); } (void) close(fd); } else { info->size = 0; } } else if (S_ISREG(info->sb_fd.st_mode)) { if ((info->sb_fd_link.st_mode & S_IWUSR) == 0) { info->size = info->sb_fd.st_size; } } else { return false; } return true; } /*@+type@*/ #ifdef __APPLE__ int pv_watchfd_info(pvstate_t state, pvwatchfd_t info, bool automatic) { struct vnode_fdinfowithpath vnodeInfo = { }; if (NULL == state) return -1; if (NULL == info) return -1; if (kill(info->watch_pid, 0) != 0) { if (!automatic) pv_error(state, "%s %u: %s", _("pid"), info->watch_pid, strerror(errno)); return 1; } int32_t proc_fd = (int32_t) info->watch_fd; int size = proc_pidfdinfo(info->watch_pid, proc_fd, PROC_PIDFDVNODEPATHINFO, &vnodeInfo, PROC_PIDFDVNODEPATHINFO_SIZE); if (size != PROC_PIDFDVNODEPATHINFO_SIZE) { pv_error(state, "%s %u: %s %d: %s", _("pid"), info->watch_pid, _("fd"), info->watch_fd, strerror(errno)); return 3; } strlcpy(info->file_fdpath, vnodeInfo.pvip.vip_path, PV_SIZEOF_FILE_FDPATH); info->size = 0; if (!(0 == stat(info->file_fdpath, &(info->sb_fd)))) { if (!automatic) pv_error(state, "%s %u: %s %d: %s: %s", _("pid"), info->watch_pid, _("fd"), info->watch_fd, info->file_fdpath, strerror(errno)); return 3; } if (!filesize(info)) { if (!automatic) pv_error(state, "%s %u: %s %d: %s: %s", _("pid"), info->watch_pid, _("fd"), info->watch_fd, info->file_fdpath, _("not a regular file or block device")); return 4; } return 0; } #else /* * Fill in the given information structure with the file paths and stat * details of the given file descriptor within the given process (given * within the info structure). * * Returns nonzero on error - error codes are: * * -1 - info or state were NULL * 1 - process does not exist * 2 - readlink on /proc/pid/fd/N failed * 3 - stat or lstat on /proc/pid/fd/N failed * 4 - file descriptor is not opened on a regular file * * If "automatic" is true, then this fd was picked automatically, and so if * it's not readable or not a regular file, no error is displayed and the * function just returns an error code. */ int pv_watchfd_info(pvstate_t state, pvwatchfd_t info, bool automatic) { if (NULL == state) return -1; if (NULL == info) return -1; if (kill(info->watch_pid, 0) != 0) { if (!automatic) pv_error(state, "%s %u: %s", _("pid"), info->watch_pid, strerror(errno)); return 1; } (void) pv_snprintf(info->file_fdinfo, PV_SIZEOF_FILE_FDINFO, "/proc/%u/fdinfo/%d", info->watch_pid, info->watch_fd); (void) pv_snprintf(info->file_fd, PV_SIZEOF_FILE_FD, "/proc/%u/fd/%d", info->watch_pid, info->watch_fd); memset(info->file_fdpath, 0, PV_SIZEOF_FILE_FDPATH); if (readlink(info->file_fd, info->file_fdpath, PV_SIZEOF_FILE_FDPATH - 1) < 0) { /* flawfinder: ignore */ /* * flawfinder: memset() has put \0 at the end already, and * we tell readlink() to use 1 byte less than the buffer * length, so \0 termination is assured. There is no * mitigation for the risk of the link changing while we * read it, but we are only reading from the destination, * and then only if it's a block device - see filesize(). */ if (!automatic) pv_error(state, "%s %u: %s %d: %s", _("pid"), info->watch_pid, _("fd"), info->watch_fd, strerror(errno)); return 2; } if (!((0 == stat(info->file_fd, &(info->sb_fd))) && (0 == lstat(info->file_fd, &(info->sb_fd_link))))) { if (!automatic) pv_error(state, "%s %u: %s %d: %s: %s", _("pid"), info->watch_pid, _("fd"), info->watch_fd, info->file_fdpath, strerror(errno)); return 3; } info->size = 0; if (!filesize(info)) { if (!automatic) pv_error(state, "%s %u: %s %d: %s: %s", _("pid"), info->watch_pid, _("fd"), info->watch_fd, info->file_fdpath, _("not a regular file or block device")); return 4; } return 0; } #endif #ifdef __APPLE__ bool pv_watchfd_changed(pvwatchfd_t info) { return true; } #else /* * Return true if the given file descriptor has changed in some way since * we started looking at it (i.e. changed destination or permissions). */ bool pv_watchfd_changed(pvwatchfd_t info) { struct stat sb_fd, sb_fd_link; memset(&sb_fd, 0, sizeof(sb_fd)); memset(&sb_fd_link, 0, sizeof(sb_fd_link)); if ((0 == stat(info->file_fd, &sb_fd)) && (0 == lstat(info->file_fd, &sb_fd_link))) { if ((sb_fd.st_dev != info->sb_fd.st_dev) || (sb_fd.st_ino != info->sb_fd.st_ino) || (sb_fd_link.st_mode != info->sb_fd_link.st_mode) ) { return true; } } else { return true; } return false; } #endif /* * Return the current file position of the given file descriptor, or -1 if * the fd has closed or has changed in some way. */ off_t pv_watchfd_position(pvwatchfd_t info) { off_t position; #ifdef __APPLE__ struct vnode_fdinfowithpath vnodeInfo = { }; int32_t proc_fd = (int32_t) info->watch_fd; int size = proc_pidfdinfo(info->watch_pid, proc_fd, PROC_PIDFDVNODEPATHINFO, &vnodeInfo, PROC_PIDFDVNODEPATHINFO_SIZE); if (size != PROC_PIDFDVNODEPATHINFO_SIZE) { return -1; } position = (off_t) vnodeInfo.pfi.fi_offset; #else long long pos_long; FILE *fptr; if (pv_watchfd_changed(info)) return -1; fptr = fopen(info->file_fdinfo, "r"); /* flawfinder: ignore */ /* flawfinder: trusted location (/proc). */ if (NULL == fptr) return -1; pos_long = -1; position = -1; if (1 == fscanf(fptr, "pos: %lld", &pos_long)) { position = (off_t) pos_long; } (void) fclose(fptr); #endif /* * This debugging line can be quite noisy - turned off for now, * uncomment if needed. * * debug("pid:%d fd:%d position:%lld", (int) (info->watch_pid), info->watch_fd, position); */ return position; } #ifdef __APPLE__ static int pidfds(pvstate_t state, unsigned int pid, struct proc_fdinfo **fds, int *count) { int size_needed = proc_pidinfo(pid, PROC_PIDLISTFDS, 0, 0, 0); if (size_needed == -1) { pv_error(state, "%s: unable to list pid fds: %s", _("pid"), strerror(errno)); return -1; } *count = size_needed / PROC_PIDLISTFD_SIZE; *fds = (struct proc_fdinfo *) malloc(size_needed); if (*fds == NULL) { pv_error(state, "%s: alloc failed: %s", _("pid"), strerror(errno)); return -1; } memset(*fds, 0, size_needed); proc_pidinfo(pid, PROC_PIDLISTFDS, 0, *fds, size_needed); return 0; } #endif /*@-compdestroy @ */ /*@-usereleased @ */ /*@-compdef @ */ /* * splint: extending or creating entries and then zeroing them makes splint * believe that data previously there may refer to pointers that are now * lost - but these are newly added array entries so there is no loss. */ /* * Extend the info array by one, returning false on error. */ static bool extend_info_array(int *array_length_ptr, pvwatchfd_t * info_array_ptr) { int array_length = 0; struct pvwatchfd_s *info_array = NULL; struct pvwatchfd_s *new_info_array; array_length = *array_length_ptr; info_array = *info_array_ptr; array_length++; if (NULL == info_array) { new_info_array = malloc(array_length * sizeof(*info_array)); if (NULL != new_info_array) memset(new_info_array, 0, array_length * sizeof(*info_array)); } else { new_info_array = realloc(info_array, array_length * sizeof(*info_array)); if (NULL != new_info_array) memset(&(new_info_array[array_length - 1]), 0, sizeof(*info_array)); } if (NULL == new_info_array) { return false; } *info_array_ptr = new_info_array; *array_length_ptr = array_length; return true; } /*@+compdestroy @ */ /*@+usereleased @ */ /*@+compdef @ */ /* * Scan the given process and update the arrays with any new file * descriptors. * * Returns 0 on success, 1 if the process no longer exists or could not be * read, or 2 for a memory allocation error. */ int pv_watchpid_scanfds(pvstate_t state, pid_t watch_pid, int *array_length_ptr, pvwatchfd_t * info_array_ptr, int *fd_to_idx) { int array_length = 0; struct pvwatchfd_s *info_array = NULL; #ifdef __APPLE__ struct proc_fdinfo *fd_infos = NULL; int fd_infos_count = 0; if (pidfds(state, watch_pid, &fd_infos, &fd_infos_count) != 0) { pv_error(state, "%s: pidfds failed", _("pid")); return -1; } #else char fd_dir[512]; /* flawfinder: ignore - zeroed, bounded with pv_snprintf(). */ DIR *dptr; struct dirent *d; memset(fd_dir, 0, sizeof(fd_dir)); (void) pv_snprintf(fd_dir, sizeof(fd_dir), "/proc/%u/fd", watch_pid); dptr = opendir(fd_dir); if (NULL == dptr) return 1; #endif array_length = *array_length_ptr; info_array = *info_array_ptr; #ifdef __APPLE__ if (fd_infos_count < 1) { pv_error(state, "%s: no fds found", _("pid")); return -1; } for (int i = 0; i < fd_infos_count; i++) { #else while ((d = readdir(dptr)) != NULL) { #endif int fd, check_idx, use_idx, rc; off_t position_now; const char *use_format_string; fd = -1; #ifdef __APPLE__ fd = fd_infos[i].proc_fd; #else if (sscanf(d->d_name, "%d", &fd) != 1) continue; #endif /* Skip if the fd is outside the array. */ if ((fd < 0) || (fd >= FD_SETSIZE)) continue; /* * Skip if this fd is already known to us. */ if (fd_to_idx[fd] != -1) { continue; } /* * See if there's an empty slot we can re-use. An empty slot * has a watch_pid of 0. */ use_idx = -1; for (check_idx = 0; check_idx < array_length; check_idx++) { if (info_array[check_idx].watch_pid == 0) { use_idx = check_idx; break; } } /* * If there's no empty slot, extend the array. */ if (use_idx < 0) { if (!extend_info_array(array_length_ptr, info_array_ptr)) return 2; array_length = *array_length_ptr; info_array = *info_array_ptr; use_idx = array_length - 1; } debug("%s: %d => index %d", "found new fd", fd, use_idx); /* * Initialise the details of this new entry. */ memset(&(info_array[use_idx]), 0, sizeof(info_array[use_idx])); info_array[use_idx].watch_pid = watch_pid; info_array[use_idx].watch_fd = fd; /* Allocate new display state. */ /*@-mustfreeonly@ *//* splint - this is not a leak, this is a new entry. */ info_array[use_idx].state = pv_state_alloc(state->status.program_name); /*@+mustfreeonly@ */ if (NULL == info_array[use_idx].state) return 2; /* Copy the main status.cwd value to the new state. */ memcpy(&(info_array[use_idx].state->status.cwd), &(state->status.cwd), sizeof(state->status.cwd)); /* flawfinder: ignore */ /* flawfinder: bounded to destination object size. */ /* * Copy over all the control values, blanking out the * dynamically allocated strings, and setting the default * format (fixed buffer) to the required format string * instead of allocating a new dynamic format string for the * copy (so there's less dynamic allocation going on). */ memcpy(&(info_array[use_idx].state->control), &(state->control), sizeof(state->control)); /* flawfinder: ignore */ /* flawfinder: bounded to destination object size. */ /*@-mustfreeonly@ *//* splint - this is not a leak, this is a new entry. */ info_array[use_idx].state->control.name = NULL; info_array[use_idx].state->control.format_string = NULL; info_array[use_idx].state->control.output_name = NULL; /*@+mustfreeonly@ */ info_array[use_idx].state->control.default_format[0] = '\0'; use_format_string = NULL != state->control.format_string ? state->control.format_string : state->control.default_format; if (NULL != use_format_string) (void) pv_snprintf(info_array[use_idx].state->control.default_format, PV_SIZEOF_DEFAULT_FORMAT, "%.510s", use_format_string); /* * Copy over all the display values, blanking out the * dynamically allocated parts as above; then set the * average rate window so that a new history buffer is * allocated for this state. */ memcpy(&(info_array[use_idx].state->display), &(state->display), sizeof(state->display)); /* flawfinder: ignore */ /* flawfinder: bounded to destination object size. */ /*@-mustfreeonly@ *//* splint - this is not a leak, this is a new entry. */ info_array[use_idx].state->display.display_buffer = NULL; info_array[use_idx].state->display.display_buffer_size = 0; info_array[use_idx].state->calc.history = NULL; info_array[use_idx].state->calc.history_len = 0; /*@+mustfreeonly@ */ pv_state_average_rate_window_set(info_array[use_idx].state, state->control.average_rate_window); #ifdef __APPLE__ if (fd_infos[i].proc_fdtype != PROX_FDTYPE_VNODE) { continue; } #endif /* Retrieve the details of this file descriptor. */ rc = pv_watchfd_info(state, &(info_array[use_idx]), true); /* * Lookup failed - mark this slot as being free for re-use. */ if ((rc != 0) && (rc != 4)) { debug("%s %d: %s: %d", "fd", fd, "lookup failed - marking slot for re-use", use_idx); info_array[use_idx].watch_pid = 0; if (NULL != info_array[use_idx].state) pv_state_free(info_array[use_idx].state); /*@-mustfreeonly@ *//* not a leak - we've just free()d it. */ info_array[use_idx].state = NULL; /*@+mustfreeonly@ */ continue; } fd_to_idx[fd] = use_idx; /* * Not displayable - set fd to -1 so the main loop doesn't * show it. */ if (rc != 0) { debug("%s %d: %s", "fd", fd, "marking as not displayable"); info_array[use_idx].watch_fd = -1; } /* NULL check on the state - skip if not usable. */ if (NULL == info_array[use_idx].state) { debug("%s %d: %s", "fd", fd, "state is NULL - marking as not displayable"); info_array[use_idx].watch_fd = -1; continue; } /* * Set the displayed size appropriately; if the size is 0, * or not known, remove %e and %I from the state's default * format string so that neither estimated time remaining * nor estimated time of completion are displayed. */ info_array[use_idx].state->control.size = info_array[use_idx].size; if (info_array[use_idx].state->control.size < 1) { char *fmt; while (NULL != (fmt = strstr(info_array[use_idx].state->control.default_format, "%e"))) { debug("%s", "zero size - removing estimated time remaining"); /* strlen-1 here to include trailing \0 */ memmove(fmt, fmt + 2, strlen(fmt) - 1); /* flawfinder: ignore */ info_array[use_idx].state->flag.reparse_display = 1; } while (NULL != (fmt = strstr(info_array[use_idx].state->control.default_format, "%I"))) { debug("%s", "zero size - removing estimated completion time"); /* strlen-1 here to include trailing \0 */ memmove(fmt, fmt + 2, strlen(fmt) - 1); /* flawfinder: ignore */ info_array[use_idx].state->flag.reparse_display = 1; } /* flawfinder: default_format is always \0-terminated. */ } /* Set the info display_name appropriately. */ pv_watchpid_setname(state, &(info_array[use_idx])); /* Carry the display_name through to the display state, and reparse. */ pv_state_name_set(info_array[use_idx].state, info_array[use_idx].display_name); info_array[use_idx].state->flag.reparse_display = 1; pv_elapsedtime_read(&(info_array[use_idx].start_time)); /* * Set the starting position (and initial offset, for the * display), if known, so that ETA and so on are calculated * correctly. */ info_array[use_idx].state->display.initial_offset = 0; info_array[use_idx].position = 0; position_now = pv_watchfd_position(&(info_array[use_idx])); if (position_now >= 0) { info_array[use_idx].state->display.initial_offset = position_now; info_array[use_idx].position = position_now; } } #ifdef __APPLE__ free(fd_infos); #else (void) closedir(dptr); #endif return 0; } /* * Set the display name for the given watched file descriptor, truncating at * the relevant places according to the current screen width. * * If the file descriptor is pointing to a file under the current working * directory, show its relative path, not the full path. */ void pv_watchpid_setname(pvstate_t state, pvwatchfd_t info) { size_t path_length, cwd_length; int max_display_length; char *file_fdpath = info->file_fdpath; memset(info->display_name, 0, PV_SIZEOF_DISPLAY_NAME); path_length = strlen(info->file_fdpath); /* flawfinder: ignore */ cwd_length = strlen(state->status.cwd); /* flawfinder: ignore */ /* flawfinder: both strings are always \0 terminated. */ if (cwd_length > 0 && path_length > cwd_length) { if (0 == strncmp(info->file_fdpath, state->status.cwd, cwd_length)) { file_fdpath += cwd_length + 1; path_length -= cwd_length + 1; } } max_display_length = (int) (state->control.width / 2) - 6; if (max_display_length >= (int) path_length) { (void) pv_snprintf(info->display_name, PV_SIZEOF_DISPLAY_NAME, "%4d:%.498s", info->watch_fd, file_fdpath); } else { int prefix_length, suffix_length; prefix_length = max_display_length / 4; suffix_length = max_display_length - prefix_length - 3; (void) pv_snprintf(info->display_name, PV_SIZEOF_DISPLAY_NAME, "%4d:%.*s...%.*s", info->watch_fd, prefix_length, file_fdpath, suffix_length, file_fdpath + path_length - suffix_length); } debug("%s: %d: [%s]", "set name for fd", info->watch_fd, info->display_name); } pv-1.9.31/tests/000077500000000000000000000000001474702661500134105ustar00rootroot00000000000000pv-1.9.31/tests/Bug_-_Display_length_at_magnitude_boundary_-_Bytes.test000077500000000000000000000020051474702661500262760ustar00rootroot00000000000000#!/bin/sh # # Check that the bytes count doesn't increase the line length as it passes # 1MiB, described here: # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=586763 # Allow all tests to be skipped, e.g. during a release build test "${SKIP_ALL_TESTS}" = "1" && exit 77 true "${testSubject:?not set - call this from 'make check'}" true "${workFile1:?not set - call this from 'make check'}" # Transfer 1500kB of data in a bursty fashion. # (dd if=/dev/zero bs=1k count=999; sleep 1; dd if=/dev/zero bs=1k count=1; sleep 1; dd if=/dev/zero bs=1k count=500; sleep 1; ) 2>/dev/null | ("${testSubject}" -btIf -s 1500k >/dev/null) 2>"${workFile1}" # Count how many different line lengths we've seen. # lineLengthCount=$(tr '\r' '\n' < "${workFile1}" | sed 's/ *$//' | awk '{x=length($0);if(x>0)print length($0)}' | sort | uniq | wc -l | tr -dc '0-9') # There should only be one length (not counting 0). # test "${lineLengthCount}" = "1" && exit 0 echo "variable line lengths detected" tr '\r' '\n' < "${workFile1}" exit 1 pv-1.9.31/tests/Bug_-_Display_length_at_magnitude_boundary_-_Rate.test000077500000000000000000000020521474702661500261050ustar00rootroot00000000000000#!/bin/sh # # This is the same as the other display length at magnitude boundary check, # but for rate, not bytes transferred. # Allow all tests to be skipped, e.g. during a release build test "${SKIP_ALL_TESTS}" = "1" && exit 77 # Dummy assignments for "shellcheck". true "${testSubject:?not set - call this from 'make check'}" true "${workFile1:?not set - call this from 'make check'}" # Transfer 1500kB of data in a bursty fashion. # (dd if=/dev/zero bs=1k count=999; sleep 1; dd if=/dev/zero bs=1k count=1; sleep 1; dd if=/dev/zero bs=3 count=1; sleep 1; dd if=/dev/zero bs=1k count=500; sleep 1; ) 2>/dev/null | ("${testSubject}" -rtIf -s 1500k >/dev/null) 2>"${workFile1}" # Count how many different line lengths we've seen. # lineLengthCount=$(tr '\r' '\n' < "${workFile1}" | sed 's/ *$//' | awk '{x=length($0);if(x>0)print length($0)}' | sort | uniq | wc -l | tr -dc '0-9') # There should only be one length (not counting 0). # test "${lineLengthCount}" = "1" && exit 0 echo "variable line lengths detected" tr '\r' '\n' < "${workFile1}" exit 1 pv-1.9.31/tests/Bug_-_Install_all_files.test000077500000000000000000000032301474702661500207430ustar00rootroot00000000000000#!/bin/sh # # Test that "make install" installs the expected minimum set of files. # Allow all tests to be skipped, e.g. during a release build test "${SKIP_ALL_TESTS}" = "1" && exit 77 true "${testSubject:?not set - call this from 'make check'}" true "${workFile1:?not set - call this from 'make check'}" if test "${XCTEST}" = "1"; then echo "cross-compile flag set - skipping as local make will not run" exit 77 fi makeDir="${testSubject%/*}" if ! test -d "${makeDir}"; then echo "could not find the directory to run \`make' in" exit 77 fi makeCommand=$(command -v gmake 2>/dev/null) test -z "${makeCommand}" && makeCommand="make" testInstallDir=$(mktemp -d) if ! test -n "${testInstallDir}"; then echo "failed to create temporary installation directory" exit 77 fi export DESTDIR="${testInstallDir}" ${makeCommand} -C "${makeDir}" install DESTDIR="${testInstallDir}" >"${workFile1}" 2>&1 rc=$? if ! test "${rc}" -eq 0; then if ! test "${makeCommand}" = "make"; then # Retry with plain "make". makeCommand="make" ${makeCommand} -C "${makeDir}" install DESTDIR="${testInstallDir}" >>"${workFile1}" 2>&1 rc=$? fi fi if ! test ${rc} -eq 0; then echo "\`make install' exited ${rc}" echo "command: ${makeCommand} -C '${makeDir}' install DESTDIR='${testInstallDir}'" cat "${workFile1}" rm -rf "${testInstallDir}" exit 1 fi exitStatus=0 if ! find "${testInstallDir}" -type f -name "pv.1*" | grep -Fq "pv.1"; then echo "installation of man page failed" exitStatus=1 fi if ! find "${testInstallDir}" -type f -name "pv*" | grep -Fv "pv.1" | grep -Fq "pv"; then echo "installation of binary failed" exitStatus=1 fi rm -rf "${testInstallDir}" exit "${exitStatus}" pv-1.9.31/tests/Display_-_--average-rate.test000077500000000000000000000020041474702661500207060ustar00rootroot00000000000000#!/bin/sh # # Check that the average transfer rate counter changes, but not more than it # should. # Allow all tests to be skipped, e.g. during a release build test "${SKIP_ALL_TESTS}" = "1" && exit 77 true "${testSubject:?not set - call this from 'make check'}" true "${workFile1:?not set - call this from 'make check'}" # Transfer 210 bytes as 100 bytes, a 1 second gap, 110 bytes, and another 1 # second gap. # (dd if=/dev/zero bs=100 count=1 2>/dev/null; sleep 1; dd if=/dev/zero bs=110 count=1 2>/dev/null; sleep 1; ) | "${testSubject}" -f -i 0.5 -a >/dev/null 2>"${workFile1}" # Count the number of rates output that are below 80. # lineCount=$(tr '\r' '\n' < "${workFile1}" | tr -dc '0-9.\n' | sed '/^$/d' | awk '$1<80{print}' | wc -l | tr -dc '0-9') # Nearly all of the output rates should be above 80 since the average rate # will always be around 100 bytes per second, except for pauses. # test "${lineCount}" -lt 2 && exit 0 echo "average rate varied more than expected" tr '\r' '\n' < "${workFile1}" exit 1 pv-1.9.31/tests/Display_-_--bits.test000077500000000000000000000010731474702661500173110ustar00rootroot00000000000000#!/bin/sh # # Check that the byte counter counts in bits when --bits is selected. # Allow all tests to be skipped, e.g. during a release build test "${SKIP_ALL_TESTS}" = "1" && exit 77 true "${testSubject:?not set - call this from 'make check'}" true "${workFile1:?not set - call this from 'make check'}" dd if=/dev/zero bs=100 count=1 2>/dev/null \ | "${testSubject}" -f -b -8 >/dev/null 2>"${workFile1}" counterValue=$(tr '\r' '\n' < "${workFile1}" | tr -d ' ') test "${counterValue}" = "800b" && exit 0 echo "unexpected bit counter value: ${counterValue}" exit 1 pv-1.9.31/tests/Display_-_--buffer-percent.test000077500000000000000000000015371474702661500212640ustar00rootroot00000000000000#!/bin/sh # # Check that "--buffer-percent" displays correctly. # Allow all tests to be skipped, e.g. during a release build test "${SKIP_ALL_TESTS}" = "1" && exit 77 true "${testSubject:?not set - call this from 'make check'}" true "${workFile1:?not set - call this from 'make check'}" # The output should show 100% and 0% as the buffer initially fills up due to # there being nowhere to write it to, and then empties. ( dd if=/dev/zero bs=1024 count=1024; sleep 2; ) 2>/dev/null \ | "${testSubject}" -f -T -i 0.5 -B 1024 2>"${workFile1}" \ | (sleep 1; dd bs=1024 count=512; sleep 1; cat; ) >/dev/null 2>&1 differentLines=$(tr '\r' '\n' < "${workFile1}" | sed '/^ *$/d' | sort | uniq | wc -l | tr -dc '0-9') test "${differentLines}" -gt 1 && exit 0 echo "expected output changes not seen" tr '\r' '\n' < "${workFile1}" | sed 's/^ *$/d' | sort | uniq exit 1 pv-1.9.31/tests/Display_-_--bytes.test000077500000000000000000000010311474702661500174700ustar00rootroot00000000000000#!/bin/sh # # Check that the byte counter counts. # Allow all tests to be skipped, e.g. during a release build test "${SKIP_ALL_TESTS}" = "1" && exit 77 true "${testSubject:?not set - call this from 'make check'}" true "${workFile1:?not set - call this from 'make check'}" dd if=/dev/zero bs=100 count=1 2>/dev/null \ | "${testSubject}" -f -b >/dev/null 2>"${workFile1}" counterValue=$(tr '\r' '\n' < "${workFile1}" | tr -d ' ') test "${counterValue}" = "100B" && exit 0 echo "unexpected byte counter value: ${counterValue}" exit 1 pv-1.9.31/tests/Display_-_--eta_-_plausible_values.test000077500000000000000000000017751474702661500227650ustar00rootroot00000000000000#!/bin/sh # # Check that the estimated time counter counts. # Allow all tests to be skipped, e.g. during a release build test "${SKIP_ALL_TESTS}" = "1" && exit 77 true "${testSubject:?not set - call this from 'make check'}" true "${workFile1:?not set - call this from 'make check'}" dd if=/dev/zero bs=100 count=1 2>/dev/null \ | "${testSubject}" -f -e -s 100 -i 0.1 -L 25 >/dev/null 2>"${workFile1}" # Count the number of different ETA values there have been. # valueCount=$(tr '\r' '\n' < "${workFile1}" | tr -d ' ' | sed '/^$/d' | sort | uniq | wc -l | tr -dc '0-9') # 3 or less - not OK, since it should have taken 4 seconds. # if ! test "${valueCount}" -gt 3; then echo "fewer than 4 ETA values seen" tr '\r' '\n' < "${workFile1}" | sed '/^ *$/d' | sort | uniq exit 1 fi # 12 or more - not OK, since even on a heavily loaded system that's too long. # if ! test "${valueCount}" -lt 12; then echo "more than 11 ETA values seen" tr '\r' '\n' < "${workFile1}" | sed '/^ *$/d' | sort | uniq exit 1 fi exit 0 pv-1.9.31/tests/Display_-_--fineta_-_plausible_values.test000077500000000000000000000016421474702661500234530ustar00rootroot00000000000000#!/bin/sh # # Check that the estimated time counter can show the end time of day. # Allow all tests to be skipped, e.g. during a release build test "${SKIP_ALL_TESTS}" = "1" && exit 77 true "${testSubject:?not set - call this from 'make check'}" true "${workFile1:?not set - call this from 'make check'}" dd if=/dev/zero bs=100 count=1 2>/dev/null \ | "${testSubject}" -f -I -s 100 -i 0.1 -L 25 >/dev/null 2>"${workFile1}" # Count the number of different ETA values there have been. # valueCount=$(tr '\r' '\n' < "${workFile1}" | tr -d ' ' | sed '/^$/d' | sort | uniq | wc -l | tr -dc '0-9') # There should be at least 1 line of output. # if ! test "${valueCount}" -gt 0; then echo "no output found" exit 1 fi # 8 or more different values - not OK. # if ! test "${valueCount}" -lt 8; then echo "more than 7 different values (${valueCount})" tr '\r' '\n' < "${workFile1}" | sed '/^ *$/d' | sort | uniq exit 1 fi exit 0 pv-1.9.31/tests/Display_-_--last-written.test000077500000000000000000000025211474702661500210040ustar00rootroot00000000000000#!/bin/sh # # Check that "--last-written" works. # Allow all tests to be skipped, e.g. during a release build test "${SKIP_ALL_TESTS}" = "1" && exit 77 true "${testSubject:?not set - call this from 'make check'}" true "${workFile1:?not set - call this from 'make check'}" # Slowly write a sequence of numbers (rate-limited by another `pv' instance) # and watch the "--last-written" output of a second `pv' instance to make # sure the buffer contents are visible (we use "-B" to disable splice mode). seq -w 3 1 100 \ | "${testSubject}" -qL 200 \ | "${testSubject}" -f -B 1024 -A 16 -i 0.2 >/dev/null 2>"${workFile1}" differentLines=$(tr '\r' '\n' < "${workFile1}" | sed '/^ *$/d' | sort | uniq | wc -l | tr -dc '0-9') lastLine=$(tr '\r' '\n' < "${workFile1}" | sed '/^ *$/d' | sed -n '$p') # Even on very slow hosts, we should see at least 3 different output lines - # nothing at the start, something in the middle, and the last few numbers at # the end. if ! test "${differentLines}" -gt 2; then echo "fewer than 3 different outputs seen" tr '\r' '\n' < "${workFile1}" | sed '/^ *$/d' | sort | uniq exit 1 fi expectedLastLine="097.098.099.100." if ! test "${lastLine}" = "${expectedLastLine}"; then echo "final output differs from expected value" echo "expected value: [${expectedLastLine}]" echo "observed value: [${lastLine}]" exit 1 fi exit 0 pv-1.9.31/tests/Display_-_--numeric.test000077500000000000000000000017571474702661500200230ustar00rootroot00000000000000#!/bin/sh # # Check that numeric output outputs some percentages. # Allow all tests to be skipped, e.g. during a release build test "${SKIP_ALL_TESTS}" = "1" && exit 77 true "${testSubject:?not set - call this from 'make check'}" true "${workFile1:?not set - call this from 'make check'}" # Process 100 bytes at 100 bytes per second, updating every 0.1 seconds for # around 10 output lines. # dd if=/dev/zero bs=100 count=1 2>/dev/null \ | "${testSubject}" -s 100 -n -i 0.1 -L 100 >/dev/null 2>"${workFile1}" lineCount=$(wc -l < "${workFile1}" | tr -dc '0-9') finalLine=$(sed -n '$p' < "${workFile1}") # The number of output lines should be >8 and <13, and the final percentage # should be 100. # if ! test "${lineCount}" -gt 8; then echo "fewer than 9 output lines (${lineCount})" exit 1 fi if ! test "${lineCount}" -lt 13; then echo "more than 12 output lines (${lineCount})" exit 1 fi if ! test "${finalLine}" = "100"; then echo "final percentage was not 100 (${finalLine})" exit 1 fi exit 0 pv-1.9.31/tests/Display_-_--numeric_--bytes.test000077500000000000000000000021171474702661500213520ustar00rootroot00000000000000#!/bin/sh # # Check that numeric output gives a byte count instead of a percentage when # used with -b. # Allow all tests to be skipped, e.g. during a release build test "${SKIP_ALL_TESTS}" = "1" && exit 77 true "${testSubject:?not set - call this from 'make check'}" true "${workFile1:?not set - call this from 'make check'}" # Process 500 bytes at 500 bytes per second, updating every 0.1 seconds for # around 10 output lines. # dd if=/dev/zero bs=500 count=1 2>/dev/null \ | "${testSubject}" -s 500 -n -b -i 0.1 -L 500 >/dev/null 2>"${workFile1}" lineCount=$(wc -l < "${workFile1}" | tr -dc '0-9') finalLine=$(sed -n '$p' < "${workFile1}") # The number of output lines should be >6 and <13, and the final byte count # should be 500. # if ! test "${lineCount}" -gt 6; then echo "fewer than 7 output lines (${lineCount}):" cat "${workFile1}" exit 1 fi if ! test "${lineCount}" -lt 13; then echo "more than 12 output lines (${lineCount}):" cat "${workFile1}" exit 1 fi if ! test "${finalLine}" = "500"; then echo "final byte count was not 500 (${finalLine}):" cat "${workFile1}" exit 1 fi pv-1.9.31/tests/Display_-_--numeric_--bytes_--line-mode.test000077500000000000000000000021401474702661500234310ustar00rootroot00000000000000#!/bin/sh # # Check that numeric output shows line counts instead of percentages, when # used in line mode together with bytes mode. # Allow all tests to be skipped, e.g. during a release build test "${SKIP_ALL_TESTS}" = "1" && exit 77 true "${testSubject:?not set - call this from 'make check'}" true "${workFile1:?not set - call this from 'make check'}" true "${workFile2:?not set - call this from 'make check'}" # Pass through 100 lines. # seq -w 3 1 100 \ | "${testSubject}" -bnl -i 0.2 -f -L 100 2>"${workFile1}" > "${workFile2}" lineCount=$(wc -l < "${workFile1}" | tr -dc '0-9') finalStdoutLine=$(sed -n '$p' < "${workFile2}") # The number of output lines should be >3 and <10, and the final line of # transferred data on stdout should be 100. # if ! test "${lineCount}" -gt 3; then echo "fewer than 4 output lines (${lineCount})" cat "${workFile1}" exit 1 fi if ! test "${lineCount}" -lt 10; then echo "more than 9 output lines (${lineCount})" cat "${workFile1}" exit 1 fi if ! test "${finalStdoutLine}" = "100"; then echo "final transferred line was not 100 (${finalStdoutLine})" exit 1 fi exit 0 pv-1.9.31/tests/Display_-_--numeric_--timer.test000077500000000000000000000024661474702661500213530ustar00rootroot00000000000000#!/bin/sh # # Check that numeric output gives a timer when used with -t. # Allow all tests to be skipped, e.g. during a release build test "${SKIP_ALL_TESTS}" = "1" && exit 77 true "${testSubject:?not set - call this from 'make check'}" true "${workFile1:?not set - call this from 'make check'}" # Process 100 bytes at 100 bytes per second, updating every 0.1 seconds for # around 10 output lines. # dd if=/dev/zero bs=100 count=1 2>/dev/null \ | "${testSubject}" -s 100 -n -t -i 0.1 -L 100 >/dev/null 2>"${workFile1}" lineCount=$(wc -l < "${workFile1}" | tr -dc '0-9') timesCount=$(tr ',' '.' < "${workFile1}" | awk '{print int(10*$1)}' | sort -n | uniq | wc -l | tr -dc '0-9') finalPercentage=$(sed -n '$p' < "${workFile1}" | awk '{print $2}') # The number of output lines should be >7 and <13, and the number of # different elapsed times should be at least 6. The last percentage should # be 100. # if ! test "${lineCount}" -gt 7; then echo "fewer than 8 output lines (${lineCount})" exit 1 fi if ! test "${lineCount}" -lt 13; then echo "more than 12 output lines (${lineCount})" exit 1 fi if ! test "${timesCount}" -gt 5; then echo "fewer than 6 different elapsed times (${timesCount})" exit 1 fi if ! test "${finalPercentage}" = "100"; then echo "final percentage was not 100 (${finalPercentage})" exit 1 fi exit 0 pv-1.9.31/tests/Display_-_--progress_-_basic_movement.test000077500000000000000000000013161474702661500235030ustar00rootroot00000000000000#!/bin/sh # # Check that the progress bar moves when data is coming in. # Allow all tests to be skipped, e.g. during a release build test "${SKIP_ALL_TESTS}" = "1" && exit 77 true "${testSubject:?not set - call this from 'make check'}" true "${workFile1:?not set - call this from 'make check'}" dd if=/dev/zero bs=100 count=1 2>/dev/null \ | "${testSubject}" -f -p -i 0.1 -L 500 >/dev/null 2>"${workFile1}" # There should be more than 2 different lines of output. # lineCount=$(tr '\r' '\n' < "${workFile1}" | sort | uniq -u | wc -l | tr -dc '0-9') if ! test "${lineCount}" -gt 2; then echo "fewer than 3 different progress lines (${lineCount})" tr '\r' '\n' < "${workFile1}" | sort | uniq -u exit 1 fi exit 0 pv-1.9.31/tests/Display_-_--progress_-_increasing.test000077500000000000000000000022631474702661500226340ustar00rootroot00000000000000#!/bin/sh # # Check that the progress bar increases in size when data is coming in. # Allow all tests to be skipped, e.g. during a release build test "${SKIP_ALL_TESTS}" = "1" && exit 77 true "${testSubject:?not set - call this from 'make check'}" true "${workFile1:?not set - call this from 'make check'}" dd if=/dev/zero bs=100 count=1 2>/dev/null \ | "${testSubject}" -f -p -i 0.1 -L 50 -s 100 >/dev/null 2>"${workFile1}" # There should be more than 5 different lines of output. # lineCount=$(tr '\r' '\n' < "${workFile1}" | sort | uniq -u | wc -l | tr -dc '0-9') if ! test "${lineCount}" -gt 5; then echo "fewer than 6 different progress lines (${lineCount})" tr '\r' '\n' < "${workFile1}" | sort | uniq -u exit 1 fi # Counting the "=" characters in each line that make up the progress bar # should give at least 5 different line lengths. # differentBarLengthsCount=$(tr '\r' '\n' < "${workFile1}" | tr -dc '=\n' | awk '{print length($1)}' | sort | uniq -u | wc -l | tr -dc '0-9') if ! test "${differentBarLengthsCount}" -gt 5; then echo "fewer than 6 different progress bar lengths detected (${differentBarLengthsCount})" tr '\r' '\n' < "${workFile1}" | sort | uniq -u exit 1 fi exit 0 pv-1.9.31/tests/Display_-_--quiet.test000077500000000000000000000010121474702661500174700ustar00rootroot00000000000000#!/bin/sh # # Check that the -q option shuts everything up. # Allow all tests to be skipped, e.g. during a release build test "${SKIP_ALL_TESTS}" = "1" && exit 77 true "${testSubject:?not set - call this from 'make check'}" true "${workFile1:?not set - call this from 'make check'}" dd if=/dev/zero bs=1000 count=5 2>/dev/null \ | "${testSubject}" -f -q -i 0.1 -L 5000 >/dev/null 2>"${workFile1}" if test -s "${workFile1}"; then echo "output detected when there should be none" cat "${workFile1}" exit 1 fi exit 0 pv-1.9.31/tests/Display_-_--rate_-_displayed_value_changes.test000077500000000000000000000020051474702661500244350ustar00rootroot00000000000000#!/bin/sh # # Check that the transfer rate counter changes. # Allow all tests to be skipped, e.g. during a release build test "${SKIP_ALL_TESTS}" = "1" && exit 77 true "${testSubject:?not set - call this from 'make check'}" true "${workFile1:?not set - call this from 'make check'}" # Transfer 200 bytes as two 100-byte blocks with a 2-second gap between. # (dd if=/dev/zero bs=100 count=1 2>/dev/null; sleep 2; dd if=/dev/zero bs=100 count=1 2>/dev/null; ) | "${testSubject}" -f -i 0.5 -r >/dev/null 2>"${workFile1}" # Count the number of different rates output. # rateCount=$(tr '\r' '\n' < "${workFile1}" | sort | uniq -u | wc -l | tr -dc '0-9') # There should be more than 2 different rates counted (around 100 bytes/sec # for the each block, 0 bytes/sec for the gap in the middle, and around 50 # bytes/sec for the average time reported at the end). # if ! test "${rateCount}" -gt 2; then echo "fewer than 3 different rates detected (${rateCount})" tr '\r' '\n' < "${workFile1}" | sort | uniq -u exit 1 fi exit 0 pv-1.9.31/tests/Display_-_--timer_-_displayed_value_changes.test000077500000000000000000000012321474702661500246230ustar00rootroot00000000000000#!/bin/sh # # Check that the elapsed time counter does count up. # Allow all tests to be skipped, e.g. during a release build test "${SKIP_ALL_TESTS}" = "1" && exit 77 true "${testSubject:?not set - call this from 'make check'}" true "${workFile1:?not set - call this from 'make check'}" # Transfer a zero amount of data, but take 3 seconds to do it. # (sleep 3 | "${testSubject}" -f -t >/dev/null) 2>&1 | tr '\r' '\n' > "${workFile1}" # Count the number of different timer values; it should be >1. # valueCount=$(sort < "${workFile1}" | uniq -u | wc -l | tr -dc '0-9') if ! test "${valueCount}" -gt 1; then echo "timer value did not change" exit 1 fi exit 0 pv-1.9.31/tests/General_-_--pidfile.test000077500000000000000000000020641474702661500177350ustar00rootroot00000000000000#!/bin/sh # # Check that the process ID can be written to a file as described in the # manual. # Allow all tests to be skipped, e.g. during a release build test "${SKIP_ALL_TESTS}" = "1" && exit 77 true "${testSubject:?not set - call this from 'make check'}" true "${workFile1:?not set - call this from 'make check'}" # Check we can run "kill -s 0". if ! kill -s 0 $$ >/dev/null 2>&1; then echo "cannot check process existence with \`kill -s 0'" exit 77 fi dd if=/dev/zero bs=150 count=1 2>/dev/null \ | "${testSubject}" -q -L 50 -P "${workFile1}" >/dev/null 2>/dev/null \ & testPid="$!" sleep 1 storedPid=$(cat "${workFile1}" 2>/dev/null) pidValid="0" kill -s 0 "${storedPid}" 2>/dev/null && pidValid="1" wait sleep 1 if test -s "${workFile1}"; then echo "PID file was not removed on exit" exit 1 fi true > "${workFile1}" if ! test "${testPid}" = "${storedPid}"; then echo "stored PID [${storedPid}] did not match actual PID [${testPid}]" exit 1 fi if ! test "${pidValid}" = "1"; then echo "stored PID [${storedPid}] was not reachable" exit 1 fi exit 0 pv-1.9.31/tests/General_-_--size_argument_handling.test000077500000000000000000000012531474702661500230400ustar00rootroot00000000000000#!/bin/sh # # Check that size arguments are processed correctly. # Allow all tests to be skipped, e.g. during a release build test "${SKIP_ALL_TESTS}" = "1" && exit 77 true "${testSubject:?not set - call this from 'make check'}" # Pass size argument $1 and check that the last reported number is $2. checkSizeArgument () { reportedCount=$("${testSubject}" -XfnbSs "$1" /dev/zero 2>&1 | sed -n '$p' | tr -dc '0-9') if ! test "${reportedCount}" = "$2"; then echo "passed size argument $1, expected count of $2, but got ${reportedCount}" exit 1 fi } checkSizeArgument 10000 10000 checkSizeArgument 1k 1024 checkSizeArgument 1M 1048576 checkSizeArgument 8G 8589934592 exit 0 pv-1.9.31/tests/Integrity_-_Basic.test000077500000000000000000000014231474702661500176070ustar00rootroot00000000000000#!/bin/sh # # Check that data can be just passed straight through. # Allow all tests to be skipped, e.g. during a release build test "${SKIP_ALL_TESTS}" = "1" && exit 77 true "${testSubject:?not set - call this from 'make check'}" inputString="TESTING" outputString=$(printf "%s" "${inputString}" | "${testSubject}" 2>/dev/null) || { echo "unexpected failure code"; exit 1; } if ! test "${inputString}" = "${outputString}"; then echo "output did not match input" exit 1 fi # Test again with --force. inputString="TESTINGAGAIN" outputString=$(printf "%s" "${inputString}" | "${testSubject}" -f 2>/dev/null) || { echo "unexpected failure code"; exit 1; } if ! test "${inputString}" = "${outputString}"; then echo "output did not match input when using --force" exit 1 fi exit 0 pv-1.9.31/tests/Integrity_-_Binary_data.test000077500000000000000000000013631474702661500210060ustar00rootroot00000000000000#!/bin/sh # # Transfer a large chunk of data through pv and check data correctness # afterwards. # Allow all tests to be skipped, e.g. during a release build test "${SKIP_ALL_TESTS}" = "1" && exit 77 true "${testSubject:?not set - call this from 'make check'}" true "${workFile1:?not set - call this from 'make check'}" true "${workFile2:?not set - call this from 'make check'}" # generate some data dd if=/dev/urandom of="${workFile1}" bs=1024 count=10240 2>/dev/null inputChecksum=$(cksum "${workFile1}" | awk '{print $1}') # read through pv and test afterwards "${testSubject}" -B 100000 -q "${workFile1}" > "${workFile2}" outputChecksum=$(cksum "${workFile2}" | awk '{print $1}') test "${inputChecksum}" = "${outputChecksum}" || exit 1 exit 0 pv-1.9.31/tests/Integrity_-_From_bursty_source.test000077500000000000000000000031501474702661500224600ustar00rootroot00000000000000#!/bin/sh # # Transfer a large chunk of data through pv using pipes, sending it in a # bursty fashion, and check data correctness afterwards. # Allow all tests to be skipped, e.g. during a release build test "${SKIP_ALL_TESTS}" = "1" && exit 77 true "${testSubject:?not set - call this from 'make check'}" true "${workFile1:?not set - call this from 'make check'}" true "${workFile2:?not set - call this from 'make check'}" # generate some data dd if=/dev/urandom of="${workFile1}" bs=1024 count=10240 2>/dev/null inputChecksum=$(cksum "${workFile1}" | awk '{print $1}') # read through pv and test afterwards ( dd if="${workFile1}" bs=1 count=9000 sleep 1 dd if="${workFile1}" bs=1 skip=9000 count=1240 sleep 1 dd if="${workFile1}" bs=1024 skip=10 count=1014 sleep 1 dd if="${workFile1}" bs=1024 skip=1024 count=1024 sleep 1 dd if="${workFile1}" bs=1024 skip=2048 ) 2>/dev/null | "${testSubject}" -q -L 2M | cat > "${workFile2}" outputChecksum=$(cksum "${workFile2}" | awk '{print $1}') if ! test "${inputChecksum}" = "${outputChecksum}"; then echo "checksum mismatch with dd | pv | cat" exit 1 fi # same again but with one less pipe ( dd if="${workFile1}" bs=1 count=9000 sleep 1 dd if="${workFile1}" bs=1 skip=9000 count=1240 sleep 1 dd if="${workFile1}" bs=1024 skip=10 count=1014 sleep 1 dd if="${workFile1}" bs=1024 skip=1024 count=1024 sleep 1 dd if="${workFile1}" bs=1024 skip=2048 ) 2>/dev/null | "${testSubject}" -q -L 2M > "${workFile2}" outputChecksum=$(cksum "${workFile2}" | awk '{print $1}') if ! test "${inputChecksum}" = "${outputChecksum}"; then echo "checksum mismatch with dd | pv > file" exit 1 fi exit 0 pv-1.9.31/tests/Integrity_-_Large_file_support.test000077500000000000000000000062021474702661500224130ustar00rootroot00000000000000#!/bin/sh # # Make sure that files larger than 2GB are supported. # Allow all tests to be skipped, e.g. during a release build test "${SKIP_ALL_TESTS}" = "1" && exit 77 true "${testSubject:?not set - call this from 'make check'}" true "${workFile1:?not set - call this from 'make check'}" true "${workFile2:?not set - call this from 'make check'}" # Check there is enough free space for this test. workFile1Dir="${workFile1%/*}" workFile1FreeKiB=$(df -kP "${workFile1Dir}" | sed -n '$p' | awk '{print $(NF-2)}') test -n "${workFile1FreeKiB}" || workFile1FreeKiB=0 if ! test "${workFile1FreeKiB}" -gt 3300000 2>/dev/null; then echo "test requires at least 3GB free on ${workFile1Dir}" exit 77 fi # Generate a 3GB sparse file - we don't really need 3GB of free space unless # sparse files are not supported. true > "${workFile1}" if ! dd if="/dev/zero" of="${workFile1}" count=1 bs=1048576 seek=3072 2>/dev/null; then echo "failed to create 3GB specimen file" exit 77 fi # NB the "stat" command is not portable - BSD stat(1) has a different syntax # to GNU stat(1) - so we have to parse the output of ls(1). # shellcheck disable=SC2012 fileSize=$(ls -nl "${workFile1}" 2>/dev/null | awk '{print $5}') test -n "${fileSize}" || fileSize=0 if ! test "${fileSize}" -gt 3000000; then echo "failed to validate specimen file size" exit 77 fi # Transfer the file, and count how many bytes came through. bytesTransferred=$("${testSubject}" -n -b "${workFile1}" 2>"${workFile2}" | wc -c 2>/dev/null | tr -dc '0-9') test -n "${bytesTransferred}" || bytesTransferred=0 bytesReported=$(sed -n '$p' "${workFile2}" | tr -dc '0-9') test -n "${bytesReported}" || bytesReported=0 if ! test "${bytesTransferred}" -eq "${fileSize}"; then echo "transferred ${bytesTransferred} of ${fileSize} bytes" exit 1 fi if ! test "${bytesReported}" -eq "${fileSize}"; then echo "counted ${bytesReported} of ${fileSize} bytes" exit 1 fi # Transfer the file from stdin, and count how many bytes came through. bytesTransferred=$("${testSubject}" -n -b < "${workFile1}" 2>"${workFile2}" | wc -c 2>/dev/null | tr -dc '0-9') test -n "${bytesTransferred}" || bytesTransferred=0 bytesReported=$(sed -n '$p' "${workFile2}" | tr -dc '0-9') test -n "${bytesReported}" || bytesReported=0 if ! test "${bytesTransferred}" -eq "${fileSize}"; then echo "stdin - transferred ${bytesTransferred} of ${fileSize} bytes" exit 1 fi if ! test "${bytesReported}" -eq "${fileSize}"; then echo "stdin - counted ${bytesReported} of ${fileSize} bytes" exit 1 fi # Use the file as a size value and transfer its size of bytes from dev/zero, # and count how many bytes came through. bytesTransferred=$("${testSubject}" -n -b -S -s "@${workFile1}" /dev/zero 2>"${workFile2}" | wc -c 2>/dev/null | tr -dc '0-9') test -n "${bytesTransferred}" || bytesTransferred=0 bytesReported=$(sed -n '$p' "${workFile2}" | tr -dc '0-9') test -n "${bytesReported}" || bytesReported=0 if ! test "${bytesTransferred}" -eq "${fileSize}"; then echo "size read - transferred ${bytesTransferred} of ${fileSize} bytes" exit 1 fi if ! test "${bytesReported}" -eq "${fileSize}"; then echo "size read - counted ${bytesReported} of ${fileSize} bytes" exit 1 fi exit 0 pv-1.9.31/tests/Integrity_-_On_output_pipe_close.test000077500000000000000000000023771474702661500227750ustar00rootroot00000000000000#!/bin/sh # # Check that there is no SIGPIPE or dropped data on bigger data transfers. # Allow all tests to be skipped, e.g. during a release build test "${SKIP_ALL_TESTS}" = "1" && exit 77 true "${testSubject:?not set - call this from 'make check'}" # We nead GNU head. On some platforms it is named ghead instead of head. HEAD="head" for checkPath in $(echo "${PATH}" | tr ':' '\n') do if test -x "${checkPath}/ghead" then HEAD="${checkPath}/ghead" break fi done # Check that it really is GNU head, and skip the test if not. if ! echo | "${HEAD}" -c 10 >/dev/null 2>&1; then echo "GNU \`head' is required" exit 77 fi # Don't use dd. See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=324308 stopAtByteCount="100000000" #COUNT2=`"${testSubject}" -B 100000 -q /dev/zero | $HEAD -c $COUNT1 | wc -c | tr -d ' '` # We have to remove \n here, to fix the test on AIX. bytesTransferred=$("${testSubject}" -B 100000 -q /dev/zero | "${HEAD}" -c "${stopAtByteCount}" | tr -d '\n' | wc -c | tr -dc '0-9') if ! test "${stopAtByteCount}" = "${bytesTransferred}"; then echo "number bytes transferred was not the expected value" echo "transferred: ${bytesTransferred}" echo "expected: ${stopAtByteCount}" exit 1 fi exit 0 pv-1.9.31/tests/Integrity_-_When_adjusted_remotely.test000077500000000000000000000045141474702661500232760ustar00rootroot00000000000000#!/bin/sh # # Try repeatedly messaging a transfer process, and make sure the data stays # intact. # Allow all tests to be skipped, e.g. during a release build test "${SKIP_ALL_TESTS}" = "1" && exit 77 true "${testSubject:?not set - call this from 'make check'}" true "${workFile1:?not set - call this from 'make check'}" true "${workFile2:?not set - call this from 'make check'}" true "${workFile3:?not set - call this from 'make check'}" true "${workFile4:?not set - call this from 'make check'}" # Do nothing if it is not supported. if ! "${testSubject}" -h 2>/dev/null | grep -Eq "^ -R,"; then echo "Not supported on this platform" exit 77 fi # Generate 10MiB of data. dd if=/dev/urandom of="${workFile1}" bs=1024 count=10240 2>/dev/null # Run a few remote control commands in the background. # echo FAIL > "${workFile3}" true > "${workFile4}" ( set +e # Don't start doing anything until the main transfer process, started below, has begun. while test -e "${workFile4}" && ! test -s "${workFile4}"; do sleep 0.1; done sleep 2 for loopCount in 1 2 3; do "${testSubject}" -R "$(cat "${workFile4}")" -apterb || exit 1 (usleep 200000 || sleep 1) 2>/dev/null "${testSubject}" -R "$(cat "${workFile4}")" -p || exit 1 (usleep 200000 || sleep 1) 2>/dev/null "${testSubject}" -R "$(cat "${workFile4}")" -N "test" || exit 1 (usleep 200000 || sleep 1) 2>/dev/null "${testSubject}" -R "$(cat "${workFile4}")" -F "%e" || exit 1 (usleep 200000 || sleep 1) 2>/dev/null "${testSubject}" -R "$(cat "${workFile4}")" -x "window:%b" || exit 1 (usleep 200000 || sleep 1) 2>/dev/null "${testSubject}" -R "$(cat "${workFile4}")" -N "." || exit 1 (usleep 200000 || sleep 1) 2>/dev/null echo "${loopCount}" >/dev/null # dummy for shellcheck done "${testSubject}" -R "$(cat "${workFile4}")" -L 10M echo OK > "${workFile3}" ) & # Run our data transfer. "${testSubject}" -L 100k -i 0.1 -f -P "${workFile4}" "${workFile1}" > "${workFile2}" 2>/dev/null # Check our remote control calls ran OK. backgroundStatus=$(cat "${workFile3}") if ! test "${backgroundStatus}" = "OK"; then echo "remote control calls failed" exit 1 fi # Check data integrity. inputChecksum=$(cksum "${workFile1}" | awk '{print $1}') outputChecksum=$(cksum "${workFile2}" | awk '{print $1}') if ! test "${inputChecksum}" = "${outputChecksum}"; then echo "input and output checksums differ" exit 1 fi exit 0 pv-1.9.31/tests/Memory_safety_-_Basic.test000077500000000000000000000026741474702661500204650ustar00rootroot00000000000000#!/bin/sh # # Run valgrind's memory checker against a process using various different # transfer options. # Allow all tests to be skipped, e.g. during a release build test "${SKIP_ALL_TESTS}" = "1" && exit 77 true "${sourcePath:?not set - call this from 'make check'}" true "${testSubject:?not set - call this from 'make check'}" true "${workFile1:?not set - call this from 'make check'}" true "${workFile2:?not set - call this from 'make check'}" true "${workFile3:?not set - call this from 'make check'}" true "${workFile4:?not set - call this from 'make check'}" # Load the valgrind function. . "${sourcePath}/tests/run-valgrind.sh" # Plain, no options. { echo "testing" | runWithValgrind >/dev/null 2>&1; } 4>&1 || exit 1 # With --force. { echo "testing" | runWithValgrind -f >/dev/null 2>&1; } 4>&1 || exit 1 # Check "--average-rate". (dd if=/dev/zero bs=100 count=1 2>/dev/null; sleep 1; dd if=/dev/zero bs=110 count=1 2>/dev/null; sleep 1; ) | { runWithValgrind -f -i 0.5 -a >/dev/null 2>"${workFile1}"; } 4>&1 || exit 1 # Check "--buffer-size" and "--buffer-percent". { \ ( dd if=/dev/zero bs=1024 count=1024; sleep 2; ) 2>/dev/null \ | runWithValgrind -f -T -i 0.5 -B 1024 2>"${workFile1}" \ | (sleep 1; dd bs=1024 count=512; sleep 1; cat; ) >/dev/null 2>&1; \ } 4>&1 || exit 1 # Check "--numeric" "--bytes" "--line-mode". seq -w 3 1 100 \ | { runWithValgrind -bnl -i 0.2 -f -L 100 2>"${workFile1}" > "${workFile2}"; } 4>&1 || exit 1 exit 0 pv-1.9.31/tests/Memory_safety_-_Process_title.test000077500000000000000000000021421474702661500222510ustar00rootroot00000000000000#!/bin/sh # # Run valgrind's memory checker against a process that sets is process # title. # Allow all tests to be skipped, e.g. during a release build test "${SKIP_ALL_TESTS}" = "1" && exit 77 true "${sourcePath:?not set - call this from 'make check'}" true "${testSubject:?not set - call this from 'make check'}" true "${workFile1:?not set - call this from 'make check'}" true "${workFile2:?not set - call this from 'make check'}" true "${workFile3:?not set - call this from 'make check'}" true "${workFile4:?not set - call this from 'make check'}" # Load the valgrind function. . "${sourcePath}/tests/run-valgrind.sh" # Without an extra format string. (dd if=/dev/zero bs=100 count=1 2>/dev/null; sleep 1; dd if=/dev/zero bs=110 count=1 2>/dev/null; sleep 1; ) | { runWithValgrind -f -i 0.5 -a -x processtitle >/dev/null 2>"${workFile1}"; } 4>&1 || exit 1 # With an extra format string. (dd if=/dev/zero bs=100 count=1 2>/dev/null; sleep 1; dd if=/dev/zero bs=110 count=1 2>/dev/null; sleep 1; ) | { runWithValgrind -f -i 0.5 -a -x 'processtitle:%t %b' >/dev/null 2>"${workFile1}"; } 4>&1 || exit 1 exit 0 pv-1.9.31/tests/Memory_safety_-_Remote_control_receiver.test000077500000000000000000000035761474702661500243250ustar00rootroot00000000000000#!/bin/sh # # Run valgrind's memory checker while receiving remote control commands. # Allow all tests to be skipped, e.g. during a release build test "${SKIP_ALL_TESTS}" = "1" && exit 77 true "${sourcePath:?not set - call this from 'make check'}" true "${testSubject:?not set - call this from 'make check'}" true "${workFile1:?not set - call this from 'make check'}" true "${workFile2:?not set - call this from 'make check'}" true "${workFile3:?not set - call this from 'make check'}" true "${workFile4:?not set - call this from 'make check'}" # Do nothing if it is not supported. if ! "${testSubject}" -h 2>/dev/null | grep -Eq "^ -R,"; then echo "Not supported on this platform" exit 77 fi # Load the valgrind function. . "${sourcePath}/tests/run-valgrind.sh" dd if=/dev/urandom of="${workFile1}" bs=1024 count=10240 2>/dev/null # Check from the POV of the process being controlled. true > "${workFile3}" ( set +e while test -e "${workFile3}" && ! test -s "${workFile3}"; do usleep 200000 2>/dev/null || sleep 1; done for loopCount in 1 2 3; do "${testSubject}" -R "$(cat "${workFile3}")" -apterb || exit 1 (usleep 200000 || sleep 1) 2>/dev/null "${testSubject}" -R "$(cat "${workFile3}")" -p || exit 1 (usleep 200000 || sleep 1) 2>/dev/null "${testSubject}" -R "$(cat "${workFile3}")" -N "test" || exit 1 (usleep 200000 || sleep 1) 2>/dev/null "${testSubject}" -R "$(cat "${workFile3}")" -F "%e" || exit 1 (usleep 200000 || sleep 1) 2>/dev/null "${testSubject}" -R "$(cat "${workFile3}")" -x "window:%b" || exit 1 (usleep 200000 || sleep 1) 2>/dev/null "${testSubject}" -R "$(cat "${workFile3}")" -N "." || exit 1 (usleep 200000 || sleep 1) 2>/dev/null echo "${loopCount}" >/dev/null # dummy for shellcheck done "${testSubject}" -R "$(cat "${workFile3}")" -L 10M ) & { runWithValgrind -L 100k -i 0.1 -f -P "${workFile3}" "${workFile1}" > "${workFile2}" 2>/dev/null; } 4>&1 || exit 1 exit 0 pv-1.9.31/tests/Memory_safety_-_Remote_control_sender.test000077500000000000000000000035231474702661500237710ustar00rootroot00000000000000#!/bin/sh # # Run valgrind's memory checker while using remote control to control # another process. # Allow all tests to be skipped, e.g. during a release build test "${SKIP_ALL_TESTS}" = "1" && exit 77 true "${sourcePath:?not set - call this from 'make check'}" true "${testSubject:?not set - call this from 'make check'}" true "${workFile1:?not set - call this from 'make check'}" true "${workFile2:?not set - call this from 'make check'}" true "${workFile3:?not set - call this from 'make check'}" true "${workFile4:?not set - call this from 'make check'}" # Do nothing if it is not supported. if ! "${testSubject}" -h 2>/dev/null | grep -Eq "^ -R,"; then echo "Not supported on this platform" exit 77 fi # Load the valgrind function. . "${sourcePath}/tests/run-valgrind.sh" dd if=/dev/urandom of="${workFile1}" bs=1024 count=10240 2>/dev/null # Check from the POV of the process sending a control command. true > "${workFile3}" "${testSubject}" -L 100k -i 0.1 -f -P "${workFile3}" "${workFile1}" > "${workFile2}" 2>/dev/null & while test -e "${workFile3}" && ! test -s "${workFile3}"; do usleep 200000 2>/dev/null || sleep 1; done runWithValgrind -R "$(cat "${workFile3}")" -apterb 4>&1 || exit 1 (usleep 200000 || sleep 1) 2>/dev/null runWithValgrind -R "$(cat "${workFile3}")" -p 4>&1 || exit 1 (usleep 200000 || sleep 1) 2>/dev/null runWithValgrind -R "$(cat "${workFile3}")" -N "test" 4>&1 || exit 1 (usleep 200000 || sleep 1) 2>/dev/null runWithValgrind -R "$(cat "${workFile3}")" -F "%e" 4>&1 || exit 1 (usleep 200000 || sleep 1) 2>/dev/null runWithValgrind -R "$(cat "${workFile3}")" -x "window:%b" 4>&1 || exit 1 (usleep 200000 || sleep 1) 2>/dev/null runWithValgrind -R "$(cat "${workFile3}")" -N "." 4>&1 || exit 1 (usleep 200000 || sleep 1) 2>/dev/null runWithValgrind -R "$(cat "${workFile3}")" -L 10M 4>&1 || exit 1 wait exit 0 pv-1.9.31/tests/Memory_safety_-_Watchfd.test000077500000000000000000000036431474702661500210210ustar00rootroot00000000000000#!/bin/sh # # Run valgrind's memory checker against a process using the --watchfd # option. # Allow all tests to be skipped, e.g. during a release build test "${SKIP_ALL_TESTS}" = "1" && exit 77 true "${sourcePath:?not set - call this from 'make check'}" true "${testSubject:?not set - call this from 'make check'}" true "${workFile1:?not set - call this from 'make check'}" true "${workFile2:?not set - call this from 'make check'}" true "${workFile3:?not set - call this from 'make check'}" true "${workFile4:?not set - call this from 'make check'}" # Load the valgrind function. . "${sourcePath}/tests/run-valgrind.sh" # Skip the test if "-d" is not available. if ! "${testSubject}" -h | grep -Fq ' -d'; then echo "no \`--watchfd' / \`-d' option on this platform" exit 77 fi # Skip the test if "-d" does not work. sleep 2 & pid=$! sleep 0.1 "${testSubject}" -d "${pid}" -f -i 0.5 >/dev/null 2>"${workFile1}" if grep -Fq ' -d: not available' "${workFile1}"; then echo "no \`--watchfd' / \`-d' option on this platform" exit 77 fi # Check "--watchfd PID:FD". # See the "Watchfd" tests for more detail. seq 1 100 > "${workFile1}" true > "${workFile3}" # shellcheck disable=SC2030 (while test -e "${workFile3}" && ! test -s "${workFile3}"; do sleep 0.1; done; sleep 1; read -r line; sleep 1; read -r line; sleep 1) <"${workFile1}" & pid=$! sleep 0.1 { runWithValgrind -P "${workFile3}" -d "${pid}:0" -f -i 0.5 >/dev/null 2>&1; } 4>&1 || exit 1 # Check "--watchfd PID". seq 1 100 > "${workFile1}" seq 1 300 > "${workFile2}" true > "${workFile3}" # shellcheck disable=SC2030 ( while test -e "${workFile3}" && ! test -s "${workFile3}"; do sleep 0.1; done sleep 1 read -r line exec 9<"${workFile2}" sleep 1 exec 8<"${workFile1}" exec 7/dev/null 2>&1; } 4>&1 || exit 1 exit 0 pv-1.9.31/tests/Modifiers_-_--direct-io.test000077500000000000000000000036311474702661500205450ustar00rootroot00000000000000#!/bin/sh # # Transfer a large chunk of data with "--direct-io" and check data # correctness afterwards, both with and without rate limits. Note that this # doesn't check that O_DIRECT is actually being used, it just checks that # data is not being corrupted. # Allow all tests to be skipped, e.g. during a release build test "${SKIP_ALL_TESTS}" = "1" && exit 77 true "${testSubject:?not set - call this from 'make check'}" true "${workFile1:?not set - call this from 'make check'}" true "${workFile2:?not set - call this from 'make check'}" # generate some data dd if=/dev/urandom of="${workFile1}" bs=1024 count=2560 2>/dev/null inputChecksum=$(cksum "${workFile1}" | awk '{print $1}') doubleInputChecksum=$(cat "${workFile1}" "${workFile1}" | cksum | awk '{print $1}') # read through pv and test afterwards "${testSubject}" -q "${workFile1}" > "${workFile2}" outputChecksum=$(cksum "${workFile2}" | awk '{print $1}') if ! test "${inputChecksum}" = "${outputChecksum}"; then echo "checksum mismatched even without \"--direct-io\"" exit 1 fi # Same again but with "--direct-io" "${testSubject}" -K -q "${workFile1}" > "${workFile2}" outputChecksum=$(cksum "${workFile2}" | awk '{print $1}') if ! test "${inputChecksum}" = "${outputChecksum}"; then echo "checksum mismatched with \"--direct-io\"" exit 1 fi # Now with "--direct-io" and "--rate-limit" "${testSubject}" -K -L 800K -q "${workFile1}" > "${workFile2}" outputChecksum=$(cksum "${workFile2}" | awk '{print $1}') if ! test "${inputChecksum}" = "${outputChecksum}"; then echo "checksum mismatched with \"--direct-io\" + \"--rate-limit\"" exit 1 fi # Now with "--direct-io" on the same file twice "${testSubject}" -K -q "${workFile1}" "${workFile1}" > "${workFile2}" outputChecksum=$(cksum "${workFile2}" | awk '{print $1}') if ! test "${doubleInputChecksum}" = "${outputChecksum}"; then echo "checksum mismatched with \"--direct-io\" on two files" exit 1 fi exit 0 pv-1.9.31/tests/Modifiers_-_--force.test000077500000000000000000000021621474702661500177620ustar00rootroot00000000000000#!/bin/sh # # Check that the progress bar is produced when "--force" is used, and is not # when it is not, providing stderr is a file. # Allow all tests to be skipped, e.g. during a release build test "${SKIP_ALL_TESTS}" = "1" && exit 77 true "${testSubject:?not set - call this from 'make check'}" true "${workFile1:?not set - call this from 'make check'}" dd if=/dev/zero bs=100 count=1 2>/dev/null \ | "${testSubject}" -f -p -i 0.1 -L 100 >/dev/null 2>"${workFile1}" # There should be more than 2 different lines of output. # lineCount=$(tr '\r' '\n' < "${workFile1}" | sort | uniq -u | wc -l | tr -dc '0-9') if ! test "${lineCount}" -gt 2; then echo "fewer than 3 different progress lines with \"--force\" (${lineCount})" tr '\r' '\n' < "${workFile1}" | sort | uniq -u exit 1 fi # Now try again without "--force". dd if=/dev/zero bs=100 count=1 2>/dev/null \ | "${testSubject}" -p -i 0.1 -L 100 >/dev/null 2>"${workFile1}" # There should be no output without "--force". # if test -s "${workFile1}"; then echo "unexpected output when not using \"--force\"" tr '\r' '\n' < "${workFile1}" | sort | uniq -u exit 1 fi exit 0 pv-1.9.31/tests/Modifiers_-_--interval.test000077500000000000000000000011141474702661500205040ustar00rootroot00000000000000#!/bin/sh # # Check that the update interval can be set. # Allow all tests to be skipped, e.g. during a release build test "${SKIP_ALL_TESTS}" = "1" && exit 77 true "${testSubject:?not set - call this from 'make check'}" true "${workFile1:?not set - call this from 'make check'}" sleep 1 | "${testSubject}" -f -i 0.1 >/dev/null 2>"${workFile1}" # There should be more than 6 lines of output. # lineCount=$(tr '\r' '\n' < "${workFile1}" | wc -l | tr -dc '0-9') if ! test "${lineCount}" -gt 6; then echo "fewer than 7 lines of output" tr '\r' '\n' < "${workFile1}" exit 1 fi exit 0 pv-1.9.31/tests/Modifiers_-_--line-mode.test000077500000000000000000000017511474702661500205400ustar00rootroot00000000000000#!/bin/sh # # Check that line mode counts lines instead of bytes. # Allow all tests to be skipped, e.g. during a release build test "${SKIP_ALL_TESTS}" = "1" && exit 77 true "${testSubject:?not set - call this from 'make check'}" true "${workFile1:?not set - call this from 'make check'}" # Pass through 100 lines. # seq 1 100 \ | "${testSubject}" -bl -i 0.2 -f -L 50 >/dev/null 2>"${workFile1}" lineCount=$(tr '\r' '\n' < "${workFile1}" | sort | uniq -u | wc -l | tr -dc '0-9') lastNumber=$(tr '\r' '\n' < "${workFile1}" | awk '/[0-9]/{printf "%.0f\n",$1}' | sed -n '$p') # The last number output should be the number of input lines. if ! test "${lastNumber}" = "100"; then echo "line counter was incorrect (${lastNumber} instead of 100)" tr '\r' '\n' < "${workFile1}" exit 1 fi # There should be more than 3 output lines as the counter increased. if ! test "${lineCount}" -gt 3; then echo "fewer than 4 line counter values (${lineCount})" tr '\r' '\n' < "${workFile1}" exit 1 fi exit 0 pv-1.9.31/tests/Modifiers_-_--size.test000077500000000000000000000031671474702661500176440ustar00rootroot00000000000000#!/bin/sh # # Check that "--size" affects the percentage shown. # Allow all tests to be skipped, e.g. during a release build test "${SKIP_ALL_TESTS}" = "1" && exit 77 true "${testSubject:?not set - call this from 'make check'}" true "${workFile1:?not set - call this from 'make check'}" # Process 100 bytes at 100 bytes per second, updating every 0.1 seconds for # around 10 output lines, but set the size to 200. # dd if=/dev/zero bs=100 count=1 2>/dev/null \ | "${testSubject}" -s 200 -n -i 0.1 -L 100 >/dev/null 2>"${workFile1}" lineCount=$(wc -l < "${workFile1}" | tr -dc '0-9') finalLine=$(sed -n '$p' < "${workFile1}") # The number of output lines should be >8 and <13, and the final percentage # should be 50. # if ! test "${lineCount}" -gt 8; then echo "part 1: fewer than 9 output lines (${lineCount})" exit 1 fi if ! test "${lineCount}" -lt 13; then echo "part 1: more than 12 output lines (${lineCount})" exit 1 fi if ! test "${finalLine}" = "50"; then echo "part 1: final percentage was not 50 (${finalLine})" exit 1 fi # Same as above, but this time with a size of 50 for 100 input bytes. # dd if=/dev/zero bs=100 count=1 2>/dev/null \ | "${testSubject}" -s 50 -n -i 0.1 -L 100 >/dev/null 2>"${workFile1}" lineCount=$(wc -l < "${workFile1}" | tr -dc '0-9') finalLine=$(sed -n '$p' < "${workFile1}") if ! test "${lineCount}" -gt 8; then echo "part 2: fewer than 9 output lines (${lineCount})" exit 1 fi if ! test "${lineCount}" -lt 13; then echo "part 2: more than 12 output lines (${lineCount})" exit 1 fi if ! test "${finalLine}" = "200"; then echo "part 2: final percentage was not 200 (${finalLine})" exit 1 fi exit 0 pv-1.9.31/tests/Modifiers_-_--size_from_file_size.test000077500000000000000000000030441474702661500227120ustar00rootroot00000000000000#!/bin/sh # # Similar to the "--size" check but, instead, using another file's size with # "--size @". # Allow all tests to be skipped, e.g. during a release build test "${SKIP_ALL_TESTS}" = "1" && exit 77 true "${testSubject:?not set - call this from 'make check'}" true "${workFile1:?not set - call this from 'make check'}" true "${workFile2:?not set - call this from 'make check'}" # Process 100 bytes at 100 bytes per second, interval 0.1 seconds, with the # size set from a file of $1 bytes and expecting a percentage of $2 at the # end. sizeCheck () { # Make a file of size $1 bytes, for reference. dd if=/dev/zero bs="$1" count=1 2>/dev/null >"${workFile2}" # Run 100 bytes through the program, using the reference file's size # as the percentage reference. dd if=/dev/zero bs=100 count=1 2>/dev/null \ | "${testSubject}" -s "@${workFile2}" -n -i 0.1 -L 100 >/dev/null 2>"${workFile1}" lineCount=$(wc -l < "${workFile1}" | tr -dc '0-9') finalLine=$(sed -n '$p' < "${workFile1}") # The number of output lines should be >5 and <13, and the final # percentage should be $2. # if ! test "${lineCount}" -gt 5; then echo "(reference size=$1) fewer than 6 output lines (${lineCount})" exit 1 fi if ! test "${lineCount}" -lt 13; then echo "(reference size=$1) more than 12 output lines (${lineCount})" exit 1 fi if ! test "${finalLine}" = "$2"; then echo "(reference size=$1): final percentage was not $2 (${finalLine})" ls -l "${workFile2}" cat "${workFile1}" exit 1 fi } sizeCheck 100 100 sizeCheck 200 50 sizeCheck 50 200 exit 0 pv-1.9.31/tests/Modifiers_-_--sync.test000077500000000000000000000027621474702661500176460ustar00rootroot00000000000000#!/bin/sh # # Transfer a large chunk of data with "--sync" and check data correctness # afterwards, both with and without rate limits. Note that this doesn't # check that fdatasync() is actually being called, it just checks that data # is not being corrupted. # Allow all tests to be skipped, e.g. during a release build test "${SKIP_ALL_TESTS}" = "1" && exit 77 true "${testSubject:?not set - call this from 'make check'}" true "${workFile1:?not set - call this from 'make check'}" true "${workFile2:?not set - call this from 'make check'}" # generate some data dd if=/dev/urandom of="${workFile1}" bs=1024 count=2560 2>/dev/null inputChecksum=$(cksum "${workFile1}" | awk '{print $1}') # read through pv and test afterwards "${testSubject}" -q "${workFile1}" > "${workFile2}" outputChecksum=$(cksum "${workFile2}" | awk '{print $1}') if ! test "${inputChecksum}" = "${outputChecksum}"; then echo "checksum mismatched even without \"--sync\"" exit 1 fi # Same again but with "--sync" "${testSubject}" -Y -q "${workFile1}" > "${workFile2}" outputChecksum=$(cksum "${workFile2}" | awk '{print $1}') if ! test "${inputChecksum}" = "${outputChecksum}"; then echo "checksum mismatched with \"--sync\"" exit 1 fi # Now with "--sync" and "--rate-limit" "${testSubject}" -Y -L 800K -q "${workFile1}" > "${workFile2}" outputChecksum=$(cksum "${workFile2}" | awk '{print $1}') if ! test "${inputChecksum}" = "${outputChecksum}"; then echo "checksum mismatched with \"--sync\" + \"--rate-limit\"" exit 1 fi exit 0 pv-1.9.31/tests/Terminal_-_Detect_width.test000077500000000000000000000054771474702661500210070ustar00rootroot00000000000000#!/bin/sh # # Check that the terminal width is detected on startup. # Allow all tests to be skipped, e.g. during a release build test "${SKIP_ALL_TESTS}" = "1" && exit 77 true "${testSubject:?not set - call this from 'make check'}" true "${workFile1:?not set - call this from 'make check'}" true "${workFile2:?not set - call this from 'make check'}" # Skip the test if `tmux' is not available. if ! command -v tmux >/dev/null 2>&1; then echo "test requires \`tmux'" exit 77 fi # Skip the test if `tmux' does not have "-C". if echo "kill-server" | tmux -C -L pvtest 2>&1 | grep -Fq "tmux: unknown option"; then echo "test requires a newer \`tmux'" exit 77 fi # Run the given command $3 inside a terminal of the given width $1, waiting # $2 seconds, and output the results. # runInTerminal () { terminalWidth="$1" secondsToWait="$2" commandToRun="$3" { echo "set remain-on-exit on" echo "new-session -d -x ${terminalWidth} -y 5" # starting the session doesn't always correctly set the size echo "resize-window -x ${terminalWidth} -y 5" # tmux 1.8 doesn't have "resize-window" echo "resize-pane -x ${terminalWidth} -y 5" echo "pipe-pane 'cat > ${workFile1}'" sleep 0.5 echo "respawn-pane -k \"${commandToRun}\"" sleep "${secondsToWait}" echo "kill-server" sleep 1 } \ | tmux -C -L pvtest >/dev/null cat "${workFile1}" } # Run a progress meter inside a terminal of the given width, and output the # longest number of characters seen between "[" and "]". # runWidthTest () { runInTerminal "$1" "$2" "${testSubject} -pSs 1K /dev/null" \ | tr '\r' '\n' \ | sed -n 's/^.*\[//;s/\].*$//p' \ | awk 'BEGIN {m=0} {n=length($0); m=(n>m?n:m)} END {print m}' } # Perform a test run of the given width and exit on failure. The longest # bar found by runWidthTest() should be the width of the terminal minus the # "[] 100%" characters, i.e. 7 less. # widthTest () { terminalWidth="$1" longestBar=$(runWidthTest "${terminalWidth}" 1) # Retry test with longer delay, if null result. if test -z "${longestBar}" || test "${longestBar}" -eq 0; then longestBar=$(runWidthTest "${terminalWidth}" 5) fi if test -z "${longestBar}"; then echo "no output from test at width=${terminalWidth}" exit 1 elif ! test "${longestBar}" -eq $((terminalWidth-7)); then echo "bar size incorrect (${longestBar}) at width=${terminalWidth}" exit 1 fi } # Check that tmux can actually resize the terminal. checkSize="100" detectedWidth=$(runInTerminal "${checkSize}" 1 "stty -a | tr \\\";\\\" \\\"\\\\n\\\" | grep col | sed -n 1p | tr -dc 0-9") if ! test "${detectedWidth}" = "${checkSize}"; then echo "test requires a \`tmux' that can resize a detached window (requested width ${checkSize}, detected ${detectedWidth})" exit 77 fi # Test the progress bar width at various terminal sizes. widthTest 80 widthTest 120 widthTest 400 widthTest 20 exit 0 pv-1.9.31/tests/Transfer_-_--rate-limit.test000077500000000000000000000010171474702661500205740ustar00rootroot00000000000000#!/bin/sh # # A simple test of rate limiting. # Allow all tests to be skipped, e.g. during a release build test "${SKIP_ALL_TESTS}" = "1" && exit 77 true "${testSubject:?not set - call this from 'make check'}" # Transfer 102 bytes at 100 bytes/sec. It should take at least 1 second. # startTime=$(date +%S) dd if=/dev/zero bs=102 count=1 2>/dev/null | "${testSubject}" -L 100 2>/dev/null | cat >/dev/null endTime=$(date +%S) if test "${startTime}" = "${endTime}"; then echo "transfer took zero seconds" exit 1 fi exit 0 pv-1.9.31/tests/Transfer_-_--remote.test000077500000000000000000000026511474702661500200250ustar00rootroot00000000000000#!/bin/sh # # Try changing the format of a transfer remotely. # Allow all tests to be skipped, e.g. during a release build test "${SKIP_ALL_TESTS}" = "1" && exit 77 true "${testSubject:?not set - call this from 'make check'}" true "${workFile1:?not set - call this from 'make check'}" true "${workFile2:?not set - call this from 'make check'}" true "${workFile3:?not set - call this from 'make check'}" true "${workFile4:?not set - call this from 'make check'}" # Do nothing if it is not supported. if ! "${testSubject}" -h 2>/dev/null | grep -Eq "^ -R,"; then echo "Not supported on this platform" exit 77 fi # Generate a 10MiB test file of null bytes. dd if=/dev/zero of="${workFile1}" bs=1024 count=10240 2>/dev/null true > "${workFile4}" ( # Don't start doing anything until the main transfer process, started below, has begun. while test -e "${workFile4}" && ! test -s "${workFile4}"; do sleep 0.1; done sleep 1 "${testSubject}" -R "$(cat "${workFile4}")" -a sleep 2 "${testSubject}" -R "$(cat "${workFile4}")" -L 10M ) & "${testSubject}" -L 2M -f -P "${workFile4}" "${workFile1}" > "${workFile2}" 2>"${workFile3}" # Make sure there is more than one length of line (excluding blank lines). line_lengths=$(tr '\r' '\n' < "${workFile3}" | awk '{print length($0)}' | grep -Fvx 0 | sort -n | uniq | wc -l | tr -dc '0-9') if ! test "${line_lengths}" -gt 1; then echo "only one line length seen - format change failed" exit 1 fi exit 0 pv-1.9.31/tests/Transfer_-_--stop-at-size.test000077500000000000000000000015651474702661500210740ustar00rootroot00000000000000#!/bin/sh # # Make sure -S stops at the given size. # Allow all tests to be skipped, e.g. during a release build test "${SKIP_ALL_TESTS}" = "1" && exit 77 true "${testSubject:?not set - call this from 'make check'}" true "${workFile1:?not set - call this from 'make check'}" true "${workFile2:?not set - call this from 'make check'}" # generate some data dd if=/dev/urandom of="${workFile1}" bs=1024 count=10 2>/dev/null # read through pv and test afterwards "${testSubject}" -S -s 5120 -q "${workFile1}" > "${workFile2}" outputChecksum=$(cksum "${workFile2}" | awk '{print $1}') # take the first 5120 bytes of workFile1 and cksum them dd if="${workFile1}" of="${workFile2}" bs=1024 count=5 2>/dev/null inputChecksum=$(cksum "${workFile2}" | awk '{print $1}') if ! test "${inputChecksum}" = "${outputChecksum}"; then echo "input and output checksums differ" exit 1 fi exit 0 pv-1.9.31/tests/Watchfd_-_Multiple_descriptors.test000077500000000000000000000051501474702661500224050ustar00rootroot00000000000000#!/bin/sh # # Check that watching a process's file descriptors works as expected. # Allow all tests to be skipped, e.g. during a release build test "${SKIP_ALL_TESTS}" = "1" && exit 77 true "${testSubject:?not set - call this from 'make check'}" true "${workFile1:?not set - call this from 'make check'}" true "${workFile2:?not set - call this from 'make check'}" true "${workFile3:?not set - call this from 'make check'}" true "${workFile4:?not set - call this from 'make check'}" # Skip the test if "-d" is not available. if ! "${testSubject}" -h | grep -Fq ' -d'; then echo "no \`--watchfd' / \`-d' option on this platform" exit 77 fi seq 1 100 > "${workFile1}" seq 1 300 > "${workFile2}" # Run a background process to perform a few reads from a file, opening a # second file after a moment. # We only start doing anything once the PV process below has started (the # workFile3 check). # NB we just export line to make shellcheck think it's used. true > "${workFile3}" ( while test -e "${workFile3}" && ! test -s "${workFile3}"; do sleep 0.1; done export line sleep 1 read -r line exec 9<"${workFile2}" sleep 1 read -r line sleep 1 ) <"${workFile1}" & pid=$! sleep 0.1 "${testSubject}" -P "${workFile3}" -d "${pid}" -f -i 0.5 >/dev/null 2>"${workFile4}" # Skip the test if "-d" does not work. if grep -Fq ' -d: not available' "${workFile4}"; then echo "no \`--watchfd' / \`-d' option on this platform" exit 77 fi # Process the output to make it easier to handle. # NB "ESC [ A" is "cursor up", we turn that into "-" and a newline. tr '\r' '\n' < "${workFile4}" | sed 's/.\[A/-!/g' | tr '!' '\n' > "${workFile1}" # We should see at least 2 file positions for fd 0. positionsReported="$(awk '/^ *0:/ {print $2}' < "${workFile1}" | sort -n | uniq)" differentNumbers="$(printf "%s\n" "${positionsReported}" | grep -Ec .)" if ! test "${differentNumbers}" -gt 1; then printf "%s\n" "Expected at least 2 different numbers to be output for fd 0" printf "%s:\n%s\n" "Positions reported" "${positionsReported}" printf "%s: %s\n" "Number of different values seen" "${differentNumbers}" printf "%s\n" "Raw output:" cat "${workFile1}" exit 1 fi # We should see file descriptor 9 appear. if ! grep -Eq '^ *9:' < "${workFile1}"; then printf "%s\n" "Expected to see information for fd 9" printf "%s\n" "Raw output:" cat "${workFile1}" exit 1 fi # We should see the last 6 characters of fd 9's filename appear. lastChars="$(printf "%s\n" "${workFile2}" | rev | cut -b1-6 | rev)" if ! grep -Fq "${lastChars}:" < "${workFile1}"; then printf "%s\n" "Expected to see a filename for fd 9" printf "%s\n" "Raw output:" cat "${workFile1}" exit 1 fi exit 0 pv-1.9.31/tests/Watchfd_-_Single_descriptor.test000077500000000000000000000034711474702661500216540ustar00rootroot00000000000000#!/bin/sh # # Check that watching a single file descriptor works as expected. # Allow all tests to be skipped, e.g. during a release build test "${SKIP_ALL_TESTS}" = "1" && exit 77 true "${testSubject:?not set - call this from 'make check'}" true "${workFile1:?not set - call this from 'make check'}" true "${workFile2:?not set - call this from 'make check'}" true "${workFile3:?not set - call this from 'make check'}" # Skip the test if "-d" is not available. if ! "${testSubject}" -h | grep -Fq ' -d'; then echo "no \`--watchfd' / \`-d' option on this platform" exit 77 fi seq 1 100 > "${workFile1}" # Run a background process to perform a few reads from a file. # We only start doing anything once the PV process below has started (the # workFile3 check). # NB we just export line to make shellcheck think it's used. true > "${workFile3}" ( while test -e "${workFile3}" && ! test -s "${workFile3}"; do sleep 0.1; done export line; sleep 1; read -r line; sleep 1; read -r line; sleep 1 ) <"${workFile1}" & pid=$! sleep 0.1 "${testSubject}" -P "${workFile3}" -d "${pid}:0" -f -i 0.5 >/dev/null 2>"${workFile2}" # Skip the test if "-d" does not work. if grep -Fq ' -d: not available' "${workFile2}"; then echo "no \`--watchfd' / \`-d' option on this platform" exit 77 fi # There should be at least 2 different numbers starting the output lines. positionsReported="$(tr '\r' '\n' < "${workFile2}" | awk '{print $1}' | sort -n | uniq)" differentNumbers="$(printf "%s\n" "${positionsReported}" | grep -Ec .)" if ! test "${differentNumbers}" -gt 1; then printf "%s\n" "Expected at least 2 different numbers to be output" printf "%s:\n%s\n" "Positions reported" "${positionsReported}" printf "%s: %s\n" "Number of different values seen" "${differentNumbers}" printf "%s\n" "Raw output:" tr '\r' '\n' < "${workFile2}" exit 1 fi exit 0 pv-1.9.31/tests/run-valgrind.sh000077500000000000000000000045061474702661500163640ustar00rootroot00000000000000#!/bin/sh # # Function to launch the test subject under valgrind. # # If valgrind is unavailable, exits the script with status 77, after writing # a note to file descriptor 4. # # If valgrind finds an error, writes the error to "valgrind.out" in the # current directory, and exits the script with status 1 after writing a note # to file descriptor 4. # # If valgrind does not find any errors, the function returns with the exit # status of the test subject. # # Source this file from test scripts that use valgrind. # # Requires ${testSubject} and ${workFile4}. This means that the caller must # not use file ${workFile4}, as this function will overwrite it. # # Output file for failures. valgrindOutputFile="valgrind.out" true "${testSubject:?not set - call this from 'make check'}" true "${workFile4:?not set - call this from 'make check'}" true "${workFile5:?not set - call this from 'make check'}" if ! command -v valgrind >/dev/null 2>&1; then echo "test requires \`valgrind'" exit 77 fi if test "${SKIP_VALGRIND_TESTS}" = "1"; then echo "SKIP_VALGRIND_TESTS is set" exit 77 fi if command -v arch >/dev/null 2>&1 && arch | grep -Fq -e arm -e aarch; then if ! test "${ENABLE_VALGRIND_ARM}" = "1"; then echo "skipping valgrind on ARM without ENABLE_VALGRIND_ARM" exit 77 fi fi valgrindHelp="$(valgrind --help 2>&1)" for valgrindOption in "verbose" "show-error-list" "error-exitcode" "track-fds" "leak-check"; do echo "${valgrindHelp}" | grep -Fq "${valgrindOption}" || { echo "test requires \`valgrind --${valgrindOption}'"; exit 77; } done runWithValgrind () { cat > "${workFile5}" < "${workFile4}" valgrind --tool=memcheck \ --verbose \ --show-error-list=yes \ --suppressions="${workFile5}" \ --log-file="${workFile4}" \ --error-exitcode=125 \ --track-fds=yes \ --leak-check=full \ "${testSubject}" "$@" \ 4<&- 9<&- returnValue=$? if test "${returnValue}" -eq 125; then { echo "================================================" date echo "Command: ${testSubject} $*" echo cat "${workFile4}" echo "================================================" echo } >> "${valgrindOutputFile}" echo "memory check failed - see file \`valgrind.out'." 1>&4 exit 1 fi return "${returnValue}" } pv-1.9.31/tests/test-env.sh000066400000000000000000000020321474702661500155060ustar00rootroot00000000000000#!/bin/sh # # Set up the environment variables, temporary working files, and cleanup # processes required to run each test. # # Tests must exit with 0 for success, 1 for failure, 77 to skip the test, or # 99 for a fatal error with the test framework. true "${srcdir:?not set - call this from 'make check'}" # Parameters. testSubject="./pv" sourcePath="${srcdir}" # Set everything to the "C" locale. LANG=C LC_ALL=C export LANG LC_ALL # Temporary working files, for the test scripts to use. workFile1=$(mktemp 2>/dev/null) || workFile1="./.tmp1" workFile2=$(mktemp 2>/dev/null) || workFile2="./.tmp2" workFile3=$(mktemp 2>/dev/null) || workFile3="./.tmp3" workFile4=$(mktemp 2>/dev/null) || workFile4="./.tmp4" workFile5=$(mktemp 2>/dev/null) || workFile4="./.tmp5" # Clean up the temporary files on exit, in case we are interrupted. trap 'rm -f "${workFile1}" "${workFile2}" "${workFile3}" "${workFile4}" "${workFile5}"' EXIT # Variables used by the test scripts. export testSubject sourcePath workFile1 workFile2 workFile3 workFile4 workFile5