From 0abd2eb9f9b92b029b4c0df1587ff6622c74ec7b Mon Sep 17 00:00:00 2001 From: Robert Young Date: Mon, 15 Jul 2019 10:43:06 -0400 Subject: [PATCH] Import from sourceforge Signed-off-by: Robert Young --- AUTHORS | 1 + ChangeLog | 962 + Doxyfile | 282 + INSTALL | 167 + LICENSE.BSD | 27 + Makefile.am | 37 + Makefile.in | 660 + README | 41 + aclocal.m4 | 7442 ++++++ config.guess | 1363 + config.h.in | 58 + config.sub | 1470 ++ configure | 21652 ++++++++++++++++ configure.in | 11 + depcomp | 441 + install-sh | 276 + ltmain.sh | 6343 +++++ man/Makefile.am | 17 + man/Makefile.in | 387 + man/html/sunifdef_man_1.html | 490 + man/makeman.sh | 5 + man/man_pod.pl | 362 + man/sunifdef.1 | 460 + missing | 336 + mkinstalldirs | 111 + perl/SunifdefLib.pm | 154 + src/Makefile.am | 19 + src/Makefile.in | 504 + src/args.c | 1136 + src/args.h | 147 + src/bool.h | 60 + src/categorical.c | 351 + src/categorical.h | 179 + src/chew.c | 327 + src/chew.h | 151 + src/dataset.c | 156 + src/dataset.h | 95 + src/doxygen.h | 545 + src/evaluator.c | 1606 ++ src/evaluator.h | 159 + src/exception.c | 53 + src/exception.h | 74 + src/file_tree.c | 817 + src/file_tree.h | 250 + src/filesys.c | 195 + src/filesys.h | 314 + src/fs_nix.c | 207 + src/fs_win.c | 212 + src/if_control.c | 401 + src/if_control.h | 141 + src/io.c | 504 + src/io.h | 199 + src/line_despatch.c | 285 + src/line_despatch.h | 104 + src/line_edit.c | 170 + src/line_edit.h | 166 + src/main.c | 188 + src/memory.c | 96 + src/memory.h | 79 + src/opts.h | 55 + src/platform.h | 91 + src/ptr_vector.c | 145 + src/ptr_vector.h | 131 + src/report.c | 742 + src/report.h | 587 + src/state_utils.c | 104 + src/state_utils.h | 921 + src/symbol_table.c | 164 + src/symbol_table.h | 118 + test_sunifdef/Makefile.am | 2 + test_sunifdef/Makefile.in | 397 + test_sunifdef/README | 20 + test_sunifdef/scrap_dir_tree.pl | 155 + test_sunifdef/sunifdef_bulk_tester.pl | 326 + test_sunifdef/sunifdef_case_tester.pl | 306 + test_sunifdef/sunifdef_softlink_tester.pl | 187 + .../test_cases/altfiles/scratch.temp.txt | 0 .../test_cases/altfiles/test0173-1.c | 10 + .../test_cases/altfiles/test0173-2.c | 10 + test_sunifdef/test_cases/test0001.c | 5 + test_sunifdef/test_cases/test0001.c.expect | 5 + test_sunifdef/test_cases/test0002.c | 3 + test_sunifdef/test_cases/test0002.c.expect | 3 + test_sunifdef/test_cases/test0003.c | 3 + test_sunifdef/test_cases/test0003.c.expect | 3 + test_sunifdef/test_cases/test0004.c | 7 + test_sunifdef/test_cases/test0004.c.expect | 7 + test_sunifdef/test_cases/test0005.c | 5 + test_sunifdef/test_cases/test0005.c.expect | 5 + test_sunifdef/test_cases/test0006.c | 8 + test_sunifdef/test_cases/test0006.c.expect | 4 + test_sunifdef/test_cases/test0007.c | 8 + test_sunifdef/test_cases/test0007.c.expect | 4 + test_sunifdef/test_cases/test0008.c | 5 + test_sunifdef/test_cases/test0008.c.expect | 2 + test_sunifdef/test_cases/test0009.c | 8 + test_sunifdef/test_cases/test0009.c.expect | 4 + test_sunifdef/test_cases/test0010.c | 6 + test_sunifdef/test_cases/test0010.c.expect | 4 + test_sunifdef/test_cases/test0011.c | 7 + test_sunifdef/test_cases/test0011.c.expect | 3 + test_sunifdef/test_cases/test0012.c | 6 + test_sunifdef/test_cases/test0012.c.expect | 3 + test_sunifdef/test_cases/test0013.c | 8 + test_sunifdef/test_cases/test0013.c.expect | 4 + test_sunifdef/test_cases/test0014.c | 8 + test_sunifdef/test_cases/test0014.c.expect | 8 + test_sunifdef/test_cases/test0015.c | 9 + test_sunifdef/test_cases/test0015.c.expect | 7 + test_sunifdef/test_cases/test0016.c | 7 + test_sunifdef/test_cases/test0016.c.expect | 5 + test_sunifdef/test_cases/test0017.c | 10 + test_sunifdef/test_cases/test0017.c.expect | 8 + test_sunifdef/test_cases/test0018.c | 6 + test_sunifdef/test_cases/test0018.c.expect | 4 + test_sunifdef/test_cases/test0019.c | 8 + test_sunifdef/test_cases/test0019.c.expect | 4 + test_sunifdef/test_cases/test0020.c | 6 + test_sunifdef/test_cases/test0020.c.expect | 3 + test_sunifdef/test_cases/test0021.c | 8 + test_sunifdef/test_cases/test0021.c.expect | 4 + test_sunifdef/test_cases/test0022.c | 6 + test_sunifdef/test_cases/test0022.c.expect | 4 + test_sunifdef/test_cases/test0023.c | 8 + test_sunifdef/test_cases/test0023.c.expect | 4 + test_sunifdef/test_cases/test0024.c | 6 + test_sunifdef/test_cases/test0024.c.expect | 3 + test_sunifdef/test_cases/test0025.c | 8 + test_sunifdef/test_cases/test0025.c.expect | 4 + test_sunifdef/test_cases/test0026.c | 8 + test_sunifdef/test_cases/test0026.c.expect | 8 + test_sunifdef/test_cases/test0027.c | 10 + test_sunifdef/test_cases/test0027.c.expect | 8 + test_sunifdef/test_cases/test0028.c | 8 + test_sunifdef/test_cases/test0028.c.expect | 6 + test_sunifdef/test_cases/test0029.c | 10 + test_sunifdef/test_cases/test0029.c.expect | 8 + test_sunifdef/test_cases/test0030.c | 8 + test_sunifdef/test_cases/test0030.c.expect | 8 + test_sunifdef/test_cases/test0031.c | 8 + test_sunifdef/test_cases/test0031.c.expect | 8 + test_sunifdef/test_cases/test0032.c | 8 + test_sunifdef/test_cases/test0032.c.expect | 4 + test_sunifdef/test_cases/test0033.c | 8 + test_sunifdef/test_cases/test0033.c.expect | 8 + test_sunifdef/test_cases/test0034.c | 8 + test_sunifdef/test_cases/test0034.c.expect | 4 + test_sunifdef/test_cases/test0035.c | 8 + test_sunifdef/test_cases/test0035.c.expect | 8 + test_sunifdef/test_cases/test0036.c | 8 + test_sunifdef/test_cases/test0036.c.expect | 4 + test_sunifdef/test_cases/test0037.c | 8 + test_sunifdef/test_cases/test0037.c.expect | 4 + test_sunifdef/test_cases/test0038.c | 9 + test_sunifdef/test_cases/test0038.c.expect | 4 + test_sunifdef/test_cases/test0039.c | 9 + test_sunifdef/test_cases/test0039.c.expect | 8 + test_sunifdef/test_cases/test0040.c | 8 + test_sunifdef/test_cases/test0040.c.expect | 8 + test_sunifdef/test_cases/test0041.c | 8 + test_sunifdef/test_cases/test0041.c.expect | 4 + test_sunifdef/test_cases/test0042.c | 8 + test_sunifdef/test_cases/test0042.c.expect | 4 + test_sunifdef/test_cases/test0043.c | 12 + test_sunifdef/test_cases/test0043.c.expect | 10 + test_sunifdef/test_cases/test0044.c | 9 + test_sunifdef/test_cases/test0044.c.expect | 4 + test_sunifdef/test_cases/test0045.c | 9 + test_sunifdef/test_cases/test0045.c.expect | 5 + test_sunifdef/test_cases/test0046.c | 9 + test_sunifdef/test_cases/test0046.c.expect | 4 + test_sunifdef/test_cases/test0047.c | 11 + test_sunifdef/test_cases/test0047.c.expect | 5 + test_sunifdef/test_cases/test0048.c | 12 + test_sunifdef/test_cases/test0048.c.expect | 4 + test_sunifdef/test_cases/test0049.c | 11 + test_sunifdef/test_cases/test0049.c.expect | 3 + test_sunifdef/test_cases/test0050.c | 12 + test_sunifdef/test_cases/test0050.c.expect | 6 + test_sunifdef/test_cases/test0051.c | 4 + test_sunifdef/test_cases/test0051.c.expect | 4 + test_sunifdef/test_cases/test0052.c | 4 + test_sunifdef/test_cases/test0052.c.expect | 3 + test_sunifdef/test_cases/test0053.c | 4 + test_sunifdef/test_cases/test0053.c.expect | 4 + test_sunifdef/test_cases/test0054.c | 3 + test_sunifdef/test_cases/test0054.c.expect | 3 + test_sunifdef/test_cases/test0055.c | 5 + test_sunifdef/test_cases/test0055.c.expect | 5 + test_sunifdef/test_cases/test0056.c | 12 + test_sunifdef/test_cases/test0056.c.expect | 7 + test_sunifdef/test_cases/test0057.c | 11 + test_sunifdef/test_cases/test0057.c.expect | 7 + test_sunifdef/test_cases/test0058.c | 11 + test_sunifdef/test_cases/test0058.c.expect | 7 + test_sunifdef/test_cases/test0059.c | 7 + test_sunifdef/test_cases/test0059.c.expect | 7 + test_sunifdef/test_cases/test0060.c | 7 + test_sunifdef/test_cases/test0060.c.expect | 7 + test_sunifdef/test_cases/test0061.c | 7 + test_sunifdef/test_cases/test0061.c.expect | 7 + test_sunifdef/test_cases/test0062.c | 7 + test_sunifdef/test_cases/test0062.c.expect | 3 + test_sunifdef/test_cases/test0063.c | 7 + test_sunifdef/test_cases/test0063.c.expect | 7 + test_sunifdef/test_cases/test0064.c | 7 + test_sunifdef/test_cases/test0064.c.expect | 3 + test_sunifdef/test_cases/test0065.c | 7 + test_sunifdef/test_cases/test0065.c.expect | 7 + test_sunifdef/test_cases/test0066.c | 7 + test_sunifdef/test_cases/test0066.c.expect | 7 + test_sunifdef/test_cases/test0067.c | 7 + test_sunifdef/test_cases/test0067.c.expect | 3 + test_sunifdef/test_cases/test0068.c | 7 + test_sunifdef/test_cases/test0068.c.expect | 7 + test_sunifdef/test_cases/test0069.c | 7 + test_sunifdef/test_cases/test0069.c.expect | 7 + test_sunifdef/test_cases/test0070.c | 5 + test_sunifdef/test_cases/test0070.c.expect | 5 + test_sunifdef/test_cases/test0071.c | 7 + test_sunifdef/test_cases/test0071.c.expect | 3 + test_sunifdef/test_cases/test0072.c | 7 + test_sunifdef/test_cases/test0072.c.expect | 3 + test_sunifdef/test_cases/test0073.c | 7 + test_sunifdef/test_cases/test0073.c.expect | 3 + test_sunifdef/test_cases/test0074.c | 3 + test_sunifdef/test_cases/test0074.c.expect | 3 + test_sunifdef/test_cases/test0075.c | 16 + test_sunifdef/test_cases/test0075.c.expect | 16 + test_sunifdef/test_cases/test0076.c | 6 + test_sunifdef/test_cases/test0076.c.expect | 6 + test_sunifdef/test_cases/test0077.c | 8 + test_sunifdef/test_cases/test0077.c.expect | 8 + test_sunifdef/test_cases/test0078.c | 15 + test_sunifdef/test_cases/test0078.c.expect | 3 + test_sunifdef/test_cases/test0079.c | 21 + test_sunifdef/test_cases/test0079.c.expect | 7 + test_sunifdef/test_cases/test0080.c | 5 + test_sunifdef/test_cases/test0080.c.expect | 5 + test_sunifdef/test_cases/test0081.c | 5 + test_sunifdef/test_cases/test0081.c.expect | 3 + test_sunifdef/test_cases/test0082.c | 5 + test_sunifdef/test_cases/test0082.c.expect | 2 + test_sunifdef/test_cases/test0083.c | 5 + test_sunifdef/test_cases/test0083.c.expect | 3 + test_sunifdef/test_cases/test0084.c | 5 + test_sunifdef/test_cases/test0084.c.expect | 3 + test_sunifdef/test_cases/test0085.c | 5 + test_sunifdef/test_cases/test0085.c.expect | 4 + test_sunifdef/test_cases/test0086.c | 5 + test_sunifdef/test_cases/test0086.c.expect | 4 + test_sunifdef/test_cases/test0087.c | 5 + test_sunifdef/test_cases/test0087.c.expect | 3 + test_sunifdef/test_cases/test0088.c | 17 + test_sunifdef/test_cases/test0088.c.expect | 7 + test_sunifdef/test_cases/test0089.c | 12 + test_sunifdef/test_cases/test0089.c.expect | 6 + test_sunifdef/test_cases/test0090.c | 7 + test_sunifdef/test_cases/test0090.c.expect | 3 + test_sunifdef/test_cases/test0091.c | 5 + test_sunifdef/test_cases/test0091.c.expect | 5 + test_sunifdef/test_cases/test0092.c | 7 + test_sunifdef/test_cases/test0092.c.expect | 7 + test_sunifdef/test_cases/test0093.c | 7 + test_sunifdef/test_cases/test0093.c.expect | 7 + test_sunifdef/test_cases/test0094.c | 7 + test_sunifdef/test_cases/test0094.c.expect | 3 + test_sunifdef/test_cases/test0095.c | 8 + test_sunifdef/test_cases/test0095.c.expect | 8 + test_sunifdef/test_cases/test0096.c | 8 + test_sunifdef/test_cases/test0096.c.expect | 8 + test_sunifdef/test_cases/test0097.c | 8 + test_sunifdef/test_cases/test0097.c.expect | 8 + test_sunifdef/test_cases/test0098.c | 8 + test_sunifdef/test_cases/test0098.c.expect | 4 + test_sunifdef/test_cases/test0099.c | 8 + test_sunifdef/test_cases/test0099.c.expect | 4 + test_sunifdef/test_cases/test0100.c | 8 + test_sunifdef/test_cases/test0100.c.expect | 4 + test_sunifdef/test_cases/test0101.c | 8 + test_sunifdef/test_cases/test0101.c.expect | 4 + test_sunifdef/test_cases/test0102.c | 8 + test_sunifdef/test_cases/test0102.c.expect | 4 + test_sunifdef/test_cases/test0103.c | 8 + test_sunifdef/test_cases/test0103.c.expect | 8 + test_sunifdef/test_cases/test0104.c | 8 + test_sunifdef/test_cases/test0104.c.expect | 8 + test_sunifdef/test_cases/test0105.c | 8 + test_sunifdef/test_cases/test0105.c.expect | 8 + test_sunifdef/test_cases/test0106.c | 8 + test_sunifdef/test_cases/test0106.c.expect | 8 + test_sunifdef/test_cases/test0107.c | 8 + test_sunifdef/test_cases/test0107.c.expect | 4 + test_sunifdef/test_cases/test0108.c | 8 + test_sunifdef/test_cases/test0108.c.expect | 9 + test_sunifdef/test_cases/test0109.c | 8 + test_sunifdef/test_cases/test0109.c.expect | 4 + test_sunifdef/test_cases/test0110.c | 8 + test_sunifdef/test_cases/test0110.c.expect | 4 + test_sunifdef/test_cases/test0111.c | 8 + test_sunifdef/test_cases/test0111.c.expect | 8 + test_sunifdef/test_cases/test0112.c | 8 + test_sunifdef/test_cases/test0112.c.expect | 8 + test_sunifdef/test_cases/test0113.c | 8 + test_sunifdef/test_cases/test0113.c.expect | 8 + test_sunifdef/test_cases/test0114.c | 8 + test_sunifdef/test_cases/test0114.c.expect | 4 + test_sunifdef/test_cases/test0115.c | 8 + test_sunifdef/test_cases/test0115.c.expect | 8 + test_sunifdef/test_cases/test0116.c | 8 + test_sunifdef/test_cases/test0116.c.expect | 8 + test_sunifdef/test_cases/test0117.c | 8 + test_sunifdef/test_cases/test0117.c.expect | 8 + test_sunifdef/test_cases/test0118.c | 8 + test_sunifdef/test_cases/test0118.c.expect | 4 + test_sunifdef/test_cases/test0119.c | 7 + test_sunifdef/test_cases/test0119.c.expect | 7 + test_sunifdef/test_cases/test0120.c | 7 + test_sunifdef/test_cases/test0120.c.expect | 7 + test_sunifdef/test_cases/test0121.c | 7 + test_sunifdef/test_cases/test0121.c.expect | 3 + test_sunifdef/test_cases/test0122.c | 8 + test_sunifdef/test_cases/test0122.c.expect | 8 + test_sunifdef/test_cases/test0123.c | 8 + test_sunifdef/test_cases/test0123.c.expect | 8 + test_sunifdef/test_cases/test0124.c | 8 + test_sunifdef/test_cases/test0124.c.expect | 8 + test_sunifdef/test_cases/test0125.c | 8 + test_sunifdef/test_cases/test0125.c.expect | 4 + test_sunifdef/test_cases/test0126.c | 8 + test_sunifdef/test_cases/test0126.c.expect | 4 + test_sunifdef/test_cases/test0127.c | 8 + test_sunifdef/test_cases/test0127.c.expect | 4 + test_sunifdef/test_cases/test0128.c | 8 + test_sunifdef/test_cases/test0128.c.expect | 9 + test_sunifdef/test_cases/test0129.c | 8 + test_sunifdef/test_cases/test0129.c.expect | 4 + test_sunifdef/test_cases/test0130.c | 8 + test_sunifdef/test_cases/test0130.c.expect | 8 + test_sunifdef/test_cases/test0131.c | 8 + test_sunifdef/test_cases/test0131.c.expect | 8 + test_sunifdef/test_cases/test0132.c | 8 + test_sunifdef/test_cases/test0132.c.expect | 4 + test_sunifdef/test_cases/test0133.c | 7 + test_sunifdef/test_cases/test0133.c.expect | 3 + test_sunifdef/test_cases/test0134.c | 8 + test_sunifdef/test_cases/test0134.c.expect | 4 + test_sunifdef/test_cases/test0135.c | 8 + test_sunifdef/test_cases/test0135.c.expect | 4 + test_sunifdef/test_cases/test0136.c | 8 + test_sunifdef/test_cases/test0136.c.expect | 4 + test_sunifdef/test_cases/test0137.c | 8 + test_sunifdef/test_cases/test0137.c.expect | 4 + test_sunifdef/test_cases/test0138.c | 8 + test_sunifdef/test_cases/test0138.c.expect | 8 + test_sunifdef/test_cases/test0139.c | 8 + test_sunifdef/test_cases/test0139.c.expect | 8 + test_sunifdef/test_cases/test0140.c | 8 + test_sunifdef/test_cases/test0140.c.expect | 8 + test_sunifdef/test_cases/test0141.c | 8 + test_sunifdef/test_cases/test0141.c.expect | 4 + test_sunifdef/test_cases/test0142.c | 8 + test_sunifdef/test_cases/test0142.c.expect | 8 + test_sunifdef/test_cases/test0143.c | 8 + test_sunifdef/test_cases/test0143.c.expect | 8 + test_sunifdef/test_cases/test0144.c | 8 + test_sunifdef/test_cases/test0144.c.expect | 8 + test_sunifdef/test_cases/test0145.c | 8 + test_sunifdef/test_cases/test0145.c.expect | 8 + test_sunifdef/test_cases/test0146.c | 7 + test_sunifdef/test_cases/test0146.c.expect | 7 + test_sunifdef/test_cases/test0147.c | 7 + test_sunifdef/test_cases/test0147.c.expect | 7 + test_sunifdef/test_cases/test0148.c | 7 + test_sunifdef/test_cases/test0148.c.expect | 3 + test_sunifdef/test_cases/test0149.c | 7 + test_sunifdef/test_cases/test0149.c.expect | 7 + test_sunifdef/test_cases/test0150.c | 7 + test_sunifdef/test_cases/test0150.c.expect | 4 + test_sunifdef/test_cases/test0151.c | 7 + test_sunifdef/test_cases/test0151.c.expect | 4 + test_sunifdef/test_cases/test0152.c | 15 + test_sunifdef/test_cases/test0152.c.expect | 15 + test_sunifdef/test_cases/test0153.c | 7 + test_sunifdef/test_cases/test0153.c.expect | 5 + test_sunifdef/test_cases/test0154.c | 13 + test_sunifdef/test_cases/test0154.c.expect | 11 + test_sunifdef/test_cases/test0155.c | 7 + test_sunifdef/test_cases/test0155.c.expect | 7 + test_sunifdef/test_cases/test0156.c | 17 + test_sunifdef/test_cases/test0156.c.expect | 6 + test_sunifdef/test_cases/test0157.c | 17 + test_sunifdef/test_cases/test0157.c.expect | 7 + test_sunifdef/test_cases/test0158.c | 17 + test_sunifdef/test_cases/test0158.c.expect | 6 + test_sunifdef/test_cases/test0159.c | 17 + test_sunifdef/test_cases/test0159.c.expect | 7 + test_sunifdef/test_cases/test0160.c | 5 + test_sunifdef/test_cases/test0160.c.expect | 5 + test_sunifdef/test_cases/test0161.c | 5 + test_sunifdef/test_cases/test0161.c.expect | 5 + test_sunifdef/test_cases/test0162.c | 5 + test_sunifdef/test_cases/test0162.c.expect | 5 + test_sunifdef/test_cases/test0163.c | 5 + test_sunifdef/test_cases/test0163.c.expect | 4 + test_sunifdef/test_cases/test0164.c | 5 + test_sunifdef/test_cases/test0164.c.expect | 4 + test_sunifdef/test_cases/test0165.c | 7 + test_sunifdef/test_cases/test0165.c.expect | 7 + test_sunifdef/test_cases/test0166.c | 7 + test_sunifdef/test_cases/test0166.c.expect | 3 + test_sunifdef/test_cases/test0167.c | 26 + test_sunifdef/test_cases/test0167.c.expect | 6 + test_sunifdef/test_cases/test0168.c | 14 + test_sunifdef/test_cases/test0168.c.expect | 5 + test_sunifdef/test_cases/test0169.c | 15 + test_sunifdef/test_cases/test0169.c.expect | 15 + test_sunifdef/test_cases/test0170.c | 12 + test_sunifdef/test_cases/test0170.c.expect | 6 + test_sunifdef/test_cases/test0171.c | 12 + test_sunifdef/test_cases/test0171.c.expect | 6 + test_sunifdef/test_cases/test0172.c | 12 + test_sunifdef/test_cases/test0172.c.expect | 5 + test_sunifdef/test_cases/test0173.c | 3 + test_sunifdef/test_cases/test0173.c.expect | 6 + test_sunifdef/test_cases/test0174.c | 12 + test_sunifdef/test_cases/test0174.c.expect | 6 + test_sunifdef/test_cases/test0175.c | 15 + test_sunifdef/test_cases/test0175.c.expect | 7 + test_sunifdef/test_cases/test0176.c | 8 + test_sunifdef/test_cases/test0176.c.expect | 8 + test_sunifdef/test_cases/test0177.c | 7 + test_sunifdef/test_cases/test0177.c.expect | 7 + test_sunifdef/test_cases/test0178.c | 7 + test_sunifdef/test_cases/test0178.c.expect | 3 + test_sunifdef/test_cases/test0179.c | 7 + test_sunifdef/test_cases/test0179.c.expect | 4 + test_sunifdef/test_cases/test0180.c | 8 + test_sunifdef/test_cases/test0180.c.expect | 3 + test_sunifdef/test_cases/test0181.c | 9 + test_sunifdef/test_cases/test0181.c.expect | 4 + test_sunifdef/test_cases/test0182.c | 7 + test_sunifdef/test_cases/test0182.c.expect | 5 + test_sunifdef/test_cases/test0183.c | 9 + test_sunifdef/test_cases/test0183.c.expect | 5 + test_sunifdef/test_cases/test0184.c | 5 + test_sunifdef/test_cases/test0184.c.expect | 5 + test_sunifdef/test_cases/test0185.c | 19 + test_sunifdef/test_cases/test0185.c.expect | 19 + test_sunifdef/test_cases/test0186.c | 18 + test_sunifdef/test_cases/test0186.c.expect | 18 + test_sunifdef/test_cases/test0187.c | 13 + test_sunifdef/test_cases/test0187.c.expect | 12 + test_sunifdef/test_cases/test0188.c | 14 + test_sunifdef/test_cases/test0188.c.expect | 11 + test_sunifdef/test_cases/test0189.c | 14 + test_sunifdef/test_cases/test0189.c.expect | 14 + test_sunifdef/test_cases/test0190.c | 14 + test_sunifdef/test_cases/test0190.c.expect | 12 + test_sunifdef/test_cases/test0191.c | 6 + test_sunifdef/test_cases/test0191.c.expect | 7 + test_sunifdef/test_cases/test0192.c | 5 + test_sunifdef/test_cases/test0192.c.expect | 2 + test_sunifdef/test_cases/test0193.c | 5 + test_sunifdef/test_cases/test0193.c.expect | 5 + test_sunifdef/test_cases/test0194.c | 9 + test_sunifdef/test_cases/test0194.c.expect | 3 + test_sunifdef/test_cases/test0195.c | 7 + test_sunifdef/test_cases/test0195.c.expect | 4 + test_sunifdef/test_cases/test0196.c | 5 + test_sunifdef/test_cases/test0196.c.expect | 3 + test_sunifdef/test_cases/test0197.c | 5 + test_sunifdef/test_cases/test0197.c.expect | 3 + test_sunifdef/test_cases/test0198.c | 11 + test_sunifdef/test_cases/test0198.c.expect | 3 + test_sunifdef/test_cases/test0199.c | 11 + test_sunifdef/test_cases/test0199.c.expect | 5 + test_sunifdef/test_cases/test0200.c | 5 + test_sunifdef/test_cases/test0200.c.expect | 5 + 479 files changed, 60746 insertions(+) create mode 100644 AUTHORS create mode 100644 ChangeLog create mode 100644 Doxyfile create mode 100644 INSTALL create mode 100644 LICENSE.BSD create mode 100644 Makefile.am create mode 100644 Makefile.in create mode 100644 README create mode 100644 aclocal.m4 create mode 100755 config.guess create mode 100644 config.h.in create mode 100755 config.sub create mode 100755 configure create mode 100644 configure.in create mode 100755 depcomp create mode 100755 install-sh create mode 100644 ltmain.sh create mode 100644 man/Makefile.am create mode 100644 man/Makefile.in create mode 100644 man/html/sunifdef_man_1.html create mode 100755 man/makeman.sh create mode 100644 man/man_pod.pl create mode 100644 man/sunifdef.1 create mode 100755 missing create mode 100755 mkinstalldirs create mode 100755 perl/SunifdefLib.pm create mode 100755 src/Makefile.am create mode 100755 src/Makefile.in create mode 100755 src/args.c create mode 100755 src/args.h create mode 100755 src/bool.h create mode 100755 src/categorical.c create mode 100755 src/categorical.h create mode 100755 src/chew.c create mode 100755 src/chew.h create mode 100755 src/dataset.c create mode 100755 src/dataset.h create mode 100755 src/doxygen.h create mode 100755 src/evaluator.c create mode 100755 src/evaluator.h create mode 100755 src/exception.c create mode 100755 src/exception.h create mode 100755 src/file_tree.c create mode 100755 src/file_tree.h create mode 100755 src/filesys.c create mode 100755 src/filesys.h create mode 100755 src/fs_nix.c create mode 100755 src/fs_win.c create mode 100755 src/if_control.c create mode 100755 src/if_control.h create mode 100755 src/io.c create mode 100755 src/io.h create mode 100755 src/line_despatch.c create mode 100755 src/line_despatch.h create mode 100755 src/line_edit.c create mode 100755 src/line_edit.h create mode 100755 src/main.c create mode 100755 src/memory.c create mode 100755 src/memory.h create mode 100755 src/opts.h create mode 100755 src/platform.h create mode 100755 src/ptr_vector.c create mode 100755 src/ptr_vector.h create mode 100755 src/report.c create mode 100755 src/report.h create mode 100755 src/state_utils.c create mode 100755 src/state_utils.h create mode 100755 src/symbol_table.c create mode 100755 src/symbol_table.h create mode 100644 test_sunifdef/Makefile.am create mode 100644 test_sunifdef/Makefile.in create mode 100644 test_sunifdef/README create mode 100755 test_sunifdef/scrap_dir_tree.pl create mode 100755 test_sunifdef/sunifdef_bulk_tester.pl create mode 100755 test_sunifdef/sunifdef_case_tester.pl create mode 100755 test_sunifdef/sunifdef_softlink_tester.pl create mode 100644 test_sunifdef/test_cases/altfiles/scratch.temp.txt create mode 100644 test_sunifdef/test_cases/altfiles/test0173-1.c create mode 100644 test_sunifdef/test_cases/altfiles/test0173-2.c create mode 100644 test_sunifdef/test_cases/test0001.c create mode 100644 test_sunifdef/test_cases/test0001.c.expect create mode 100644 test_sunifdef/test_cases/test0002.c create mode 100644 test_sunifdef/test_cases/test0002.c.expect create mode 100644 test_sunifdef/test_cases/test0003.c create mode 100644 test_sunifdef/test_cases/test0003.c.expect create mode 100644 test_sunifdef/test_cases/test0004.c create mode 100644 test_sunifdef/test_cases/test0004.c.expect create mode 100644 test_sunifdef/test_cases/test0005.c create mode 100644 test_sunifdef/test_cases/test0005.c.expect create mode 100644 test_sunifdef/test_cases/test0006.c create mode 100644 test_sunifdef/test_cases/test0006.c.expect create mode 100644 test_sunifdef/test_cases/test0007.c create mode 100644 test_sunifdef/test_cases/test0007.c.expect create mode 100644 test_sunifdef/test_cases/test0008.c create mode 100644 test_sunifdef/test_cases/test0008.c.expect create mode 100644 test_sunifdef/test_cases/test0009.c create mode 100644 test_sunifdef/test_cases/test0009.c.expect create mode 100644 test_sunifdef/test_cases/test0010.c create mode 100644 test_sunifdef/test_cases/test0010.c.expect create mode 100644 test_sunifdef/test_cases/test0011.c create mode 100644 test_sunifdef/test_cases/test0011.c.expect create mode 100644 test_sunifdef/test_cases/test0012.c create mode 100644 test_sunifdef/test_cases/test0012.c.expect create mode 100644 test_sunifdef/test_cases/test0013.c create mode 100644 test_sunifdef/test_cases/test0013.c.expect create mode 100644 test_sunifdef/test_cases/test0014.c create mode 100644 test_sunifdef/test_cases/test0014.c.expect create mode 100644 test_sunifdef/test_cases/test0015.c create mode 100644 test_sunifdef/test_cases/test0015.c.expect create mode 100644 test_sunifdef/test_cases/test0016.c create mode 100644 test_sunifdef/test_cases/test0016.c.expect create mode 100644 test_sunifdef/test_cases/test0017.c create mode 100644 test_sunifdef/test_cases/test0017.c.expect create mode 100644 test_sunifdef/test_cases/test0018.c create mode 100644 test_sunifdef/test_cases/test0018.c.expect create mode 100644 test_sunifdef/test_cases/test0019.c create mode 100644 test_sunifdef/test_cases/test0019.c.expect create mode 100644 test_sunifdef/test_cases/test0020.c create mode 100644 test_sunifdef/test_cases/test0020.c.expect create mode 100644 test_sunifdef/test_cases/test0021.c create mode 100644 test_sunifdef/test_cases/test0021.c.expect create mode 100644 test_sunifdef/test_cases/test0022.c create mode 100644 test_sunifdef/test_cases/test0022.c.expect create mode 100644 test_sunifdef/test_cases/test0023.c create mode 100644 test_sunifdef/test_cases/test0023.c.expect create mode 100644 test_sunifdef/test_cases/test0024.c create mode 100644 test_sunifdef/test_cases/test0024.c.expect create mode 100644 test_sunifdef/test_cases/test0025.c create mode 100644 test_sunifdef/test_cases/test0025.c.expect create mode 100644 test_sunifdef/test_cases/test0026.c create mode 100644 test_sunifdef/test_cases/test0026.c.expect create mode 100644 test_sunifdef/test_cases/test0027.c create mode 100644 test_sunifdef/test_cases/test0027.c.expect create mode 100644 test_sunifdef/test_cases/test0028.c create mode 100644 test_sunifdef/test_cases/test0028.c.expect create mode 100644 test_sunifdef/test_cases/test0029.c create mode 100644 test_sunifdef/test_cases/test0029.c.expect create mode 100644 test_sunifdef/test_cases/test0030.c create mode 100644 test_sunifdef/test_cases/test0030.c.expect create mode 100644 test_sunifdef/test_cases/test0031.c create mode 100644 test_sunifdef/test_cases/test0031.c.expect create mode 100644 test_sunifdef/test_cases/test0032.c create mode 100644 test_sunifdef/test_cases/test0032.c.expect create mode 100644 test_sunifdef/test_cases/test0033.c create mode 100644 test_sunifdef/test_cases/test0033.c.expect create mode 100644 test_sunifdef/test_cases/test0034.c create mode 100644 test_sunifdef/test_cases/test0034.c.expect create mode 100644 test_sunifdef/test_cases/test0035.c create mode 100644 test_sunifdef/test_cases/test0035.c.expect create mode 100644 test_sunifdef/test_cases/test0036.c create mode 100644 test_sunifdef/test_cases/test0036.c.expect create mode 100644 test_sunifdef/test_cases/test0037.c create mode 100644 test_sunifdef/test_cases/test0037.c.expect create mode 100644 test_sunifdef/test_cases/test0038.c create mode 100644 test_sunifdef/test_cases/test0038.c.expect create mode 100644 test_sunifdef/test_cases/test0039.c create mode 100644 test_sunifdef/test_cases/test0039.c.expect create mode 100644 test_sunifdef/test_cases/test0040.c create mode 100644 test_sunifdef/test_cases/test0040.c.expect create mode 100644 test_sunifdef/test_cases/test0041.c create mode 100644 test_sunifdef/test_cases/test0041.c.expect create mode 100644 test_sunifdef/test_cases/test0042.c create mode 100644 test_sunifdef/test_cases/test0042.c.expect create mode 100644 test_sunifdef/test_cases/test0043.c create mode 100644 test_sunifdef/test_cases/test0043.c.expect create mode 100644 test_sunifdef/test_cases/test0044.c create mode 100644 test_sunifdef/test_cases/test0044.c.expect create mode 100644 test_sunifdef/test_cases/test0045.c create mode 100644 test_sunifdef/test_cases/test0045.c.expect create mode 100644 test_sunifdef/test_cases/test0046.c create mode 100644 test_sunifdef/test_cases/test0046.c.expect create mode 100644 test_sunifdef/test_cases/test0047.c create mode 100644 test_sunifdef/test_cases/test0047.c.expect create mode 100644 test_sunifdef/test_cases/test0048.c create mode 100644 test_sunifdef/test_cases/test0048.c.expect create mode 100644 test_sunifdef/test_cases/test0049.c create mode 100644 test_sunifdef/test_cases/test0049.c.expect create mode 100644 test_sunifdef/test_cases/test0050.c create mode 100644 test_sunifdef/test_cases/test0050.c.expect create mode 100644 test_sunifdef/test_cases/test0051.c create mode 100644 test_sunifdef/test_cases/test0051.c.expect create mode 100644 test_sunifdef/test_cases/test0052.c create mode 100644 test_sunifdef/test_cases/test0052.c.expect create mode 100644 test_sunifdef/test_cases/test0053.c create mode 100644 test_sunifdef/test_cases/test0053.c.expect create mode 100644 test_sunifdef/test_cases/test0054.c create mode 100644 test_sunifdef/test_cases/test0054.c.expect create mode 100644 test_sunifdef/test_cases/test0055.c create mode 100644 test_sunifdef/test_cases/test0055.c.expect create mode 100644 test_sunifdef/test_cases/test0056.c create mode 100644 test_sunifdef/test_cases/test0056.c.expect create mode 100644 test_sunifdef/test_cases/test0057.c create mode 100644 test_sunifdef/test_cases/test0057.c.expect create mode 100644 test_sunifdef/test_cases/test0058.c create mode 100644 test_sunifdef/test_cases/test0058.c.expect create mode 100644 test_sunifdef/test_cases/test0059.c create mode 100644 test_sunifdef/test_cases/test0059.c.expect create mode 100644 test_sunifdef/test_cases/test0060.c create mode 100644 test_sunifdef/test_cases/test0060.c.expect create mode 100644 test_sunifdef/test_cases/test0061.c create mode 100644 test_sunifdef/test_cases/test0061.c.expect create mode 100644 test_sunifdef/test_cases/test0062.c create mode 100644 test_sunifdef/test_cases/test0062.c.expect create mode 100644 test_sunifdef/test_cases/test0063.c create mode 100644 test_sunifdef/test_cases/test0063.c.expect create mode 100644 test_sunifdef/test_cases/test0064.c create mode 100644 test_sunifdef/test_cases/test0064.c.expect create mode 100644 test_sunifdef/test_cases/test0065.c create mode 100644 test_sunifdef/test_cases/test0065.c.expect create mode 100644 test_sunifdef/test_cases/test0066.c create mode 100644 test_sunifdef/test_cases/test0066.c.expect create mode 100644 test_sunifdef/test_cases/test0067.c create mode 100644 test_sunifdef/test_cases/test0067.c.expect create mode 100644 test_sunifdef/test_cases/test0068.c create mode 100644 test_sunifdef/test_cases/test0068.c.expect create mode 100644 test_sunifdef/test_cases/test0069.c create mode 100644 test_sunifdef/test_cases/test0069.c.expect create mode 100644 test_sunifdef/test_cases/test0070.c create mode 100644 test_sunifdef/test_cases/test0070.c.expect create mode 100644 test_sunifdef/test_cases/test0071.c create mode 100644 test_sunifdef/test_cases/test0071.c.expect create mode 100644 test_sunifdef/test_cases/test0072.c create mode 100644 test_sunifdef/test_cases/test0072.c.expect create mode 100644 test_sunifdef/test_cases/test0073.c create mode 100644 test_sunifdef/test_cases/test0073.c.expect create mode 100644 test_sunifdef/test_cases/test0074.c create mode 100644 test_sunifdef/test_cases/test0074.c.expect create mode 100644 test_sunifdef/test_cases/test0075.c create mode 100644 test_sunifdef/test_cases/test0075.c.expect create mode 100644 test_sunifdef/test_cases/test0076.c create mode 100644 test_sunifdef/test_cases/test0076.c.expect create mode 100644 test_sunifdef/test_cases/test0077.c create mode 100644 test_sunifdef/test_cases/test0077.c.expect create mode 100644 test_sunifdef/test_cases/test0078.c create mode 100644 test_sunifdef/test_cases/test0078.c.expect create mode 100644 test_sunifdef/test_cases/test0079.c create mode 100644 test_sunifdef/test_cases/test0079.c.expect create mode 100644 test_sunifdef/test_cases/test0080.c create mode 100644 test_sunifdef/test_cases/test0080.c.expect create mode 100644 test_sunifdef/test_cases/test0081.c create mode 100644 test_sunifdef/test_cases/test0081.c.expect create mode 100644 test_sunifdef/test_cases/test0082.c create mode 100644 test_sunifdef/test_cases/test0082.c.expect create mode 100644 test_sunifdef/test_cases/test0083.c create mode 100644 test_sunifdef/test_cases/test0083.c.expect create mode 100644 test_sunifdef/test_cases/test0084.c create mode 100644 test_sunifdef/test_cases/test0084.c.expect create mode 100644 test_sunifdef/test_cases/test0085.c create mode 100644 test_sunifdef/test_cases/test0085.c.expect create mode 100644 test_sunifdef/test_cases/test0086.c create mode 100644 test_sunifdef/test_cases/test0086.c.expect create mode 100644 test_sunifdef/test_cases/test0087.c create mode 100644 test_sunifdef/test_cases/test0087.c.expect create mode 100644 test_sunifdef/test_cases/test0088.c create mode 100644 test_sunifdef/test_cases/test0088.c.expect create mode 100644 test_sunifdef/test_cases/test0089.c create mode 100644 test_sunifdef/test_cases/test0089.c.expect create mode 100644 test_sunifdef/test_cases/test0090.c create mode 100644 test_sunifdef/test_cases/test0090.c.expect create mode 100644 test_sunifdef/test_cases/test0091.c create mode 100644 test_sunifdef/test_cases/test0091.c.expect create mode 100644 test_sunifdef/test_cases/test0092.c create mode 100644 test_sunifdef/test_cases/test0092.c.expect create mode 100644 test_sunifdef/test_cases/test0093.c create mode 100644 test_sunifdef/test_cases/test0093.c.expect create mode 100644 test_sunifdef/test_cases/test0094.c create mode 100644 test_sunifdef/test_cases/test0094.c.expect create mode 100644 test_sunifdef/test_cases/test0095.c create mode 100644 test_sunifdef/test_cases/test0095.c.expect create mode 100644 test_sunifdef/test_cases/test0096.c create mode 100644 test_sunifdef/test_cases/test0096.c.expect create mode 100644 test_sunifdef/test_cases/test0097.c create mode 100644 test_sunifdef/test_cases/test0097.c.expect create mode 100644 test_sunifdef/test_cases/test0098.c create mode 100644 test_sunifdef/test_cases/test0098.c.expect create mode 100644 test_sunifdef/test_cases/test0099.c create mode 100644 test_sunifdef/test_cases/test0099.c.expect create mode 100644 test_sunifdef/test_cases/test0100.c create mode 100644 test_sunifdef/test_cases/test0100.c.expect create mode 100644 test_sunifdef/test_cases/test0101.c create mode 100644 test_sunifdef/test_cases/test0101.c.expect create mode 100644 test_sunifdef/test_cases/test0102.c create mode 100644 test_sunifdef/test_cases/test0102.c.expect create mode 100644 test_sunifdef/test_cases/test0103.c create mode 100644 test_sunifdef/test_cases/test0103.c.expect create mode 100644 test_sunifdef/test_cases/test0104.c create mode 100644 test_sunifdef/test_cases/test0104.c.expect create mode 100644 test_sunifdef/test_cases/test0105.c create mode 100644 test_sunifdef/test_cases/test0105.c.expect create mode 100644 test_sunifdef/test_cases/test0106.c create mode 100644 test_sunifdef/test_cases/test0106.c.expect create mode 100644 test_sunifdef/test_cases/test0107.c create mode 100644 test_sunifdef/test_cases/test0107.c.expect create mode 100644 test_sunifdef/test_cases/test0108.c create mode 100644 test_sunifdef/test_cases/test0108.c.expect create mode 100644 test_sunifdef/test_cases/test0109.c create mode 100644 test_sunifdef/test_cases/test0109.c.expect create mode 100644 test_sunifdef/test_cases/test0110.c create mode 100644 test_sunifdef/test_cases/test0110.c.expect create mode 100644 test_sunifdef/test_cases/test0111.c create mode 100644 test_sunifdef/test_cases/test0111.c.expect create mode 100644 test_sunifdef/test_cases/test0112.c create mode 100644 test_sunifdef/test_cases/test0112.c.expect create mode 100644 test_sunifdef/test_cases/test0113.c create mode 100644 test_sunifdef/test_cases/test0113.c.expect create mode 100644 test_sunifdef/test_cases/test0114.c create mode 100644 test_sunifdef/test_cases/test0114.c.expect create mode 100644 test_sunifdef/test_cases/test0115.c create mode 100644 test_sunifdef/test_cases/test0115.c.expect create mode 100644 test_sunifdef/test_cases/test0116.c create mode 100644 test_sunifdef/test_cases/test0116.c.expect create mode 100644 test_sunifdef/test_cases/test0117.c create mode 100644 test_sunifdef/test_cases/test0117.c.expect create mode 100644 test_sunifdef/test_cases/test0118.c create mode 100644 test_sunifdef/test_cases/test0118.c.expect create mode 100644 test_sunifdef/test_cases/test0119.c create mode 100644 test_sunifdef/test_cases/test0119.c.expect create mode 100644 test_sunifdef/test_cases/test0120.c create mode 100644 test_sunifdef/test_cases/test0120.c.expect create mode 100644 test_sunifdef/test_cases/test0121.c create mode 100644 test_sunifdef/test_cases/test0121.c.expect create mode 100644 test_sunifdef/test_cases/test0122.c create mode 100644 test_sunifdef/test_cases/test0122.c.expect create mode 100644 test_sunifdef/test_cases/test0123.c create mode 100644 test_sunifdef/test_cases/test0123.c.expect create mode 100644 test_sunifdef/test_cases/test0124.c create mode 100644 test_sunifdef/test_cases/test0124.c.expect create mode 100644 test_sunifdef/test_cases/test0125.c create mode 100644 test_sunifdef/test_cases/test0125.c.expect create mode 100644 test_sunifdef/test_cases/test0126.c create mode 100644 test_sunifdef/test_cases/test0126.c.expect create mode 100644 test_sunifdef/test_cases/test0127.c create mode 100644 test_sunifdef/test_cases/test0127.c.expect create mode 100644 test_sunifdef/test_cases/test0128.c create mode 100644 test_sunifdef/test_cases/test0128.c.expect create mode 100644 test_sunifdef/test_cases/test0129.c create mode 100644 test_sunifdef/test_cases/test0129.c.expect create mode 100644 test_sunifdef/test_cases/test0130.c create mode 100644 test_sunifdef/test_cases/test0130.c.expect create mode 100644 test_sunifdef/test_cases/test0131.c create mode 100644 test_sunifdef/test_cases/test0131.c.expect create mode 100644 test_sunifdef/test_cases/test0132.c create mode 100644 test_sunifdef/test_cases/test0132.c.expect create mode 100644 test_sunifdef/test_cases/test0133.c create mode 100644 test_sunifdef/test_cases/test0133.c.expect create mode 100644 test_sunifdef/test_cases/test0134.c create mode 100644 test_sunifdef/test_cases/test0134.c.expect create mode 100644 test_sunifdef/test_cases/test0135.c create mode 100644 test_sunifdef/test_cases/test0135.c.expect create mode 100644 test_sunifdef/test_cases/test0136.c create mode 100644 test_sunifdef/test_cases/test0136.c.expect create mode 100644 test_sunifdef/test_cases/test0137.c create mode 100644 test_sunifdef/test_cases/test0137.c.expect create mode 100644 test_sunifdef/test_cases/test0138.c create mode 100644 test_sunifdef/test_cases/test0138.c.expect create mode 100644 test_sunifdef/test_cases/test0139.c create mode 100644 test_sunifdef/test_cases/test0139.c.expect create mode 100644 test_sunifdef/test_cases/test0140.c create mode 100644 test_sunifdef/test_cases/test0140.c.expect create mode 100644 test_sunifdef/test_cases/test0141.c create mode 100644 test_sunifdef/test_cases/test0141.c.expect create mode 100644 test_sunifdef/test_cases/test0142.c create mode 100644 test_sunifdef/test_cases/test0142.c.expect create mode 100644 test_sunifdef/test_cases/test0143.c create mode 100644 test_sunifdef/test_cases/test0143.c.expect create mode 100644 test_sunifdef/test_cases/test0144.c create mode 100644 test_sunifdef/test_cases/test0144.c.expect create mode 100644 test_sunifdef/test_cases/test0145.c create mode 100644 test_sunifdef/test_cases/test0145.c.expect create mode 100644 test_sunifdef/test_cases/test0146.c create mode 100644 test_sunifdef/test_cases/test0146.c.expect create mode 100644 test_sunifdef/test_cases/test0147.c create mode 100644 test_sunifdef/test_cases/test0147.c.expect create mode 100644 test_sunifdef/test_cases/test0148.c create mode 100644 test_sunifdef/test_cases/test0148.c.expect create mode 100644 test_sunifdef/test_cases/test0149.c create mode 100644 test_sunifdef/test_cases/test0149.c.expect create mode 100644 test_sunifdef/test_cases/test0150.c create mode 100644 test_sunifdef/test_cases/test0150.c.expect create mode 100644 test_sunifdef/test_cases/test0151.c create mode 100644 test_sunifdef/test_cases/test0151.c.expect create mode 100644 test_sunifdef/test_cases/test0152.c create mode 100644 test_sunifdef/test_cases/test0152.c.expect create mode 100644 test_sunifdef/test_cases/test0153.c create mode 100644 test_sunifdef/test_cases/test0153.c.expect create mode 100644 test_sunifdef/test_cases/test0154.c create mode 100644 test_sunifdef/test_cases/test0154.c.expect create mode 100644 test_sunifdef/test_cases/test0155.c create mode 100644 test_sunifdef/test_cases/test0155.c.expect create mode 100644 test_sunifdef/test_cases/test0156.c create mode 100644 test_sunifdef/test_cases/test0156.c.expect create mode 100644 test_sunifdef/test_cases/test0157.c create mode 100644 test_sunifdef/test_cases/test0157.c.expect create mode 100644 test_sunifdef/test_cases/test0158.c create mode 100644 test_sunifdef/test_cases/test0158.c.expect create mode 100644 test_sunifdef/test_cases/test0159.c create mode 100644 test_sunifdef/test_cases/test0159.c.expect create mode 100644 test_sunifdef/test_cases/test0160.c create mode 100644 test_sunifdef/test_cases/test0160.c.expect create mode 100644 test_sunifdef/test_cases/test0161.c create mode 100644 test_sunifdef/test_cases/test0161.c.expect create mode 100644 test_sunifdef/test_cases/test0162.c create mode 100644 test_sunifdef/test_cases/test0162.c.expect create mode 100644 test_sunifdef/test_cases/test0163.c create mode 100644 test_sunifdef/test_cases/test0163.c.expect create mode 100644 test_sunifdef/test_cases/test0164.c create mode 100644 test_sunifdef/test_cases/test0164.c.expect create mode 100644 test_sunifdef/test_cases/test0165.c create mode 100644 test_sunifdef/test_cases/test0165.c.expect create mode 100644 test_sunifdef/test_cases/test0166.c create mode 100644 test_sunifdef/test_cases/test0166.c.expect create mode 100644 test_sunifdef/test_cases/test0167.c create mode 100644 test_sunifdef/test_cases/test0167.c.expect create mode 100644 test_sunifdef/test_cases/test0168.c create mode 100644 test_sunifdef/test_cases/test0168.c.expect create mode 100644 test_sunifdef/test_cases/test0169.c create mode 100644 test_sunifdef/test_cases/test0169.c.expect create mode 100644 test_sunifdef/test_cases/test0170.c create mode 100644 test_sunifdef/test_cases/test0170.c.expect create mode 100644 test_sunifdef/test_cases/test0171.c create mode 100644 test_sunifdef/test_cases/test0171.c.expect create mode 100644 test_sunifdef/test_cases/test0172.c create mode 100644 test_sunifdef/test_cases/test0172.c.expect create mode 100644 test_sunifdef/test_cases/test0173.c create mode 100644 test_sunifdef/test_cases/test0173.c.expect create mode 100644 test_sunifdef/test_cases/test0174.c create mode 100644 test_sunifdef/test_cases/test0174.c.expect create mode 100644 test_sunifdef/test_cases/test0175.c create mode 100644 test_sunifdef/test_cases/test0175.c.expect create mode 100644 test_sunifdef/test_cases/test0176.c create mode 100644 test_sunifdef/test_cases/test0176.c.expect create mode 100644 test_sunifdef/test_cases/test0177.c create mode 100644 test_sunifdef/test_cases/test0177.c.expect create mode 100644 test_sunifdef/test_cases/test0178.c create mode 100644 test_sunifdef/test_cases/test0178.c.expect create mode 100644 test_sunifdef/test_cases/test0179.c create mode 100644 test_sunifdef/test_cases/test0179.c.expect create mode 100644 test_sunifdef/test_cases/test0180.c create mode 100644 test_sunifdef/test_cases/test0180.c.expect create mode 100644 test_sunifdef/test_cases/test0181.c create mode 100644 test_sunifdef/test_cases/test0181.c.expect create mode 100644 test_sunifdef/test_cases/test0182.c create mode 100644 test_sunifdef/test_cases/test0182.c.expect create mode 100644 test_sunifdef/test_cases/test0183.c create mode 100644 test_sunifdef/test_cases/test0183.c.expect create mode 100644 test_sunifdef/test_cases/test0184.c create mode 100644 test_sunifdef/test_cases/test0184.c.expect create mode 100644 test_sunifdef/test_cases/test0185.c create mode 100644 test_sunifdef/test_cases/test0185.c.expect create mode 100644 test_sunifdef/test_cases/test0186.c create mode 100644 test_sunifdef/test_cases/test0186.c.expect create mode 100644 test_sunifdef/test_cases/test0187.c create mode 100644 test_sunifdef/test_cases/test0187.c.expect create mode 100644 test_sunifdef/test_cases/test0188.c create mode 100644 test_sunifdef/test_cases/test0188.c.expect create mode 100644 test_sunifdef/test_cases/test0189.c create mode 100644 test_sunifdef/test_cases/test0189.c.expect create mode 100644 test_sunifdef/test_cases/test0190.c create mode 100644 test_sunifdef/test_cases/test0190.c.expect create mode 100644 test_sunifdef/test_cases/test0191.c create mode 100644 test_sunifdef/test_cases/test0191.c.expect create mode 100644 test_sunifdef/test_cases/test0192.c create mode 100644 test_sunifdef/test_cases/test0192.c.expect create mode 100644 test_sunifdef/test_cases/test0193.c create mode 100644 test_sunifdef/test_cases/test0193.c.expect create mode 100644 test_sunifdef/test_cases/test0194.c create mode 100644 test_sunifdef/test_cases/test0194.c.expect create mode 100644 test_sunifdef/test_cases/test0195.c create mode 100644 test_sunifdef/test_cases/test0195.c.expect create mode 100644 test_sunifdef/test_cases/test0196.c create mode 100644 test_sunifdef/test_cases/test0196.c.expect create mode 100644 test_sunifdef/test_cases/test0197.c create mode 100644 test_sunifdef/test_cases/test0197.c.expect create mode 100644 test_sunifdef/test_cases/test0198.c create mode 100644 test_sunifdef/test_cases/test0198.c.expect create mode 100644 test_sunifdef/test_cases/test0199.c create mode 100644 test_sunifdef/test_cases/test0199.c.expect create mode 100644 test_sunifdef/test_cases/test0200.c create mode 100644 test_sunifdef/test_cases/test0200.c.expect diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..b6ace49 --- /dev/null +++ b/AUTHORS @@ -0,0 +1 @@ +Mike Kinghan diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..1e5c581 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,962 @@ +Symbian v0.1. Mike Kinghan. +* Added getopt.c and getopt.h for Standard C compatibility. +* Added implementations for err(), errx(), warnx(), vwarnx() for + Standard C compatibility. +* New: Added options -v, -h +* New: Made usage() much more explanatory. +* New: Accept `defined x' as well as `defined (x)' as per C Standard. +* New: + Handle #defines and #undefs: + We will drop a `#define sym' that reiterates a -Dsym. + (But we can't drop `#define sym val' even if it + reiterates -Dsym=val, because macro substitution may + depend on it.) + We will drop an `#undef sym' that reiterates a -Usym + We will replace `#define sym....' with an #error + when it contradicts -Usym or when it is a differing + redefinition of -Dsym[=val]. + We will replace `#undef sym' with an #error when it + contradicts -Dsym[=val] +* New: + Simplify truth-functional #ifs where possible even when + they cannot be eliminated on the basis of the -D or -U assumptions, +* Opt: + Introduce fast comparison op_cmp() in place of frequent calls + to strncmp() and strlen() on 1 or 2 byte strings. +* Opt: + The debug() function tested the debugging flag in every call + and did nothing in case false. Replace it with function ptr + debug that is initialised -> debug_live() when debugging == true + and empty function debug_dummy() when debugging == false. +* Opt: + Eliminated numerous strlcmp() calls re-testing initial + substrings of the same string. +* Fix: + Line continuations were recognised by skipcomment() + but on reading a line continuation it did not extend + the line buffer to get the rest of the continued line. + So e.g. + #define \ + FOO + was construed as an insoluble #if followed by a plain + line. +* Fix: eval_table() had two early returns with LT_IF in which it failed + to update the output argument char **cpp. This could lead + to a line being classified LS_DIRTY - not a possible + preprocessor line - when it was a valid preprocessor line. + +Symbian v0.1.1 Mike Kinghan. +* Fix: + Shortcircuit evaluation of binary truth functors did not + respect operator precedence. + +Symbian v0.1.2 Mike Kinghan. +* Fix: + Shortcircuit evaluation of binary truth functors was + broken in attempting to respect operator precedence. +* Fix: + Shortcircuit evaluation of binary truth functors + sometimes failed to propagate the value of shortcircuited + subexpression. +* Fix: + Invalid fall-through in getline() from symbol-not-found case + to ignore-symbol case. + +Symbian v0.2 Mike Kinghan +* New: + Substantial new logic to achieve a consistent handling of + constants (in the absence of -k), both in cases like #if 1, + #if 0, and in cases where constants are truth-functionally + combined with non-constant expressions. +* Fix: + Previous optimisation had broken keywordedit() + +Symbian v0.2.1 Mike Kinghan +* Fix: + #ifs of the form p && q or p || q with q constant and p + and p an insoluble expression where not handled correctly. + Note: + This version also contains inactive code preparatory to + resolving truth-functional tautologies and contradictions + in #ifs even where the operands are insoluable expressions. + +Symbian v1.0.0 Mike Kinghan +* New: + Errors diagnosing conflicts between the -U or -D assumptions + and #defines or #undefs encountered on input are now reported + on stderr, as well as reflected by #error directives on stdout. +* Fix: + A missing newline at the end of a preprocessor directive at EOF + is now reported as a non-fatal error, rather than provoking abort(). + +Symbian v1.0.0a Mike Kinghan +* Temporary hack version to enable system testing pending better handling + for case of: + #undef FOO + #define FOO + Emitted #error directives are made comments for now. + +Symbian v1.0.1 Mike Kinghan +* Fix: + When -DFOO[=STRING] is passed we're now smart enough to treat the + input sequence: + #undef FOO + #define FOO[=STRING] + as innocuously redundant. It is deleted, rather than diagnosing + a contradiction at #undef FOO. +Symbian v1.0.2 Mike Kinghan +* Fix: + When deleting a superfluous bracket, now replace it with a space + instead of a '\v' ('\v'es being erased on output). This fixes the + bug whereby e.g. + # if(FOO == 0) + becomes # ifFOO == 0 +Symbian v1.0.3 Mike Kinghan +* Fix: + v1.0.1 introduces a bug: it is possible for a deferred #error + diagnostic if and when it is output to overwrite the next "real" + line of pending output, so that the #error is output twice and the + real output line not at all. Now fixed. + Fix: + The fix in 1.0.1 was hastily tied off in respect of stderr output. + The innocuous input sequence: + #undef FOO + #define FOO[=STRING] + was deleted on stdout, but on stderr the #undef still provoked + an error diagnostic, and the following #define produced another + diagnostic to "excuse" the previous one. stderr is aligned with + stdout out and made silent for this input sequence + Fix: + The fix in v1.0.2 is the undesirable side-effect of leaving + superfluous whitespace instead of superfluous brackets. The fix is + now refined so that a superfluous bracket is deleted when it is + safe to do so and otherwise replaced with a space. "Safe" means + the superfluous bracket is flanked by whitespace or another bracket. +Symbian v1.0.4 Mike Kinghan +* New: + Simplification will no longer remove redundant parentheses from + a directive if it is otherwise unchanged. In the interest of + minimising insignificant diffs v. original code lines which are + not __materially__ simplified will be left alone. + +Symbian v1.0.5 Mike Kinghan +* Fix: + find_sym() was erroneously reporting a match of name1 with name2 if + name1 was an initial substring of name2. Overlooked side-effect of + replacing strlcmp() with strncmp(). + Fix: + #define and #undef directives were being processed without prior + decision as to whether the current if-state required them to be + dropped. Thus e.g. with unifdef -UUNDEFINED -DDEFINED the sequence + + #ifdef UNDEFINED + #undef DEFINED + #endif + + was provoking a "contradictory #undef" diagnostic. +Symbian v1.0.6 +* New: + If an EOF-in-comment error is given, the diagnostic now includes the + line number at which the unclosed comment begins. +* Fix: + Debug output fpr #defines and #undefs was garbled. +Symbian v1.1.0 Mike Kinghan. +* New: + Handling of quoted strings ("" or '') is + implemented. This eliminates broken behaviour when + comment-delimiters occur within quoted strings. The implementation + is within the function formerly known as "skipcomment()", + which is now more suitably called "chew_on()"; + + chew_on() treats paired double-quotes and paired single-quotes as + equivalent delimiters of text within which it will not parse + quotations of the other kind. It leaves the detection of + single-quote strings that are illegal character constants + to your compiler. + + chew_on() parses '\' as the escape character. A quote character that + is preceded by an unescaped escape is parsed as escaped, i.e. it + does not open or close a quotation. + + chew_on() will not parse the start of a comment within quotation, but + it will parse quotation within a comment, and will parse the end of + a comment within quotation within a comment. If an open quotation + is left dangling when a containing comment closes, the quotation + is deemed to be closed. chew_on() gives an error if an unescaped + newline occurs within quotation that is not within a comment. + + Thus chew_on() will never enter a an in-comment state within + quotation, but it tolerates all the following as comments. + (As I cannot nest C-comments, '{{' denotes a C-comment opening + and '}}' denotes a C-comment closure.) + + // This comment has contains an unclosed "-character. + // This comment doesn't but it contains an unclosed single quote. + {{ The following comment terminator isn't quoted by the + previous apostrophe or by this "-character }} + + Unifdef now gives error if EOF is read within quotation or within + a comment. The diagnostic refers to the line number at which the + dangling comment or quotation begins. +* New: + A new commandline option -x is introduced to control the policy for + handling #defines or #undefs that contradict the -D or + -U assumptions. 3 policies are provided: + + -xd A contradictory #define or #undef is just deleted + -xc A diagnostic comment is inserted in place of the + contradictory directive + -xe A diagnostic #error directive is inserted in place + of the contradictory directive + + A diagnostic is written to stderr whatever the policy + +* New: + Experimental code is removed because I have decided it has no future. +Symbian v1.1.1 Mike Kinghan. +* New: + The program now provides discriminating return codes. If the return + code is negative then unifdef ended abnormally and the input was + not completely processed. The abend codes are: + + -1 = Commandline line usage error. + -2 = Some resource was exhausted, probably memory. + -3 = A system error stopped execution. + -4 = Unifdef bailed out in confusion, due to a logic bug + + If the return code is non-negative then it is a bitmask. + If all bits are clear then the input was valid and has been copied + to output unchanged. + If return code & 1 is clear then the input was valid. + If return code & 1 is set then the input was found to be in error. + If return code & 2 is set then some input lines were deleted on + output. + If return code & 4 is set then #defines or #undefs in contradiction + of the -Ds and -Uswere deleted on output. + If return code & 8 is set then contradictory #defines or #undefs + were replaced with diagnostic comments. + If return code & 16 is set then contradictory #defines or #undefs + were replaced with diagnostic #errors. + + The flagging of contradictions does not entail that the input was + in error (return code & 1 may be clear). + + If return code & 32 is set then a parsing error was found + (and return code & 1 is set). + + Thus unproblematic return codes are 0 and 2. Return codes that are + odd or negative mean the output is not valid for the CPP. + +* Fix: + The policy flags that were supposed to be -xd, -xc and -xe were in + fact implemented as -x0, -x1 and -x2 respectively. + They are now as intended. + +Symbian v1.1.2 Mike Kinghan +* Fix: + The tool distinguishes the #-line statuses LT_CONSISTENT_DEFINE_KEEP + and LT_CONSISTENT_DEFINE_DROP, depending on whether a #define was + non-contradictory and non-redundant vis-a-vis -Ds and -Us, or + non-contradictory but redundant. But it neglected to make the same + necessary distinction for #undefs. They were just distinguished as + either contradictory or non-contradictory any non-contradictory + was #undef was dropped. +* New: + The warning "output may be truncated" that was issued for any + terminal error was unsatisfactorily vague. A new terminal error + message gives the return code and states whether end-of-input was + in fact reached. +* New: + The non-portable unix APIs err(), errx(), warnx() etc. do not well + answer our diagnostic needs since we have started to compose + provisional diagnostics for deferred use, so a second family of + diagnostic functions was introduced based on vcomplain(). This + became messy. All diagnostic functions are now based on vcomplain() + and the unix APIs are dispensed with. +Symbian v1.1.3 Mike Kinghan +* Fix: + The debug() optimisation of v0.1 introduced a bug that bites if + debug() is called before all the commandline arguments were parsed, + because the symbol would still be an uninitialised function pointer + (NULL). This would occur e.g. if a -D or -U symbol was found to be + a duplicate. The function pointer is now initialised to &debug_live. +* Fix: + A repercussion of parsing quotation is that we now also need to + recognise the #error directive as initiating a sort of comment-state + within which quotations need not be well-formed. Otherwise an #error + directive like: + + #error You can't define FOO and BAR at the same time! + + is faulted for newline within '... + + A new chew_on()-state called ERROR_COMMENT is introduced for this + purpose. The ERROR_COMMENT state is like the CXX_COMMENT state + except that it is terminated by the start of a C comment as well + as by a newline. +* Fix: + Innocuous logic error in chew_on() could cause an unescaped newline + within quotation within a comment to be processed twice. +* New: + Shared use of static scratch buffer for assembling formatted output + was too fragile, and needed a static MAXLINE. Safe dynamic solution + substituted. +Symbian v1.1.4 Mike Kinghan +* Fix. + Trashed the line-count in 1.1.3 :( +Symbian v1.1.5 Mike Kinghan +* Fix: + It was possible for chew_on() to return leaving itself + falsely in the escape state. + Fix: + Recognised that text following + + #define NAME[(arg,...)] + + until an unescaped newline must be parsed in the same way as the + text of an #error directive, i.e. as a sort of pseudo-comment that + is indefeasibly closed by unescaped newline or by the opening of a + true comment. Therefore have renamed the ERROR_COMMENT state + introduced in 1.1.3 as PSEUDO_COMMENT and forced the PSEUDO_COMMENT + state on the definiens of a #define. + Fix: + PSEUDO_COMMENT requires the diagnostic for EOF-within-comment to be + generalised and that an opening line number for this disgnostic + shall be recorded just after every #error and every + #define NAME[(arg,...)]. The diagnostic is now: + + "EOF within comment, #error ... or #define ... context \ + commencing at line " + + A line-continuation sequenence that is inadvertently not escaped + can trigger this diagnostic for C++ comments, #errors or #defines. + Fix: + The strip_newline() function that I used to remove the terminal + newline from the end of a line preparatory to quoting it in a + diagnostic was the source of a bug when I called it before I had + finished parsing the line. strip_newline() is now dispensed with + in favour of more recherche but safer sprintf() formatting. +* New: + Now check for duplicated or contradictory -Ds and -Us while parsing + commandline. Complain on duplicate. Bail on contradiction. +* New: + Complain when we output an #error directive not in #if-scope. This + indicates either that our -D and -U assumptions conflict with + conditions that the authors of the code wished to assert or else + that the code was already going to #error. + + If #error was unconditional on input, say: + "An unconditional #error directive was input". + If #error has been made unconditional by our assumptions, say: + "An unconditional #error directive was output". +* New: + Now complain of garbage following conditional directives. The + common error "#else if..." instead of #elif" gets this diagnostic + and is parsed as #else. The legacy behavior for garbage on + #-lines silently discarded the current truth-state and instated + an unresolved state. + + New: + The new diagnostics for unconditional #error directives and + garbage after preprocessor directive are not classified as parse + errors - they are warning - but would be indistinguishably reported + on stderr by the existing diagnostic machinery and not reflected + in the return code. + + The return codes and diagnostics are now rationalised on a + severity/reason-code model. Every diagnostic has a distinct reason + code that also encodes a severity. 4 severities are now assigned.. + + The severity of a reason code R is R & 0x1ff. + + A small number of reason codes are __summary__ reason codes, + i.e. they belong to summary diagnostics that are written to + stderr at termination. 4 summary reason codes are now assigned. + + All return codes are now non-negative and the return code is always + a bitmask of severities and summary reason codes. + + The return code encodes each distinct severity and each distinct + summary reason code that has accrued in the course of execution. + A return code RC can be interpreted as follows: + + RC = 0: SEVERITY_NONE + Execution ended with 0 diagnostics. + Good end of input reached. + + RC & 0x200: SEVERITY_INFO + Execution ended with at worst informational + diagnostics. + Good EOF reached. + + RC & 0x400: SEVERITY_WARNING + Execution ended with at worst warnings. + Good EOF reached. + + RC & 0x800: SEVERITY_ERROR + Execution ended with at worst errors. + Good EOF not reached. + (Errors may be diagnosed in the commandline + arguments or in parsing input). + + RC & 0x1000: SEVERITY_ABEND + Execution was aborted by an environment or internal + error, including unavailability of resource. + Good EOF not reached.. + (Inability to open an input file is classified as an + abend, though it may in fact result from user error). + + RC & 0x201: SUMMARY_DROPPED_LINES (INFO) + Input lines were dropped on output + + RC & 0x202: SUMMARY_CHANGED_LINES (INFO) + Input lines were changed on output + + RC & 0x404: SUMMARY_ERRORED_LINES (WARNING) + Input lines were changed to #errors on output, + because they contradicted the -Ds or -Us. + + RC & 0x408: SUMMARY_ERROR_OUPUT (WARNING) + An unconditional #error was output. + + Every diagnostic written on stderr includes its reason code. + The severity of the reason code is expressed in the diagnostic + with the appropriate format chosen from: + + "info :" + "warning :" + "error :" + "abend :" + + Reason codes are in ascending order by severity, + i.e info < warning < error < abend. + +Symbian v1.1.6 Mike Kinghan +* Fix: + Typo in severities enum caused contention for 1 bit flag + in the return code. Caused exit summary to claim errors when + there had only been info diagnostics +* Fix: + Corrected some errors and ommissions in usage help. + +* New: + New commandline option -m controls verbosity. (Has no + effect on the information in the return code.) + + -m{info|warning|error|abort} + + suppresses all diagnostics no worse than the specified + severity. + + -msummary + + suppresses summary diagnostics at exit. + + -m0xXXXX + + suppresses all diagnostics with codes matching all bits + in 0xXXXX + + -mverbose + + Output all diagnostics. + + If no -m specified default is -minfo -msummary (outputs + warnings and worse, no exit summary). +* + New: + For readability, diagnostics now prefixed just with + unqualified filename of executable rather than full path. + +* New: + Exit message shorter and clearer: Either: + "Completed [{at|before} EOF with \ + {remarks|warnings|errors}], exit code 0xXXXX" + or + "Aborted, exit code 0xXXX" +* New: + Diagnostics now refer to "foo.cpp: line nnnn:" + rather than "foo.cpp: nnnn:" +Symbian v1.1.7 Mike Kinghan +* Fix: + The "Abort..." exit diagnostic lacked an argument, would + use random memory. +* Fix: + The structure of the return code causes information to + be lost on environments that truncate process return codes + to unsigned char. (Doh!) The structure is therefore revised. + The severity bits are shifted into the low-order four bits + and the summary reason codes are shifted into bits immediately + higher. The 5th-9th bits were idle in the old rc. + + Isomorphism is lost between the reason codes as given in + diagnostics and the return code, but this is trivial. + + With this arrangement all the severity bits will be returned in + an unsigned char to the environment, and so will all 4 summary + bits that are currently assigned. + + Thus a return code is now interpreted: + + RC = 0: SEVERITY_NONE + + RC & 0x1: SEVERITY_INFO + + RC & 0x2: SEVERITY_WARNING + + RC & 0x4: SEVERITY_ERROR + + RC & 0x8: SEVERITY_ABEND + + RC & 0x11: SUMMARY_DROPPED_LINES (INFO) + + RC & 0x21: SUMMARY_CHANGED_LINES (INFO) + + RC & 0x42: SUMMARY_ERRORED_LINES (WARNING) + + RC & 0x82: SUMMARY_ERROR_OUPUT (WARNING) + +Symbian v1.1.8 Mike Kinghan +* Fix: + Serious bug caused evaluation of ...op...op... expressions or + for op = && or op = || to stop at the first occurrence. +* Fix: + Shy bug would make it possible for only one of a pair of + parentheses to be deleted in simplifying a directive, + when the other had no flanking whitespace. +* Fix: + Clarified usage help for -k option. + +* Fix: + v1.1.7 displayed its version as v1.1.6 for unifdef -v +* Fix: + vbail() failed to record severity in the exit code if no + message was passed. +* Fix: + Superfluous occurrence of word "with" in exit message. + +* Fix: + Reason were codes displayed with excess width. +* New: + The previously non-supressable exit message "Completed..." + is now classified as an informational diagnostic, so is + suppressed by -minfo or stronger (and so is suppressed by + default). +* New: + New option -fFILE allows options to be read from FILE. +Symbian v1.2.0 Mike Kinghan + (1.1.8 was supposed to be 1.2.0 but I forgot). +* Fix: + Windows build gave spurious read error on an -f file + if the file contained newlines. The check that fread() + returned bytes = size of file is invalid on Windows + because the read converts CRLFs to LFs. Have relaxed + check so that fread returns > 0. +* Fix: + The sequence + + #undef FOO + #define FOO + + has been spared a "contradiction" diagnostic in the + presence of -DFOO since 1.0.1. The diagnostic is stored + when #undef FOO is seen but discarded if #define FOO + turns up next. It was a bug however that the warning bit + set in the program return code when the contradiction was + provisionally noted was not returned to its prior set/clear + status when the diagnostic was discarded. Thus the rc could + indicate falsely that warnings had been issued. (Ideally + would not set the warning bit until the diagnostic is actually + issued but in the implementation that is more complicated + than resetting the status quo ante). + +* New: + -fFILE option made more flexible - is no longer exclusive + of other commandline args: + + Can now occur anywhere in a commandline and the options + read from FILE will be parsed as if they occurred in the + commandline at the position of the -f. + + This feature supports drivers that wish to input a constant + -f file for each of variable input files. Previously was + necessary for such a driver to assemble a fresh -f for + each input file so that the input file would be specified + in it. The alternative of redirecting stdin from the + input file would cause all diagnostics to refer to "[stdin]". + + The -f option may only occur once (so it may not occur + in the options read from an -f file). + +Symbian v.1.2.1 Mike Kinghan +* Fix: + Blanks lines output in lieu of deleted lines when -l used + were wrongly counted as dropped lines rather than changed lines. + +* Fix: + Debugging literal for the PSEUDO_COMMENT state had been + left as "#error COMMENT". Changed to "PSEUDO COMMENT" +* Fix: + If an input #undef was found in conflict with the + -Ds and -Us and replaced with a diagnostic comment or #error, + the return code would indicate lines dropped and also lines + changed. Should only indicate lines changed. The monitoring + of lines changed/lines dropped now simplified by just counting + these events at the point of occurrence and then working out + the final status bits at exit. + +sunifdef v0.1.0 Mike Kinghan +* New: + Tool renamed sunifdef to escape unifdef compatibility. + Root & branch modularisation of program. +* New: + Long options implemented. Library versions of getopt(), + getopt_long() were non-retentrant, hampering the implementation + of -fFILE. Using our own rentrant getopt_long(). Short + option flags are changed to harmonise with the long option + names. +* New: + Increased tolerance for sequences like: + + #undef FOO + #define FOO + + when we have -DFOO. We now refrain from complaint if the #undef and + the #define are separated, provided there is only whitespace and + comments in between. We also tolerate e.g. + + #undef FOO + #undef FOO + #define FOO +* New: + Hard-coded limit on line length removed. +* New: + Hard-coded limit on number of symbols removed. +* New: + New options: + -r | --replace + -B | --backup [SUFFIX] + support processing of multiple input files. + + --replace replaces each input file with the corresponding + output file. + + --backup SUFFIX backs up each input file + by appending SUFFIX to input filename. + + --replace changes the function of stdin when no input + files are specified. Without --replace stdin will supply the + sole input file, as before. With --replace, stdin will supply + names of input files. +* Fix: + Parentheses that ought to be deleted failed to be deleted when + they closed at end of line. +* Fix: + Modularisation compels back off the debug() optimisation + of v0.1 because extern function ptr + void (*debug)(const char *,...) does not honour variable + args. + +sunifdef v0.1.1 Mike Kinghan +* New: + Doxygen comments. +* Fix: + ptr_vector_insert() failed to extend heap block sufficiently on demand; + resulted in writing past end of blocks +* Fix: + stderr diagnostic was not cleared from heap when --conflict delete in force, + hence same diagnostic written repeatedly. +* Fix: + Spurious parse error given for `--constant eval,del' argument. +* Fix: + Statically initialised modules not 0-filled in optimised GCC build. +* Fix: + Comment-state must be set = PSEUDO_COMMENT for #error directive regardless + of whether it is to be kept or dropped. +sunifdef v0.1.2 Mike Kinghan +* Fix: + The "--constant" option was wrongly written "--constants" in the usage help. +* Fix: + Evaluation of arithmetic comparison ops was broken. +sunifdef v0.1.3 Mike Kinghan +* Fix: + Pointer into line buffer within chew_on() would be invalidated if + extend_line() reallocated the buffer. +* Fix: + --symbols option erroneously insisted on a --define or --undef +* Fix: + Did not correctly check for --symbols option to pre-empt + symbol lookups. +sunifdef v0.1.4 Mike Kinghan +* Fix: + DEF0002: memmove() miscalculation could cause seg fault in symbol table lookups. + Reported by "Juan LEON Lahoz Garcia" +* Fix: + DEF0003: Faulty ordering of insertions into the symbol table could cause lookups to fail + erroneously. Reported by "Juan LEON Lahoz Garcia" +sunifdef v1.0 Mike Kinghan +* New: + REW0002: The -i | --ignore option is renamed -p | --podsym to indicate better + that option causes lines to be treated as Plain Old data. The -t | + --text option is renamed -P | --pod for the same reason. +* New: + REW0003: The implementation of the --constant policy, though + consistent, was not conceptually coherent. Reworked. +* New: + FEA0006: The -p | --podsym option is honoured for `#if defined' and `#if !defined' + directives as well as #ifdef and #ifndef +* Fix: + DEF0004: Overlooked occurrence of "unifdef" rather than "sunifdef" in + diagnostic output. +* Fix: + DEF0005: The dropped lines count was not incremented for conflicts in + the presence of the `--conflict delete' option +* Fix: + DEF0006: The SUMMARY_ERRORED_LINES status flag (return code & 64) + was not set in respect of the `--conflict error' option. +* Fix: + DEF0007: The `--conflict error' option was not followed through for + the case where it causes an unconditional #error to be output + (return code & 128). +* Fix: + DEF0009: printline_cut() was capable of leaving non-printable + house-keeping bytes in the tidied up output buffer. +* Fix: + DEF0010: The --constant policy should apply to constants only in + truth-functional contexts but was applied in all contexts. In + arithmetic contexts constants should always be treated as + integers: the constant policy does not apply. +* Fix: + DEF0011: Parentheses rendered redundant by simplification + were not deleted in all cases where they safely could be. +sunifdef v1.0.1 Mike Kinghan +* Fix: + DEF0012: Spit-and-polish to get a clean build with -Wall +* Fix: + DEF0013: Removed needless redefinition of PATH_MAX from Windows + build. +* Fix: + DEF0014: `make check' always reported success even if the tests reported + failures. +* New: + TST0002: The test driver test_sunifdef is strengthened: + - To work without relying on system() to return a true exit code from + the executed command + - To work without relaying on system() to distinguish output redirectors + from the arguments of the command. + - To work in a Wine (Windows on Unix) emulator environment when the + input pathnames are not Windified + - To work in a Cygwin (Unix on Windows) emulator environment when the + input pathnames are not Windified. + +sunifdef v2.0 Mike Kinghan, 2006-06-24 +* Fix: + DEF0015: Truth-functional simplification was broken for + constant operands when --constant eval in force. +* Fix: + DEF0016: Murky evaluation of the PODSYM attribute over && and ||. + Rules now are: + Where A and B are both evaluated: + PODSYM(A && B) <-> PODSYM(A) && PODSYM(B) + PODSYM(A || B) <-> PODSYM(A) || PODSYM(B) + Where only A is evaluated by short-circuiting: + PODSYM(A && B) <-> PODSYM(A) + PODSYM(A || B) <-> PODSYM(A) +* New: + REW0001: Parser substantially simplified and much more powerful. + Previously only evaluated truth-functions and relational operators; + Could evaluate FOO defined -DFOO= where only where VAL was an + integer constant. Now can evaluate all C operators except the + conditional operator; can evaluate FOO provided VAL can be recursively + evaluated, but will determine that circularly defined symbol -DFOO=BAR + -DBAR=FOO is unresolved rather loop forever. +sunifdef v2.1. Mike Kinghan, 2006-06-27 +* Fix: + DEF0001: All usage errors now emit a diagnosis +* Fix: + DEF0017: --symbols option failed to list FOO when occurring in + #ifdef FOO or #ifndef FOO. +* Fix: + DEF0018: Unnecessary insistence on --replace option to process + mutliple files with --symbols option. +* Fix: + DEF0019: Lingering reference to "--ignore" in usage diagnostic + should have been changed to "--podsym". +* Fix: + DEF0020: The man page is more complete and correct. +* New: + FEA0001: Enable discarded lines to be output in the form of comments. +* New: + FEA0002: --symbols option now has arguments `all', `first' and + `locate'. `all' causes all occurrences of symbols to be listed. + `first' causes only the first occurrence of each symbol to be + listed. `locate' causes the file name and line number to be + appended to each listed occurrence. +* New: + RET0001 The --podsym option, formerly the --ignore option, is + dropped as not being plausibly worthwhile. + +* New: FEA0003 New --line option generates #line directives to make + CPP line-numbering of output agree with input even of lines are + dropped. +sunifdef v2.1.1 Mike Kinghan, 2006-07-07 +* Fix: + DEF0021: Evaluation of unparenthesised compound binary + truth-functions "...op...op..." lost information of unresolved + operands causing incorrect simplifications. +sunifdef v2.1.2 Mike Kinghan, 2006-07-16 +* Fix: + DEF0022: Fixed warnings for 64-bit build and unused function results. +* Fix: + DEF0023: Fixed infrinements of C89 +sunifdef v3.0 Mike Kinghan 2006-07-28 +* Fix: + DEF0024: Usage gave -gw as default instead of -gi +* Fix: + DEF0025: The --symbols option could produce spurious warnings of + contradictions. +* Fix: + DEF0026: The length of formatted output messages was unsafely assumed + not to exceed 2K. Their length is now limited only by available + heap. +* Fix: + DEF0027: A symbol for which --undef SYM was specified was evaluated + as an insoluble expression. This was at odds with the C Standard, + which stipulates the preprocessor will evaluate an undefined symbol + as 0. The behaviour now agrees with the Standard. +* Fix: + DEF0028: The state of the chew module was not fully reinitialised + at entry to each input files, causing any newline-within-quotation + error to be spuriously repeated for subsequent input files. +* Fix: + DEF0029: An unarranted simplification was applied to any compound truth + functional expression containing more than 1 operator where the + order of evaluation was determined by prercedence rather than by + parentheses. +* Fix: + REW0003: The inefficiently recursive formatting of output messaages + is reworked. +* New: + REW0004: Source files diagnostic.* to report.* to reflect broader function +* New: + REW0005: The range of message reason codes is widened from 6 to 7 bits to + accomodate additional diagnostics. +* New: + FEA0009: Unbalanced parentheses in expressions now provoke parse errors rather + than merely causing the expression to be unresolved. +* New: + FEA0010: Every output message now has a reason code. +* New: + FEA0011: sunifdef is now agnostic between Unix and Windows line-ends. +* New: + FEA0012: New --recurse option enables recursion into input directories. +* New: + FEA0013: Progress messages are a new category of messages with a severity + lower than informational messages. +* New: + FEA0014: New --filter option enables input files to be filtered by file extension. +* New: + FEA0015: New --keepgoing option makes sunifdef continue processing subsequent input files after errors. +* New: + FEA0016: Hex and octal constants are now recognised in preprocessor directives. +* New: + RET0002: The --gag 0xXXXX variant of --gag option is withdrawn. + +sunifdef v3.1 Mike Kinghan 2007-05-06 +* New: + FEA0017: Now can cope with multi-line C-comments embedded within + directives. +* New: + RET0003: The --obfusc option is withdrawn because the contexts + formerly classified as obfuscated are now handled in normal + parsing. +* Fix: + DEF0030: -DSYM=VAL or -USYM=VAL arguments when reported by the + --verbose option do not include the =VAL part. +* Fix: + DEF0031: The --constant policy should apply to constants only in + truth-functional contexts but was applied in all contexts. In + arithmetic contexts constants should always be treated as + integers. (Falsely recorded as fixed DEF0010). +* Fix: + DEF0032: With the --file option the "Building input tree" diagnostic + was emitted even without --verbose and could not be suppressed. +* Fix: + DEF0032: The --line option was not documented either in the man page + or in the --help output. +* Fix: + DEF0033: Return codes expressed all severities 1 level greater than + the true level. +* Fix: + DEF0034: A false verdict of differently redefined symbol + would be returned when the definiens of the symbol was + not itself a symbol. +* Fix: + DEF0035: Use of the --line option did not set the SUMMARY_CHANGED_LINES + flag in output. + +sunifdef v3.1.1 Mike Kinghan 2007-11-17 +* Fix: + DEF0036: Failed to detect unexpected end of file within an + unmatched #if when missing newline at end of file. +* Fix: + DEF0037: Summary counts of files reached and files abandoned + would be short by 1 if a parse error was encountered without + the --keepgoing option in force. +* Fix: + DEF0038: The extension-matching code supporting the --filter + option was broken, allowing --filter EXT to match any file + whose extension ended in EXT, even if not identical with EXT. +* Fix: + DEF0039: The current #if-depth and #if-line number were irrelevantly + reported on progress messages. + +sunifdef v3.1.2 Mike Kinghan 2007-11-19 +* Fix: + DEF0040: Defective filename matching could lead to a file being + mistaken for a directory when building the input file tree, if + a directory name was an initial substring of a filename at the + same level. +sunifdef v3.1.3 Mike Kinghan 2008-01-19 +* Fix: + DEF0041: When -DSYM=VAL is specified with VAL a hex integer + constant, rather than a decimal constant, sunifdef would + fail to resolve SYM in expressions unless the --constant eval was + specified, which should be unnecessary. The anomaly ocurred + because eval_symbol() anticipated constant values only as + decimal constants and, upon encountering a hex-prefix "0x" or + "OX" would attempt to parse the token as an expression, invoking + eval_table() and ultimately eval_unary(). The latter function + _would_ resolve a hex constant, but only if --constant eval is + in effect, since the function is assumed to operate on source + text rather than on the definiens of -DSYM=VAL. The fix + consists in recognising hex constants as such in eval_symbol(). +* Fix: + DEF0042: When -DSYM=VAL is specified with VAL a soluble + expression containing at least one integer constant operand, + sunifdef would fail to resolve SYM in expressions unless + --constant eval was specified. The reason is the same as in + bug DEF0041. The fix consists in recording the origin of the + text upon which eval_unary() is called - source text or else + the definiens of a --defined symbol - and always resolving + integer contstants in the latter case. +* Fix: + DEF0043: sunifdef did not distinguish octal numerals as integer + constants and evaluated them as decimal numerals. +* Fix: + DEF0044: sunifdef did not recognise the suffixes u/U, l/L as + belonging to integer constants. These suffixes are now + recognised; however, sunifdef still evaluates all integer + constants as ints and performs signed integer arithmetic upon + them. This is unfixed bug. +* Fix: + DEF0045: sunifdef did not detect integer overflow in evaluating + constants. Now detects overflow whenever the value of a constant + will exceed INT_MAX and leaves the constant unresolved with + a warning to that effect. + +* Fix: + DEF0046: The --help message contained an occurrence of '--constants' + that ought to have been '--constant'. +*/ + diff --git a/Doxyfile b/Doxyfile new file mode 100644 index 0000000..e78b777 --- /dev/null +++ b/Doxyfile @@ -0,0 +1,282 @@ +# Doxyfile 1.5.1-KDevelop + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = sunifdef +PROJECT_NUMBER = 3.1.3 +OUTPUT_DIRECTORY = . +CREATE_SUBDIRS = NO +OUTPUT_LANGUAGE = English +USE_WINDOWS_ENCODING = NO +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the +ALWAYS_DETAILED_SEC = NO +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = NO +STRIP_FROM_PATH = /home/imk/ +STRIP_FROM_INC_PATH = +SHORT_NAMES = NO +JAVADOC_AUTOBRIEF = NO +MULTILINE_CPP_IS_BRIEF = NO +DETAILS_AT_TOP = NO +INHERIT_DOCS = YES +SEPARATE_MEMBER_PAGES = NO +TAB_SIZE = 8 +ALIASES = +OPTIMIZE_OUTPUT_FOR_C = YES +OPTIMIZE_OUTPUT_JAVA = NO +BUILTIN_STL_SUPPORT = NO +DISTRIBUTE_GROUP_DOC = NO +SUBGROUPING = YES +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- +EXTRACT_ALL = NO +EXTRACT_PRIVATE = YES +EXTRACT_STATIC = YES +EXTRACT_LOCAL_CLASSES = YES +EXTRACT_LOCAL_METHODS = NO +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +HIDE_FRIEND_COMPOUNDS = NO +HIDE_IN_BODY_DOCS = NO +INTERNAL_DOCS = NO +CASE_SENSE_NAMES = YES +HIDE_SCOPE_NAMES = NO +SHOW_INCLUDE_FILES = YES +INLINE_INFO = YES +SORT_MEMBER_DOCS = YES +SORT_BRIEF_DOCS = NO +SORT_BY_SCOPE_NAME = NO +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +GENERATE_DEPRECATEDLIST= YES +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +SHOW_USED_FILES = YES +SHOW_DIRECTORIES = NO +FILE_VERSION_FILTER = +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = NO +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_IF_DOC_ERROR = YES +WARN_NO_PARAMDOC = NO +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = ./src +FILE_PATTERNS = *.c \ + *.cc \ + *.cxx \ + *.cpp \ + *.c++ \ + *.java \ + *.ii \ + *.ixx \ + *.ipp \ + *.i++ \ + *.inl \ + *.h \ + *.hh \ + *.hxx \ + *.hpp \ + *.h++ \ + *.idl \ + *.odl \ + *.cs \ + *.php \ + *.php3 \ + *.inc \ + *.m \ + *.mm \ + *.dox \ + *.C \ + *.CC \ + *.C++ \ + *.II \ + *.I++ \ + *.H \ + *.HH \ + *.H++ \ + *.CS \ + *.PHP \ + *.PHP3 \ + *.M \ + *.MM \ + *.C \ + *.H \ + *.tlh \ + *.diff \ + *.patch \ + *.moc \ + *.xpm \ + *.dox +RECURSIVE = YES +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = * +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_PATTERNS = +FILTER_SOURCE_FILES = NO +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- +SOURCE_BROWSER = YES +INLINE_SOURCES = NO +STRIP_CODE_COMMENTS = YES +REFERENCED_BY_RELATION = YES +REFERENCES_RELATION = YES +REFERENCES_LINK_SOURCE = YES +USE_HTAGS = NO +VERBATIM_HEADERS = YES +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- +ALPHABETICAL_INDEX = YES +COLS_IN_ALPHA_INDEX = 5 +IGNORE_PREFIX = +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = YES +HTML_OUTPUT = html +HTML_FILE_EXTENSION = .html +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = +HTML_ALIGN_MEMBERS = YES +GENERATE_HTMLHELP = NO +CHM_FILE = +HHC_LOCATION = +GENERATE_CHI = NO +BINARY_TOC = NO +TOC_EXPAND = NO +DISABLE_INDEX = NO +ENUM_VALUES_PER_LINE = 4 +GENERATE_TREEVIEW = NO +TREEVIEW_WIDTH = 250 +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- +GENERATE_LATEX = NO +LATEX_OUTPUT = latex +LATEX_CMD_NAME = latex +MAKEINDEX_CMD_NAME = makeindex +COMPACT_LATEX = NO +PAPER_TYPE = a4wide +EXTRA_PACKAGES = +LATEX_HEADER = +PDF_HYPERLINKS = NO +USE_PDFLATEX = NO +LATEX_BATCHMODE = NO +LATEX_HIDE_INDICES = NO +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- +GENERATE_RTF = NO +RTF_OUTPUT = rtf +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- +GENERATE_MAN = NO +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_LINKS = NO +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- +GENERATE_XML = NO +XML_OUTPUT = xml +XML_SCHEMA = +XML_DTD = +XML_PROGRAMLISTING = YES +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- +GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- +GENERATE_PERLMOD = NO +PERLMOD_LATEX = NO +PERLMOD_PRETTY = YES +PERLMOD_MAKEVAR_PREFIX = +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = YES +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = DEFAULT_STATIC_STATE \ + WINDOWS \ + UNIX +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- +TAGFILES = +GENERATE_TAGFILE = sunifdef.tag +ALLEXTERNALS = NO +EXTERNAL_GROUPS = YES +PERL_PATH = /usr/bin/perl +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- +CLASS_DIAGRAMS = NO +HIDE_UNDOC_RELATIONS = YES +HAVE_DOT = YES +CLASS_GRAPH = NO +COLLABORATION_GRAPH = NO +GROUP_GRAPHS = YES +UML_LOOK = NO +TEMPLATE_RELATIONS = NO +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +CALL_GRAPH = YES +CALLER_GRAPH = NO +GRAPHICAL_HIERARCHY = YES +DIRECTORY_GRAPH = NO +DOT_IMAGE_FORMAT = png +DOT_PATH = +DOTFILE_DIRS = +MAX_DOT_GRAPH_WIDTH = 1024 +MAX_DOT_GRAPH_HEIGHT = 1024 +MAX_DOT_GRAPH_DEPTH = 1000 +DOT_TRANSPARENT = NO +DOT_MULTI_TARGETS = NO +GENERATE_LEGEND = YES +DOT_CLEANUP = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- +SEARCHENGINE = NO diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..2e005e9 --- /dev/null +++ b/INSTALL @@ -0,0 +1,167 @@ +Basic 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 a while. While running, it prints some + messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Type `make install' to install the programs and any data files and + documentation. + + 4. You can remove the program binaries and object files from the + source code directory by typing `make clean'. + +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. + + 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. + +`--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. + diff --git a/LICENSE.BSD b/LICENSE.BSD new file mode 100644 index 0000000..fd4c908 --- /dev/null +++ b/LICENSE.BSD @@ -0,0 +1,27 @@ +Copyright (c) 2004-2006, Symbian Software Ltd. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions + are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + * Neither the name of the Symbian Software Ltd nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..6ff01f5 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,37 @@ +# not a GNU package. You can remove this line, if +# have all needed files, that a GNU package needs +AUTOMAKE_OPTIONS = foreign 1.4 + +EXTRA_DIST := man/sunifdef.1 man/html/sunifdef_man_1.html man/makeman.sh man/man_pod.pl\ +test_sunifdef/scrap_dir_tree.pl test_sunifdef/sunifdef_case_tester.pl \ +test_sunifdef/sunifdef_bulk_tester.pl test_sunifdef/sunifdef_softlink_tester.pl \ +perl/SunifdefLib.pm \ +$(wildcard test_sunifdef/test_cases/*.c) \ +$(wildcard test_sunifdef/test_cases/*.expect) \ +test_sunifdef/test_cases/altfiles \ +Doxyfile \ +LICENSE.BSD + + +SUBDIRS = src man test_sunifdef + +.phony: clean-recursive doxy-clean doxygen + +clean-recursive: doxy-clean + +doxy-clean: + rm -f ./html/* + +doxygen: ./html/index.html + +./html/index.html: ./src/sunifdef + if test -d ./html; then rm -f ./html/*; fi + doxygen Doxyfile + +man/sunifdef.1: + cd man && make + +man/html/sunifdef_man_1.html: man/sunifdef.1 + +./src/sunifdef: + cd src && make diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 0000000..0500f46 --- /dev/null +++ b/Makefile.in @@ -0,0 +1,660 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 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@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = . +DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/config.h.in \ + $(top_srcdir)/configure AUTHORS ChangeLog INSTALL config.guess \ + config.sub depcomp install-sh ltmain.sh missing mkinstalldirs +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + { test ! -d $(distdir) \ + || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr $(distdir); }; } +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +distuninstallcheck_listfiles = find . -type f -print +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +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@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +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@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ + +# not a GNU package. You can remove this line, if +# have all needed files, that a GNU package needs +AUTOMAKE_OPTIONS = foreign 1.4 +EXTRA_DIST := man/sunifdef.1 man/html/sunifdef_man_1.html man/makeman.sh man/man_pod.pl\ +test_sunifdef/scrap_dir_tree.pl test_sunifdef/sunifdef_case_tester.pl \ +test_sunifdef/sunifdef_bulk_tester.pl test_sunifdef/sunifdef_softlink_tester.pl \ +perl/SunifdefLib.pm \ +$(wildcard test_sunifdef/test_cases/*.c) \ +$(wildcard test_sunifdef/test_cases/*.expect) \ +test_sunifdef/test_cases/altfiles \ +Doxyfile \ +LICENSE.BSD + +SUBDIRS = src man test_sunifdef +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +.SUFFIXES: +am--refresh: + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \ + cd $(srcdir) && $(AUTOMAKE) --foreign \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.h: stamp-h1 + @if test ! -f $@; then \ + rm -f stamp-h1; \ + $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ + else :; fi + +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status config.h +$(srcdir)/config.h.in: $(am__configure_deps) + cd $(top_srcdir) && $(AUTOHEADER) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + 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 || \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + $(am__remove_distdir) + test -d $(distdir) || mkdir $(distdir) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$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 \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + distdir=`$(am__cd) $(distdir) && pwd`; \ + top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$top_distdir" \ + distdir="$$distdir/$$subdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + distdir) \ + || exit 1; \ + fi; \ + done + -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r $(distdir) +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +dist-tarZ: distdir + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__remove_distdir) + +dist-shar: distdir + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__remove_distdir) + +dist dist-all: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir); chmod a+w $(distdir) + mkdir $(distdir)/_build + mkdir $(distdir)/_inst + chmod a-w $(distdir) + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && cd $(distdir)/_build \ + && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck + $(am__remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @cd $(distuninstallcheck_dir) \ + && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-recursive +all-am: Makefile config.h +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-hdr \ + distclean-libtool distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-exec-am: + +install-html: install-html-recursive + +install-info: install-info-recursive + +install-man: + +install-pdf: install-pdf-recursive + +install-ps: install-ps-recursive + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ + install-strip + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am am--refresh check check-am clean clean-generic \ + clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ + dist-gzip dist-shar dist-tarZ dist-zip distcheck distclean \ + distclean-generic distclean-hdr distclean-libtool \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs installdirs-am \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-recursive uninstall uninstall-am + + +.phony: clean-recursive doxy-clean doxygen + +clean-recursive: doxy-clean + +doxy-clean: + rm -f ./html/* + +doxygen: ./html/index.html + +./html/index.html: ./src/sunifdef + if test -d ./html; then rm -f ./html/*; fi + doxygen Doxyfile + +man/sunifdef.1: + cd man && make + +man/html/sunifdef_man_1.html: man/sunifdef.1 + +./src/sunifdef: + cd src && make +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/README b/README new file mode 100644 index 0000000..6e3986b --- /dev/null +++ b/README @@ -0,0 +1,41 @@ +Installng +========= + +See the file INSTALL for installation guidance. + +Note that you must be root to run `make install'. + +A successful installation in the default path (/usr/local) will create 2 files: + +- The sunifdef executable /usr/local/bin/sunifdef +- The sunifdef man page /usr/local/man/man1/sunifdef.1 + +You can execute `sunifdef --version' at the command prompt to test that sunifdef +is correctly installed, and you can execute `man sunifdef' to test that the man +page is correctly installed. + + +HTML Documentation +================== +If you are running a version of KDE Konqueror that supports the man:/ protocol +then you can view the man page in HTML by entering man:/sunifdef in the address +bar. + +Otherwise you can use the HTML version of the man page that is included in the +distribution: sunifdef/man/html/sunifdef_man_1.html. + +If Doxygen is installed on your system then Maintainer's documentation can be +generated by running `make doxygen' in the package directory. + +Security +======== +You can authentic the tarball containing this file by comparing its md5 checksum +with the corresponding .md5 file at this URL: http://www.strudl.org/public/sunifdef/nix/stable/ + + +Testing Sunifdef +================ +There is a test suite in /sunifdef/test_sunifdef. The test suite is executed by +`make check'. There is more information in /sunifdef/test_sunifdef/README + +imk at strudl dot org diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100644 index 0000000..6f16c9d --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,7442 @@ +# generated automatically by aclocal 1.10 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006 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_if(m4_PACKAGE_VERSION, [2.61],, +[m4_fatal([this file was generated for autoconf 2.61. +You have another version of autoconf. If you want to use that, +you should regenerate the build system entirely.], [63])]) + +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- + +# serial 51 AC_PROG_LIBTOOL + + +# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) +# ----------------------------------------------------------- +# If this macro is not defined by Autoconf, define it here. +m4_ifdef([AC_PROVIDE_IFELSE], + [], + [m4_define([AC_PROVIDE_IFELSE], + [m4_ifdef([AC_PROVIDE_$1], + [$2], [$3])])]) + + +# AC_PROG_LIBTOOL +# --------------- +AC_DEFUN([AC_PROG_LIBTOOL], +[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl +dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX +dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. + AC_PROVIDE_IFELSE([AC_PROG_CXX], + [AC_LIBTOOL_CXX], + [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX + ])]) +dnl And a similar setup for Fortran 77 support + AC_PROVIDE_IFELSE([AC_PROG_F77], + [AC_LIBTOOL_F77], + [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 +])]) + +dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. +dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run +dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. + AC_PROVIDE_IFELSE([AC_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [ifdef([AC_PROG_GCJ], + [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) + ifdef([A][M_PROG_GCJ], + [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) + ifdef([LT_AC_PROG_GCJ], + [define([LT_AC_PROG_GCJ], + defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) +])])# AC_PROG_LIBTOOL + + +# _AC_PROG_LIBTOOL +# ---------------- +AC_DEFUN([_AC_PROG_LIBTOOL], +[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl +AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl +AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl +AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +# Prevent multiple expansion +define([AC_PROG_LIBTOOL], []) +])# _AC_PROG_LIBTOOL + + +# AC_LIBTOOL_SETUP +# ---------------- +AC_DEFUN([AC_LIBTOOL_SETUP], +[AC_PREREQ(2.50)dnl +AC_REQUIRE([AC_ENABLE_SHARED])dnl +AC_REQUIRE([AC_ENABLE_STATIC])dnl +AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_LD])dnl +AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl +AC_REQUIRE([AC_PROG_NM])dnl + +AC_REQUIRE([AC_PROG_LN_S])dnl +AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl +# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! +AC_REQUIRE([AC_OBJEXT])dnl +AC_REQUIRE([AC_EXEEXT])dnl +dnl + +AC_LIBTOOL_SYS_MAX_CMD_LEN +AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +AC_LIBTOOL_OBJDIR + +AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +_LT_AC_PROG_ECHO_BACKSLASH + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='sed -e 1s/^X//' +[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] + +# Same as above, but do not quote variable references. +[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +# Constants: +rm="rm -f" + +# Global variables: +default_ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a +ltmain="$ac_aux_dir/ltmain.sh" +ofile="$default_ofile" +with_gnu_ld="$lt_cv_prog_gnu_ld" + +AC_CHECK_TOOL(AR, ar, false) +AC_CHECK_TOOL(RANLIB, ranlib, :) +AC_CHECK_TOOL(STRIP, strip, :) + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +test -z "$AS" && AS=as +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$DLLTOOL" && DLLTOOL=dlltool +test -z "$LD" && LD=ld +test -z "$LN_S" && LN_S="ln -s" +test -z "$MAGIC_CMD" && MAGIC_CMD=file +test -z "$NM" && NM=nm +test -z "$SED" && SED=sed +test -z "$OBJDUMP" && OBJDUMP=objdump +test -z "$RANLIB" && RANLIB=: +test -z "$STRIP" && STRIP=: +test -z "$ac_objext" && ac_objext=o + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + +_LT_CC_BASENAME([$compiler]) + +# Only perform the check for file, if the check method requires it +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + AC_PATH_MAGIC + fi + ;; +esac + +AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) +AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], +enable_win32_dll=yes, enable_win32_dll=no) + +AC_ARG_ENABLE([libtool-lock], + [AC_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +AC_ARG_WITH([pic], + [AC_HELP_STRING([--with-pic], + [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], + [pic_mode="$withval"], + [pic_mode=default]) +test -z "$pic_mode" && pic_mode=default + +# Use C for the default configuration in the libtool script +tagname= +AC_LIBTOOL_LANG_C_CONFIG +_LT_AC_TAGCONFIG +])# AC_LIBTOOL_SETUP + + +# _LT_AC_SYS_COMPILER +# ------------------- +AC_DEFUN([_LT_AC_SYS_COMPILER], +[AC_REQUIRE([AC_PROG_CC])dnl + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC +])# _LT_AC_SYS_COMPILER + + +# _LT_CC_BASENAME(CC) +# ------------------- +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +AC_DEFUN([_LT_CC_BASENAME], +[for cc_temp in $1""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +]) + + +# _LT_COMPILER_BOILERPLATE +# ------------------------ +# Check for compiler boilerplate output or warnings with +# the simple compiler test code. +AC_DEFUN([_LT_COMPILER_BOILERPLATE], +[AC_REQUIRE([LT_AC_PROG_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* +])# _LT_COMPILER_BOILERPLATE + + +# _LT_LINKER_BOILERPLATE +# ---------------------- +# Check for linker boilerplate output or warnings with +# the simple link test code. +AC_DEFUN([_LT_LINKER_BOILERPLATE], +[AC_REQUIRE([LT_AC_PROG_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* +])# _LT_LINKER_BOILERPLATE + + +# _LT_AC_SYS_LIBPATH_AIX +# ---------------------- +# Links a minimal program and checks the executable +# for the system default hardcoded library path. In most cases, +# this is /usr/lib:/lib, but when the MPI compilers are used +# the location of the communication and MPI libs are included too. +# If we don't find anything, use the default library path according +# to the aix ld manual. +AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], +[AC_REQUIRE([LT_AC_PROG_SED])dnl +AC_LINK_IFELSE(AC_LANG_PROGRAM,[ +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi],[]) +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +])# _LT_AC_SYS_LIBPATH_AIX + + +# _LT_AC_SHELL_INIT(ARG) +# ---------------------- +AC_DEFUN([_LT_AC_SHELL_INIT], +[ifdef([AC_DIVERSION_NOTICE], + [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], + [AC_DIVERT_PUSH(NOTICE)]) +$1 +AC_DIVERT_POP +])# _LT_AC_SHELL_INIT + + +# _LT_AC_PROG_ECHO_BACKSLASH +# -------------------------- +# Add some code to the start of the generated configure script which +# will find an echo command which doesn't interpret backslashes. +AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], +[_LT_AC_SHELL_INIT([ +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` + ;; +esac + +echo=${ECHO-echo} +if test "X[$]1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X[$]1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then + # Yippee, $echo works! + : +else + # Restart under the correct shell. + exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} +fi + +if test "X[$]1" = X--fallback-echo; then + # used as fallback echo + shift + cat </dev/null 2>&1 && unset CDPATH + +if test -z "$ECHO"; then +if test "X${echo_test_string+set}" != Xset; then +# find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if (echo_test_string=`eval $cmd`) 2>/dev/null && + echo_test_string=`eval $cmd` && + (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null + then + break + fi + done +fi + +if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : +else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$echo" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + echo='print -r' + elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} + else + # Try using printf. + echo='printf %s\n' + if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + echo="$CONFIG_SHELL [$]0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$CONFIG_SHELL [$]0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do + if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "[$]0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} + else + # Oops. We lost completely, so just stick with echo. + echo=echo + fi + fi + fi + fi +fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +ECHO=$echo +if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then + ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" +fi + +AC_SUBST(ECHO) +])])# _LT_AC_PROG_ECHO_BACKSLASH + + +# _LT_AC_LOCK +# ----------- +AC_DEFUN([_LT_AC_LOCK], +[AC_ARG_ENABLE([libtool-lock], + [AC_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '[#]line __oline__ "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + libsuff=64 + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_LANG_PUSH(C) + AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_POP]) + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) LD="${LD-ld} -64" ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], +[*-*-cygwin* | *-*-mingw* | *-*-pw32*) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; + ]) +esac + +need_locks="$enable_libtool_lock" + +])# _LT_AC_LOCK + + +# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------------------- +# Check whether the given compiler option works +AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], +[AC_REQUIRE([LT_AC_PROG_SED]) +AC_CACHE_CHECK([$1], [$2], + [$2=no + ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$3" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + fi + $rm conftest* +]) + +if test x"[$]$2" = xyes; then + ifelse([$5], , :, [$5]) +else + ifelse([$6], , :, [$6]) +fi +])# AC_LIBTOOL_COMPILER_OPTION + + +# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [ACTION-SUCCESS], [ACTION-FAILURE]) +# ------------------------------------------------------------ +# Check whether the given compiler option works +AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], +[AC_REQUIRE([LT_AC_PROG_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $3" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&AS_MESSAGE_LOG_FD + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + else + $2=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" +]) + +if test x"[$]$2" = xyes; then + ifelse([$4], , :, [$4]) +else + ifelse([$5], , :, [$5]) +fi +])# AC_LIBTOOL_LINKER_OPTION + + +# AC_LIBTOOL_SYS_MAX_CMD_LEN +# -------------------------- +AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], +[# find the maximum length of command line arguments +AC_MSG_CHECKING([the maximum length of command line arguments]) +AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ + = "XX$teststring") >/dev/null 2>&1 && + new_result=`expr "X$teststring" : ".*" 2>&1` && + lt_cv_sys_max_cmd_len=$new_result && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + teststring= + # Add a significant safety factor because C++ compilers can tack on massive + # amounts of additional arguments before passing them to the linker. + # It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac +]) +if test -n $lt_cv_sys_max_cmd_len ; then + AC_MSG_RESULT($lt_cv_sys_max_cmd_len) +else + AC_MSG_RESULT(none) +fi +])# AC_LIBTOOL_SYS_MAX_CMD_LEN + + +# _LT_AC_CHECK_DLFCN +# ------------------ +AC_DEFUN([_LT_AC_CHECK_DLFCN], +[AC_CHECK_HEADERS(dlfcn.h)dnl +])# _LT_AC_CHECK_DLFCN + + +# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +# --------------------------------------------------------------------- +AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], +[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl +if test "$cross_compiling" = yes; then : + [$4] +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + else + puts (dlerror ()); + + exit (status); +}] +EOF + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_dlunknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi +fi +rm -fr conftest* +])# _LT_AC_TRY_DLOPEN_SELF + + +# AC_LIBTOOL_DLOPEN_SELF +# ---------------------- +AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], +[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ]) + ;; + + *) + AC_CHECK_FUNC([shl_load], + [lt_cv_dlopen="shl_load"], + [AC_CHECK_LIB([dld], [shl_load], + [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], + [AC_CHECK_FUNC([dlopen], + [lt_cv_dlopen="dlopen"], + [AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], + [AC_CHECK_LIB([svld], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], + [AC_CHECK_LIB([dld], [dld_link], + [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) + ]) + ]) + ]) + ]) + ]) + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_AC_TRY_DLOPEN_SELF( + lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, + lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) + ]) + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_AC_TRY_DLOPEN_SELF( + lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, + lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) + ]) + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi +])# AC_LIBTOOL_DLOPEN_SELF + + +# AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) +# --------------------------------- +# Check to see if options -c and -o are simultaneously supported by compiler +AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], +[AC_REQUIRE([LT_AC_PROG_SED])dnl +AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], + [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], + [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + fi + fi + chmod u+w . 2>&AS_MESSAGE_LOG_FD + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* +]) +])# AC_LIBTOOL_PROG_CC_C_O + + +# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) +# ----------------------------------------- +# Check to see if we can do hard links to lock some files if needed +AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], +[AC_REQUIRE([_LT_AC_LOCK])dnl + +hard_links="nottested" +if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + AC_MSG_CHECKING([if we can lock with hard links]) + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + AC_MSG_RESULT([$hard_links]) + if test "$hard_links" = no; then + AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) + need_locks=warn + fi +else + need_locks=no +fi +])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS + + +# AC_LIBTOOL_OBJDIR +# ----------------- +AC_DEFUN([AC_LIBTOOL_OBJDIR], +[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], +[rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null]) +objdir=$lt_cv_objdir +])# AC_LIBTOOL_OBJDIR + + +# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) +# ---------------------------------------------- +# Check hardcoding attributes. +AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], +[AC_MSG_CHECKING([how to hardcode library paths into programs]) +_LT_AC_TAGVAR(hardcode_action, $1)= +if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ + test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \ + test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then + + # We can hardcode non-existant directories. + if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && + test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then + # Linking always hardcodes the temporary library directory. + _LT_AC_TAGVAR(hardcode_action, $1)=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + _LT_AC_TAGVAR(hardcode_action, $1)=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + _LT_AC_TAGVAR(hardcode_action, $1)=unsupported +fi +AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) + +if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi +])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH + + +# AC_LIBTOOL_SYS_LIB_STRIP +# ------------------------ +AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], +[striplib= +old_striplib= +AC_MSG_CHECKING([whether stripping libraries is possible]) +if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) +fi + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac +fi +])# AC_LIBTOOL_SYS_LIB_STRIP + + +# AC_LIBTOOL_SYS_DYNAMIC_LINKER +# ----------------------------- +# PORTME Fill in your ld.so characteristics +AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], +[AC_REQUIRE([LT_AC_PROG_SED])dnl +AC_MSG_CHECKING([dynamic linker characteristics]) +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +m4_if($1,[],[ +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$lt_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e 's/;/ /g'` + else + lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`echo $lt_tmp_lt_search_path_spec | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[[lt_foo]]++; } + if (lt_freq[[lt_foo]] == 1) { print lt_foo; } +}'` + sys_lib_search_path_spec=`echo $lt_search_path_spec` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi]) +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[[01]] | aix4.[[01]].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[[45]]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[[123]]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[[01]]* | freebsdelf3.[[01]]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ + freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix[[3-9]]*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux* | k*bsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[[89]] | openbsd2.[[89]].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +AC_MSG_RESULT([$dynamic_linker]) +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi +])# AC_LIBTOOL_SYS_DYNAMIC_LINKER + + +# _LT_AC_TAGCONFIG +# ---------------- +AC_DEFUN([_LT_AC_TAGCONFIG], +[AC_REQUIRE([LT_AC_PROG_SED])dnl +AC_ARG_WITH([tags], + [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], + [include additional configurations @<:@automatic@:>@])], + [tagnames="$withval"]) + +if test -f "$ltmain" && test -n "$tagnames"; then + if test ! -f "${ofile}"; then + AC_MSG_WARN([output file `$ofile' does not exist]) + fi + + if test -z "$LTCC"; then + eval "`$SHELL ${ofile} --config | grep '^LTCC='`" + if test -z "$LTCC"; then + AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) + else + AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) + fi + fi + if test -z "$LTCFLAGS"; then + eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" + fi + + # Extract list of available tagged configurations in $ofile. + # Note that this assumes the entire list is on one line. + available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` + + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for tagname in $tagnames; do + IFS="$lt_save_ifs" + # Check whether tagname contains only valid characters + case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in + "") ;; + *) AC_MSG_ERROR([invalid tag name: $tagname]) + ;; + esac + + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null + then + AC_MSG_ERROR([tag name \"$tagname\" already exists]) + fi + + # Update the list of available tags. + if test -n "$tagname"; then + echo appending configuration tag \"$tagname\" to $ofile + + case $tagname in + CXX) + if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_LIBTOOL_LANG_CXX_CONFIG + else + tagname="" + fi + ;; + + F77) + if test -n "$F77" && test "X$F77" != "Xno"; then + AC_LIBTOOL_LANG_F77_CONFIG + else + tagname="" + fi + ;; + + GCJ) + if test -n "$GCJ" && test "X$GCJ" != "Xno"; then + AC_LIBTOOL_LANG_GCJ_CONFIG + else + tagname="" + fi + ;; + + RC) + AC_LIBTOOL_LANG_RC_CONFIG + ;; + + *) + AC_MSG_ERROR([Unsupported tag name: $tagname]) + ;; + esac + + # Append the new tag name to the list of available tags. + if test -n "$tagname" ; then + available_tags="$available_tags $tagname" + fi + fi + done + IFS="$lt_save_ifs" + + # Now substitute the updated list of available tags. + if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then + mv "${ofile}T" "$ofile" + chmod +x "$ofile" + else + rm -f "${ofile}T" + AC_MSG_ERROR([unable to update list of available tagged configurations.]) + fi +fi +])# _LT_AC_TAGCONFIG + + +# AC_LIBTOOL_DLOPEN +# ----------------- +# enable checks for dlopen support +AC_DEFUN([AC_LIBTOOL_DLOPEN], + [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) +])# AC_LIBTOOL_DLOPEN + + +# AC_LIBTOOL_WIN32_DLL +# -------------------- +# declare package support for building win32 DLLs +AC_DEFUN([AC_LIBTOOL_WIN32_DLL], +[AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) +])# AC_LIBTOOL_WIN32_DLL + + +# AC_ENABLE_SHARED([DEFAULT]) +# --------------------------- +# implement the --enable-shared flag +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +AC_DEFUN([AC_ENABLE_SHARED], +[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE([shared], + [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], + [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_shared=]AC_ENABLE_SHARED_DEFAULT) +])# AC_ENABLE_SHARED + + +# AC_DISABLE_SHARED +# ----------------- +# set the default shared flag to --disable-shared +AC_DEFUN([AC_DISABLE_SHARED], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_SHARED(no) +])# AC_DISABLE_SHARED + + +# AC_ENABLE_STATIC([DEFAULT]) +# --------------------------- +# implement the --enable-static flag +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +AC_DEFUN([AC_ENABLE_STATIC], +[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE([static], + [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], + [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_static=]AC_ENABLE_STATIC_DEFAULT) +])# AC_ENABLE_STATIC + + +# AC_DISABLE_STATIC +# ----------------- +# set the default static flag to --disable-static +AC_DEFUN([AC_DISABLE_STATIC], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_STATIC(no) +])# AC_DISABLE_STATIC + + +# AC_ENABLE_FAST_INSTALL([DEFAULT]) +# --------------------------------- +# implement the --enable-fast-install flag +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +AC_DEFUN([AC_ENABLE_FAST_INSTALL], +[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE([fast-install], + [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], + [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) +])# AC_ENABLE_FAST_INSTALL + + +# AC_DISABLE_FAST_INSTALL +# ----------------------- +# set the default to --disable-fast-install +AC_DEFUN([AC_DISABLE_FAST_INSTALL], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_FAST_INSTALL(no) +])# AC_DISABLE_FAST_INSTALL + + +# AC_LIBTOOL_PICMODE([MODE]) +# -------------------------- +# implement the --with-pic flag +# MODE is either `yes' or `no'. If omitted, it defaults to `both'. +AC_DEFUN([AC_LIBTOOL_PICMODE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +pic_mode=ifelse($#,1,$1,default) +])# AC_LIBTOOL_PICMODE + + +# AC_PROG_EGREP +# ------------- +# This is predefined starting with Autoconf 2.54, so this conditional +# definition can be removed once we require Autoconf 2.54 or later. +m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], +[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], + [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' + fi]) + EGREP=$ac_cv_prog_egrep + AC_SUBST([EGREP]) +])]) + + +# AC_PATH_TOOL_PREFIX +# ------------------- +# find a file program which can recognize shared library +AC_DEFUN([AC_PATH_TOOL_PREFIX], +[AC_REQUIRE([AC_PROG_EGREP])dnl +AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, +[case $MAGIC_CMD in +[[\\/*] | ?:[\\/]*]) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +dnl $ac_dummy forces splitting on constant user-supplied paths. +dnl POSIX.2 word splitting is done only on the output of word expansions, +dnl not every word. This closes a longstanding sh security hole. + ac_dummy="ifelse([$2], , $PATH, [$2])" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$1; then + lt_cv_path_MAGIC_CMD="$ac_dir/$1" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac]) +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + AC_MSG_RESULT($MAGIC_CMD) +else + AC_MSG_RESULT(no) +fi +])# AC_PATH_TOOL_PREFIX + + +# AC_PATH_MAGIC +# ------------- +# find a file program which can recognize a shared library +AC_DEFUN([AC_PATH_MAGIC], +[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) + else + MAGIC_CMD=: + fi +fi +])# AC_PATH_MAGIC + + +# AC_PROG_LD +# ---------- +# find the pathname to the GNU or non-GNU linker +AC_DEFUN([AC_PROG_LD], +[AC_ARG_WITH([gnu-ld], + [AC_HELP_STRING([--with-gnu-ld], + [assume the C compiler uses GNU ld @<:@default=no@:>@])], + [test "$withval" = no || with_gnu_ld=yes], + [with_gnu_ld=no]) +AC_REQUIRE([LT_AC_PROG_SED])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by $CC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(lt_cv_path_LD, +[if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[[3-9]]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux* | k*bsd*-gnu) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +nto-qnx*) + lt_cv_deplibs_check_method=unknown + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; +esac +]) +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown +])# AC_DEPLIBS_CHECK_METHOD + + +# AC_PROG_NM +# ---------- +# find the pathname to a BSD-compatible name lister +AC_DEFUN([AC_PROG_NM], +[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm +fi]) +NM="$lt_cv_path_NM" +])# AC_PROG_NM + + +# AC_CHECK_LIBM +# ------------- +# check for math library +AC_DEFUN([AC_CHECK_LIBM], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it + ;; +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") + AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") + ;; +*) + AC_CHECK_LIB(m, cos, LIBM="-lm") + ;; +esac +])# AC_CHECK_LIBM + + +# AC_LIBLTDL_CONVENIENCE([DIRECTORY]) +# ----------------------------------- +# sets LIBLTDL to the link flags for the libltdl convenience library and +# LTDLINCL to the include flags for the libltdl header and adds +# --enable-ltdl-convenience to the configure arguments. Note that +# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, +# it is assumed to be `libltdl'. LIBLTDL will be prefixed with +# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/' +# (note the single quotes!). If your package is not flat and you're not +# using automake, define top_builddir and top_srcdir appropriately in +# the Makefiles. +AC_DEFUN([AC_LIBLTDL_CONVENIENCE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + case $enable_ltdl_convenience in + no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; + "") enable_ltdl_convenience=yes + ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; + esac + LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la + LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + # For backwards non-gettext consistent compatibility... + INCLTDL="$LTDLINCL" +])# AC_LIBLTDL_CONVENIENCE + + +# AC_LIBLTDL_INSTALLABLE([DIRECTORY]) +# ----------------------------------- +# sets LIBLTDL to the link flags for the libltdl installable library and +# LTDLINCL to the include flags for the libltdl header and adds +# --enable-ltdl-install to the configure arguments. Note that +# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, +# and an installed libltdl is not found, it is assumed to be `libltdl'. +# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with +# '${top_srcdir}/' (note the single quotes!). If your package is not +# flat and you're not using automake, define top_builddir and top_srcdir +# appropriately in the Makefiles. +# In the future, this macro may have to be called after AC_PROG_LIBTOOL. +AC_DEFUN([AC_LIBLTDL_INSTALLABLE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + AC_CHECK_LIB(ltdl, lt_dlinit, + [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], + [if test x"$enable_ltdl_install" = xno; then + AC_MSG_WARN([libltdl not installed, but installation disabled]) + else + enable_ltdl_install=yes + fi + ]) + if test x"$enable_ltdl_install" = x"yes"; then + ac_configure_args="$ac_configure_args --enable-ltdl-install" + LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la + LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + else + ac_configure_args="$ac_configure_args --enable-ltdl-install=no" + LIBLTDL="-lltdl" + LTDLINCL= + fi + # For backwards non-gettext consistent compatibility... + INCLTDL="$LTDLINCL" +])# AC_LIBLTDL_INSTALLABLE + + +# AC_LIBTOOL_CXX +# -------------- +# enable support for C++ libraries +AC_DEFUN([AC_LIBTOOL_CXX], +[AC_REQUIRE([_LT_AC_LANG_CXX]) +])# AC_LIBTOOL_CXX + + +# _LT_AC_LANG_CXX +# --------------- +AC_DEFUN([_LT_AC_LANG_CXX], +[AC_REQUIRE([AC_PROG_CXX]) +AC_REQUIRE([_LT_AC_PROG_CXXCPP]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) +])# _LT_AC_LANG_CXX + +# _LT_AC_PROG_CXXCPP +# ------------------ +AC_DEFUN([_LT_AC_PROG_CXXCPP], +[ +AC_REQUIRE([AC_PROG_CXX]) +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_PROG_CXXCPP +fi +])# _LT_AC_PROG_CXXCPP + +# AC_LIBTOOL_F77 +# -------------- +# enable support for Fortran 77 libraries +AC_DEFUN([AC_LIBTOOL_F77], +[AC_REQUIRE([_LT_AC_LANG_F77]) +])# AC_LIBTOOL_F77 + + +# _LT_AC_LANG_F77 +# --------------- +AC_DEFUN([_LT_AC_LANG_F77], +[AC_REQUIRE([AC_PROG_F77]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) +])# _LT_AC_LANG_F77 + + +# AC_LIBTOOL_GCJ +# -------------- +# enable support for GCJ libraries +AC_DEFUN([AC_LIBTOOL_GCJ], +[AC_REQUIRE([_LT_AC_LANG_GCJ]) +])# AC_LIBTOOL_GCJ + + +# _LT_AC_LANG_GCJ +# --------------- +AC_DEFUN([_LT_AC_LANG_GCJ], +[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], + [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], + [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], + [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], + [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) +])# _LT_AC_LANG_GCJ + + +# AC_LIBTOOL_RC +# ------------- +# enable support for Windows resource files +AC_DEFUN([AC_LIBTOOL_RC], +[AC_REQUIRE([LT_AC_PROG_RC]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) +])# AC_LIBTOOL_RC + + +# AC_LIBTOOL_LANG_C_CONFIG +# ------------------------ +# Ensure that the configuration vars for the C compiler are +# suitably defined. Those variables are subsequently used by +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) +AC_DEFUN([_LT_AC_LANG_C_CONFIG], +[lt_save_CC="$CC" +AC_LANG_PUSH(C) + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +_LT_AC_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + +_LT_AC_SYS_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) +AC_LIBTOOL_PROG_COMPILER_PIC($1) +AC_LIBTOOL_PROG_CC_C_O($1) +AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +AC_LIBTOOL_PROG_LD_SHLIBS($1) +AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) +AC_LIBTOOL_SYS_LIB_STRIP +AC_LIBTOOL_DLOPEN_SELF + +# Report which library types will actually be built +AC_MSG_CHECKING([if libtool supports shared libraries]) +AC_MSG_RESULT([$can_build_shared]) + +AC_MSG_CHECKING([whether to build shared libraries]) +test "$can_build_shared" = "no" && enable_shared=no + +# On AIX, shared libraries and static libraries use the same namespace, and +# are all built from PIC. +case $host_os in +aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + +aix4* | aix5*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; +esac +AC_MSG_RESULT([$enable_shared]) + +AC_MSG_CHECKING([whether to build static libraries]) +# Make sure either enable_shared or enable_static is yes. +test "$enable_shared" = yes || enable_static=yes +AC_MSG_RESULT([$enable_static]) + +AC_LIBTOOL_CONFIG($1) + +AC_LANG_POP +CC="$lt_save_CC" +])# AC_LIBTOOL_LANG_C_CONFIG + + +# AC_LIBTOOL_LANG_CXX_CONFIG +# -------------------------- +# Ensure that the configuration vars for the C compiler are +# suitably defined. Those variables are subsequently used by +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) +AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], +[AC_LANG_PUSH(C++) +AC_REQUIRE([AC_PROG_CXX]) +AC_REQUIRE([_LT_AC_PROG_CXXCPP]) + +_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_AC_TAGVAR(allow_undefined_flag, $1)= +_LT_AC_TAGVAR(always_export_symbols, $1)=no +_LT_AC_TAGVAR(archive_expsym_cmds, $1)= +_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_AC_TAGVAR(hardcode_direct, $1)=no +_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_AC_TAGVAR(hardcode_libdir_separator, $1)= +_LT_AC_TAGVAR(hardcode_minus_L, $1)=no +_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +_LT_AC_TAGVAR(hardcode_automatic, $1)=no +_LT_AC_TAGVAR(module_cmds, $1)= +_LT_AC_TAGVAR(module_expsym_cmds, $1)= +_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown +_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_AC_TAGVAR(no_undefined_flag, $1)= +_LT_AC_TAGVAR(whole_archive_flag_spec, $1)= +_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Dependencies to place before and after the object being linked: +_LT_AC_TAGVAR(predep_objects, $1)= +_LT_AC_TAGVAR(postdep_objects, $1)= +_LT_AC_TAGVAR(predeps, $1)= +_LT_AC_TAGVAR(postdeps, $1)= +_LT_AC_TAGVAR(compiler_lib_search_path, $1)= + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +_LT_AC_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_AC_SYS_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_LD=$LD +lt_save_GCC=$GCC +GCC=$GXX +lt_save_with_gnu_ld=$with_gnu_ld +lt_save_path_LD=$lt_cv_path_LD +if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx +else + $as_unset lt_cv_prog_gnu_ld +fi +if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX +else + $as_unset lt_cv_path_LD +fi +test -z "${LDCXX+set}" || LD=$LDCXX +CC=${CXX-"c++"} +compiler=$CC +_LT_AC_TAGVAR(compiler, $1)=$CC +_LT_CC_BASENAME([$compiler]) + +# We don't want -fno-exception wen compiling C++ code, so set the +# no_builtin_flag separately +if test "$GXX" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' +else + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= +fi + +if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + AC_PROG_LD + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ + grep 'no-whole-archive' > /dev/null; then + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + +else + GXX=no + with_gnu_ld=no + wlarc= +fi + +# PORTME: fill in a description of your system's C++ link characteristics +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +_LT_AC_TAGVAR(ld_shlibs, $1)=yes +case $host_os in + aix3*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_AC_TAGVAR(archive_cmds, $1)='' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + if test "$GXX" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared libraries. + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_automatic, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + if test "$GXX" = yes ; then + lt_int_apple_cc_single_mod=no + output_verbose_link_cmd='echo' + if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then + lt_int_apple_cc_single_mod=yes + fi + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + fi + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + fi + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + freebsd[[12]]*) + # C++ shared libraries reported to be fairly broken before switch to ELF + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + freebsd-elf*) + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + freebsd* | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + ;; + gnu*) + ;; + hpux9*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) ;; + *) + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + interix[[3-9]]*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' + fi + fi + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + esac + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + linux* | k*bsd*-gnu) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc*) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC*) + # Portland Group C++ compiler + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + + # Not sure whether something based on + # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 + # would be better. + output_verbose_link_cmd='echo' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; + esac + ;; + lynxos*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + m88k*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + openbsd2*) + # C++ shared libraries are fairly broken + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd='echo' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + osf3*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + cxx*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + cxx*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ + $rm $lib.exp' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + psos*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. + # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + ;; + esac + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + output_verbose_link_cmd='echo' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' + if $CC --version | grep -v '^2\.7' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + fi + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + ;; + esac + fi + ;; + esac + ;; + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + # So that behaviour is only enabled if SCOABSPATH is set to a + # non-empty value in the environment. Most likely only useful for + # creating official distributions of packages. + # This is a hack until libtool officially supports absolute path + # names for shared libraries. + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + vxworks*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; +esac +AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) +test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +_LT_AC_TAGVAR(GCC, $1)="$GXX" +_LT_AC_TAGVAR(LD, $1)="$LD" + +AC_LIBTOOL_POSTDEP_PREDEP($1) +AC_LIBTOOL_PROG_COMPILER_PIC($1) +AC_LIBTOOL_PROG_CC_C_O($1) +AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +AC_LIBTOOL_PROG_LD_SHLIBS($1) +AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) + +AC_LIBTOOL_CONFIG($1) + +AC_LANG_POP +CC=$lt_save_CC +LDCXX=$LD +LD=$lt_save_LD +GCC=$lt_save_GCC +with_gnu_ldcxx=$with_gnu_ld +with_gnu_ld=$lt_save_with_gnu_ld +lt_cv_path_LDCXX=$lt_cv_path_LD +lt_cv_path_LD=$lt_save_path_LD +lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld +lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +])# AC_LIBTOOL_LANG_CXX_CONFIG + +# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) +# ------------------------------------ +# Figure out "hidden" library dependencies from verbose +# compiler output when linking a shared library. +# Parse the compiler output and extract the necessary +# objects, libraries and library flags. +AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ +dnl we can't use the lt_simple_compile_test_code here, +dnl because it contains code intended for an executable, +dnl not a library. It's possible we should let each +dnl tag define a new lt_????_link_test_code variable, +dnl but it's only used here... +ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + # + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + if test "$solaris_use_stlport4" != yes; then + _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; + +solaris*) + case $cc_basename in + CC*) + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + # Adding this requires a known-good setup of shared libraries for + # Sun compiler versions before 5.6, else PIC objects from an old + # archive will be linked into the output, leading to subtle bugs. + if test "$solaris_use_stlport4" != yes; then + _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; +esac +]) + +case " $_LT_AC_TAGVAR(postdeps, $1) " in +*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; +esac +])# AC_LIBTOOL_POSTDEP_PREDEP + +# AC_LIBTOOL_LANG_F77_CONFIG +# -------------------------- +# Ensure that the configuration vars for the C compiler are +# suitably defined. Those variables are subsequently used by +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)]) +AC_DEFUN([_LT_AC_LANG_F77_CONFIG], +[AC_REQUIRE([AC_PROG_F77]) +AC_LANG_PUSH(Fortran 77) + +_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_AC_TAGVAR(allow_undefined_flag, $1)= +_LT_AC_TAGVAR(always_export_symbols, $1)=no +_LT_AC_TAGVAR(archive_expsym_cmds, $1)= +_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_AC_TAGVAR(hardcode_direct, $1)=no +_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_AC_TAGVAR(hardcode_libdir_separator, $1)= +_LT_AC_TAGVAR(hardcode_minus_L, $1)=no +_LT_AC_TAGVAR(hardcode_automatic, $1)=no +_LT_AC_TAGVAR(module_cmds, $1)= +_LT_AC_TAGVAR(module_expsym_cmds, $1)= +_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown +_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_AC_TAGVAR(no_undefined_flag, $1)= +_LT_AC_TAGVAR(whole_archive_flag_spec, $1)= +_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for f77 test sources. +ac_ext=f + +# Object file extension for compiled f77 test sources. +objext=o +_LT_AC_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="\ + subroutine t + return + end +" + +# Code to be used in simple link tests +lt_simple_link_test_code="\ + program t + end +" + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_AC_SYS_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${F77-"f77"} +compiler=$CC +_LT_AC_TAGVAR(compiler, $1)=$CC +_LT_CC_BASENAME([$compiler]) + +AC_MSG_CHECKING([if libtool supports shared libraries]) +AC_MSG_RESULT([$can_build_shared]) + +AC_MSG_CHECKING([whether to build shared libraries]) +test "$can_build_shared" = "no" && enable_shared=no + +# On AIX, shared libraries and static libraries use the same namespace, and +# are all built from PIC. +case $host_os in +aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; +aix4* | aix5*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; +esac +AC_MSG_RESULT([$enable_shared]) + +AC_MSG_CHECKING([whether to build static libraries]) +# Make sure either enable_shared or enable_static is yes. +test "$enable_shared" = yes || enable_static=yes +AC_MSG_RESULT([$enable_static]) + +_LT_AC_TAGVAR(GCC, $1)="$G77" +_LT_AC_TAGVAR(LD, $1)="$LD" + +AC_LIBTOOL_PROG_COMPILER_PIC($1) +AC_LIBTOOL_PROG_CC_C_O($1) +AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +AC_LIBTOOL_PROG_LD_SHLIBS($1) +AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) + +AC_LIBTOOL_CONFIG($1) + +AC_LANG_POP +CC="$lt_save_CC" +])# AC_LIBTOOL_LANG_F77_CONFIG + + +# AC_LIBTOOL_LANG_GCJ_CONFIG +# -------------------------- +# Ensure that the configuration vars for the C compiler are +# suitably defined. Those variables are subsequently used by +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)]) +AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG], +[AC_LANG_SAVE + +# Source file extension for Java test sources. +ac_ext=java + +# Object file extension for compiled Java test sources. +objext=o +_LT_AC_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="class foo {}" + +# Code to be used in simple link tests +lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_AC_SYS_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${GCJ-"gcj"} +compiler=$CC +_LT_AC_TAGVAR(compiler, $1)=$CC +_LT_CC_BASENAME([$compiler]) + +# GCJ did not exist at the time GCC didn't implicitly link libc in. +_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds + +AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) +AC_LIBTOOL_PROG_COMPILER_PIC($1) +AC_LIBTOOL_PROG_CC_C_O($1) +AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +AC_LIBTOOL_PROG_LD_SHLIBS($1) +AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) + +AC_LIBTOOL_CONFIG($1) + +AC_LANG_RESTORE +CC="$lt_save_CC" +])# AC_LIBTOOL_LANG_GCJ_CONFIG + + +# AC_LIBTOOL_LANG_RC_CONFIG +# ------------------------- +# Ensure that the configuration vars for the Windows resource compiler are +# suitably defined. Those variables are subsequently used by +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)]) +AC_DEFUN([_LT_AC_LANG_RC_CONFIG], +[AC_LANG_SAVE + +# Source file extension for RC test sources. +ac_ext=rc + +# Object file extension for compiled RC test sources. +objext=o +_LT_AC_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' + +# Code to be used in simple link tests +lt_simple_link_test_code="$lt_simple_compile_test_code" + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_AC_SYS_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${RC-"windres"} +compiler=$CC +_LT_AC_TAGVAR(compiler, $1)=$CC +_LT_CC_BASENAME([$compiler]) +_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + +AC_LIBTOOL_CONFIG($1) + +AC_LANG_RESTORE +CC="$lt_save_CC" +])# AC_LIBTOOL_LANG_RC_CONFIG + + +# AC_LIBTOOL_CONFIG([TAGNAME]) +# ---------------------------- +# If TAGNAME is not passed, then create an initial libtool script +# with a default configuration from the untagged config vars. Otherwise +# add code to config.status for appending the configuration named by +# TAGNAME from the matching tagged config vars. +AC_DEFUN([AC_LIBTOOL_CONFIG], +[# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + _LT_AC_TAGVAR(compiler, $1) \ + _LT_AC_TAGVAR(CC, $1) \ + _LT_AC_TAGVAR(LD, $1) \ + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \ + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \ + _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \ + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \ + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \ + _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \ + _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \ + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \ + _LT_AC_TAGVAR(old_archive_cmds, $1) \ + _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \ + _LT_AC_TAGVAR(predep_objects, $1) \ + _LT_AC_TAGVAR(postdep_objects, $1) \ + _LT_AC_TAGVAR(predeps, $1) \ + _LT_AC_TAGVAR(postdeps, $1) \ + _LT_AC_TAGVAR(compiler_lib_search_path, $1) \ + _LT_AC_TAGVAR(archive_cmds, $1) \ + _LT_AC_TAGVAR(archive_expsym_cmds, $1) \ + _LT_AC_TAGVAR(postinstall_cmds, $1) \ + _LT_AC_TAGVAR(postuninstall_cmds, $1) \ + _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \ + _LT_AC_TAGVAR(allow_undefined_flag, $1) \ + _LT_AC_TAGVAR(no_undefined_flag, $1) \ + _LT_AC_TAGVAR(export_symbols_cmds, $1) \ + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \ + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \ + _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \ + _LT_AC_TAGVAR(hardcode_automatic, $1) \ + _LT_AC_TAGVAR(module_cmds, $1) \ + _LT_AC_TAGVAR(module_expsym_cmds, $1) \ + _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \ + _LT_AC_TAGVAR(fix_srcfile_path, $1) \ + _LT_AC_TAGVAR(exclude_expsyms, $1) \ + _LT_AC_TAGVAR(include_expsyms, $1); do + + case $var in + _LT_AC_TAGVAR(old_archive_cmds, $1) | \ + _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \ + _LT_AC_TAGVAR(archive_cmds, $1) | \ + _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \ + _LT_AC_TAGVAR(module_cmds, $1) | \ + _LT_AC_TAGVAR(module_expsym_cmds, $1) | \ + _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \ + _LT_AC_TAGVAR(export_symbols_cmds, $1) | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\[$]0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'` + ;; + esac + +ifelse([$1], [], + [cfgfile="${ofile}T" + trap "$rm \"$cfgfile\"; exit 1" 1 2 15 + $rm -f "$cfgfile" + AC_MSG_NOTICE([creating $ofile])], + [cfgfile="$ofile"]) + + cat <<__EOF__ >> "$cfgfile" +ifelse([$1], [], +[#! $SHELL + +# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 +# Free Software Foundation, Inc. +# +# This file is part of GNU Libtool: +# Originally by Gordon Matzigkeit , 1996 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="$SED -e 1s/^X//" + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# The names of the tagged configurations supported by this script. +available_tags= + +# ### BEGIN LIBTOOL CONFIG], +[# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# A language-specific compiler. +CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) + +# Is the compiler the GNU C compiler? +with_gcc=$_LT_AC_TAGVAR(GCC, $1) + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_[]_LT_AC_TAGVAR(LD, $1) + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$lt_STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) + +# Commands used to build and install a shared archive. +archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) +archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) +module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1) + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path=$lt_fix_srcfile_path + +# Set to yes if exported symbols are required. +always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) + +# The commands to list exported symbols. +export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) + +# Symbols that must always be exported. +include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) + +ifelse([$1],[], +[# ### END LIBTOOL CONFIG], +[# ### END LIBTOOL TAG CONFIG: $tagname]) + +__EOF__ + +ifelse([$1],[], [ + case $host_os in + aix3*) + cat <<\EOF >> "$cfgfile" + +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +EOF + ;; + esac + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || \ + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" +]) +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi +])# AC_LIBTOOL_CONFIG + + +# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) +# ------------------------------------------- +AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], +[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl + +_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + +if test "$GCC" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + + AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], + lt_cv_prog_compiler_rtti_exceptions, + [-fno-rtti -fno-exceptions], [], + [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) +fi +])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI + + +# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +# --------------------------------- +AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], +[AC_REQUIRE([AC_CANONICAL_HOST]) +AC_REQUIRE([LT_AC_PROG_SED]) +AC_REQUIRE([AC_PROG_NM]) +AC_REQUIRE([AC_OBJEXT]) +# Check for command to grab the raw symbol name followed by C symbol from nm. +AC_MSG_CHECKING([command to parse $NM output from $compiler object]) +AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], +[ +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[[BCDEGRST]]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' + +# Transform an extracted symbol line into a proper C declaration +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[[BCDT]]' + ;; +cygwin* | mingw* | pw32*) + symcode='[[ABCDGISTW]]' + ;; +hpux*) # Its linker distinguishes data from code symbols + if test "$host_cpu" = ia64; then + symcode='[[ABCDEGRST]]' + fi + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + ;; +linux* | k*bsd*-gnu) + if test "$host_cpu" = ia64; then + symcode='[[ABCDGIRSTW]]' + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + fi + ;; +irix* | nonstopux*) + symcode='[[BCDEGRST]]' + ;; +osf*) + symcode='[[BCDEGQRST]]' + ;; +solaris*) + symcode='[[BDRT]]' + ;; +sco3.2v5*) + symcode='[[DT]]' + ;; +sysv4.2uw2*) + symcode='[[DT]]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[[ABDT]]' + ;; +sysv4) + symcode='[[DFNSTU]]' + ;; +esac + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[[ABCDGIRSTW]]' ;; +esac + +# Try without a prefix undercore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if grep ' nm_test_var$' "$nlist" >/dev/null; then + if grep ' nm_test_func$' "$nlist" >/dev/null; then + cat < conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' + + cat <> conftest.$ac_ext +#if defined (__STDC__) && __STDC__ +# define lt_ptr_t void * +#else +# define lt_ptr_t char * +# define const +#endif + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + lt_ptr_t address; +} +lt_preloaded_symbols[[]] = +{ +EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext + cat <<\EOF >> conftest.$ac_ext + {0, (lt_ptr_t) 0} +}; + +#ifdef __cplusplus +} +#endif +EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD + fi + else + echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD + cat conftest.$ac_ext >&5 + fi + rm -f conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done +]) +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + AC_MSG_RESULT(failed) +else + AC_MSG_RESULT(ok) +fi +]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE + + +# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) +# --------------------------------------- +AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], +[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= +_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= +_LT_AC_TAGVAR(lt_prog_compiler_static, $1)= + +AC_MSG_CHECKING([for $compiler option to produce PIC]) + ifelse([$1],[CXX],[ + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | os2* | pw32*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + case $host_os in + aix4* | aix5*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + esac + ;; + dgux*) + case $cc_basename in + ec++*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + ;; + aCC*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux* | k*bsd*-gnu) + case $cc_basename in + KCC*) + # KAI C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + icpc* | ecpc*) + # Intel C++ + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgCC*) + # Portland Group C++ compiler. + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + esac + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + cxx*) + # Digital/Compaq C++ + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + lcc*) + # Lucid + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + vxworks*) + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +], +[ + if test "$GCC" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + esac + ;; + + mingw* | cygwin* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC (with -KPIC) is the default. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + newsos6) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + linux* | k*bsd*-gnu) + case $cc_basename in + icc* | ecc*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + ccc*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All Alpha code is PIC. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C 5.9 + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + *Sun\ F*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='' + ;; + esac + ;; + esac + ;; + + osf3* | osf4* | osf5*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All OSF/1 code is PIC. + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + rdos*) + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + solaris*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; + *) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; + esac + ;; + + sunos4*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + unicos*) + _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + + uts4*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *) + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +]) +AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then + AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], + _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), + [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], + [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in + "" | " "*) ;; + *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; + esac], + [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) +fi +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + *) + _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" + ;; +esac + +# +# Check to make sure the static flag actually works. +# +wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\" +AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], + _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), + $lt_tmp_static_flag, + [], + [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) +]) + + +# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) +# ------------------------------------ +# See if the linker supports building shared libraries. +AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], +[AC_REQUIRE([LT_AC_PROG_SED])dnl +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +ifelse([$1],[CXX],[ + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + case $host_os in + aix4* | aix5*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + else + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" + ;; + cygwin* | mingw*) + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' + ;; + *) + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac +],[ + runpath_var= + _LT_AC_TAGVAR(allow_undefined_flag, $1)= + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no + _LT_AC_TAGVAR(archive_cmds, $1)= + _LT_AC_TAGVAR(archive_expsym_cmds, $1)= + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= + _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_minus_L, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown + _LT_AC_TAGVAR(hardcode_automatic, $1)=no + _LT_AC_TAGVAR(module_cmds, $1)= + _LT_AC_TAGVAR(module_expsym_cmds, $1)= + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + _LT_AC_TAGVAR(include_expsyms, $1)= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + extract_expsyms_cmds= + # Just being paranoid about ensuring that cc_basename is set. + _LT_CC_BASENAME([$compiler]) + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + fi + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + _LT_AC_TAGVAR(ld_shlibs, $1)=no + cat <&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +EOF + fi + ;; + + amigaos*) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + interix[[3-9]]*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | k*bsd*-gnu) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + *) + tmp_sharedflag='-shared' ;; + esac + _LT_AC_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test $supports_anon_versioning = yes; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + _LT_AC_TAGVAR(ld_shlibs, $1)=no + cat <&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +EOF + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + sunos4*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + + if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then + runpath_var= + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + else + _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_AC_TAGVAR(archive_cmds, $1)='' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + if test "$GCC" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared libraries. + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + # see comment about different semantics on the GNU ld section + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + bsdi[[45]]*) + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic + ;; + + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_AC_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' + _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_automatic, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + if test "$GCC" = yes ; then + output_verbose_link_cmd='echo' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + fi + ;; + + dgux*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + freebsd1*) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + hpux9*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + newsos6) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + else + case $host_os in + openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + ;; + esac + fi + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + os2*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + else + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' + + # Both c and cxx compiler support -rpath directly + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + fi + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + solaris*) + _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' + if test "$GCC" = yes; then + wlarc='${wl}' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + wlarc='' + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + fi + ;; + esac + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4) + case $host_vendor in + sni) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' + _LT_AC_TAGVAR(hardcode_direct, $1)=no + ;; + motorola) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4.3*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + fi +]) +AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) +test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +# +# Do we need to explicitly link libc? +# +case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in +x|xyes) + # Assume -lc should be added + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $_LT_AC_TAGVAR(archive_cmds, $1) in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + AC_MSG_CHECKING([whether -lc should be explicitly linked in]) + $rm conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) + pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) + _LT_AC_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) + then + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + else + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) + ;; + esac + fi + ;; +esac +])# AC_LIBTOOL_PROG_LD_SHLIBS + + +# _LT_AC_FILE_LTDLL_C +# ------------------- +# Be careful that the start marker always follows a newline. +AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ +# /* ltdll.c starts here */ +# #define WIN32_LEAN_AND_MEAN +# #include +# #undef WIN32_LEAN_AND_MEAN +# #include +# +# #ifndef __CYGWIN__ +# # ifdef __CYGWIN32__ +# # define __CYGWIN__ __CYGWIN32__ +# # endif +# #endif +# +# #ifdef __cplusplus +# extern "C" { +# #endif +# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); +# #ifdef __cplusplus +# } +# #endif +# +# #ifdef __CYGWIN__ +# #include +# DECLARE_CYGWIN_DLL( DllMain ); +# #endif +# HINSTANCE __hDllInstance_base; +# +# BOOL APIENTRY +# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) +# { +# __hDllInstance_base = hInst; +# return TRUE; +# } +# /* ltdll.c ends here */ +])# _LT_AC_FILE_LTDLL_C + + +# _LT_AC_TAGVAR(VARNAME, [TAGNAME]) +# --------------------------------- +AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) + + +# old names +AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) +AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) +AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) +AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) +AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) + +# This is just to silence aclocal about the macro not being used +ifelse([AC_DISABLE_FAST_INSTALL]) + +AC_DEFUN([LT_AC_PROG_GCJ], +[AC_CHECK_TOOL(GCJ, gcj, no) + test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" + AC_SUBST(GCJFLAGS) +]) + +AC_DEFUN([LT_AC_PROG_RC], +[AC_CHECK_TOOL(RC, windres, no) +]) + + +# Cheap backport of AS_EXECUTABLE_P and required macros +# from Autoconf 2.59; we should not use $as_executable_p directly. + +# _AS_TEST_PREPARE +# ---------------- +m4_ifndef([_AS_TEST_PREPARE], +[m4_defun([_AS_TEST_PREPARE], +[if test -x / >/dev/null 2>&1; then + as_executable_p='test -x' +else + as_executable_p='test -f' +fi +])])# _AS_TEST_PREPARE + +# AS_EXECUTABLE_P +# --------------- +# Check whether a file is executable. +m4_ifndef([AS_EXECUTABLE_P], +[m4_defun([AS_EXECUTABLE_P], +[AS_REQUIRE([_AS_TEST_PREPARE])dnl +$as_executable_p $1[]dnl +])])# AS_EXECUTABLE_P + +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_SED. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +# LT_AC_PROG_SED +# -------------- +# Check for a fully-functional sed program, that truncates +# as few characters as possible. Prefer GNU sed if found. +AC_DEFUN([LT_AC_PROG_SED], +[AC_MSG_CHECKING([for a sed that does not truncate output]) +AC_CACHE_VAL(lt_cv_path_SED, +[# Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if AS_EXECUTABLE_P(["$as_dir/$lt_ac_prog$ac_exec_ext"]); then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +IFS=$as_save_IFS +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done +]) +SED=$lt_cv_path_SED +AC_SUBST([SED]) +AC_MSG_RESULT([$SED]) +]) + +# Copyright (C) 2002, 2003, 2005, 2006 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.10' +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.10], [], + [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 AC_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.10])dnl +_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 8 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 9 + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], UPC, [depcc="$UPC" am_compiler_list=], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + 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 + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + 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 + ;; + none) break ;; + esac + # 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. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} 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 sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +#serial 3 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 8 + +# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. +AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 12 + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.60])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_PROG_INSTALL_SH +AM_PROG_INSTALL_STRIP +AC_REQUIRE([AM_PROG_MKDIR_P])dnl +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES(OBJC)], + [define([AC_PROG_OBJC], + defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl +]) +]) + + +# 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_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $1 | $1:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} +AC_SUBST(install_sh)]) + +# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +# Copyright (C) 2003, 2004, 2005, 2006 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_MKDIR_P +# --------------- +# Check for `mkdir -p'. +AC_DEFUN([AM_PROG_MKDIR_P], +[AC_PREREQ([2.60])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, +dnl while keeping a definition of mkdir_p for backward compatibility. +dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. +dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of +dnl Makefile.ins that do not define MKDIR_P, so we do our own +dnl adjustment using top_builddir (which is defined more often than +dnl MKDIR_P). +AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl +case $mkdir_p in + [[\\/$]]* | ?:[[\\/]]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# _AM_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], +[AC_FOREACH([_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])]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) + +# Copyright (C) 2001, 2003, 2005 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 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 outputing VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# _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. +AM_MISSING_PROG([AMTAR], [tar]) +m4_if([$1], [v7], + [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of `-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi +done +rm -rf conftest.dir + +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +AC_MSG_RESULT([$am_cv_prog_tar_$1])]) +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + diff --git a/config.guess b/config.guess new file mode 100755 index 0000000..5145e35 --- /dev/null +++ b/config.guess @@ -0,0 +1,1363 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002 Free Software Foundation, Inc. + +timestamp='2002-10-21' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Per Bothner . +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# The plan is that this can be called by configure scripts if you +# don't specify an explicit build system type. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +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 0 ;; + --version | -v ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# This shell variable is my proudest work .. or something. --bje + +set_cc_for_build='tmpdir=${TMPDIR-/tmp}/config-guess-$$ ; +(old=`umask` && umask 077 && mkdir $tmpdir && umask $old && unset old) + || (echo "$me: cannot create $tmpdir" >&2 && exit 1) ; +dummy=$tmpdir/dummy ; +files="$dummy.c $dummy.o $dummy.rel $dummy" ; +trap '"'"'rm -f $files; rmdir $tmpdir; exit 1'"'"' 1 2 15 ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + rm -f $files ; + 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 ; +unset files' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep __ELF__ >/dev/null + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit 0 ;; + amiga:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + arc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + hp300:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mac68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + macppc:OpenBSD:*:*) + echo powerpc-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme88k:OpenBSD:*:*) + echo m88k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvmeppc:OpenBSD:*:*) + echo powerpc-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + pmax:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sgi:OpenBSD:*:*) + echo mipseb-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sun3:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + wgrisc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + *:OpenBSD:*:*) + echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + alpha:OSF1:*:*) + if test $UNAME_RELEASE = "V4.0"; then + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + fi + # 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. + eval $set_cc_for_build + cat <$dummy.s + .data +\$Lformat: + .byte 37,100,45,37,120,10,0 # "%d-%x\n" + + .text + .globl main + .align 4 + .ent main +main: + .frame \$30,16,\$26,0 + ldgp \$29,0(\$27) + .prologue 1 + .long 0x47e03d80 # implver \$0 + lda \$2,-1 + .long 0x47e20c21 # amask \$2,\$1 + lda \$16,\$Lformat + mov \$0,\$17 + not \$1,\$18 + jsr \$26,printf + ldgp \$29,0(\$26) + mov 0,\$16 + jsr \$26,exit + .end main +EOF + $CC_FOR_BUILD -o $dummy $dummy.s 2>/dev/null + if test "$?" = 0 ; then + case `$dummy` in + 0-0) + UNAME_MACHINE="alpha" + ;; + 1-0) + UNAME_MACHINE="alphaev5" + ;; + 1-1) + UNAME_MACHINE="alphaev56" + ;; + 1-101) + UNAME_MACHINE="alphapca56" + ;; + 2-303) + UNAME_MACHINE="alphaev6" + ;; + 2-307) + UNAME_MACHINE="alphaev67" + ;; + 2-1307) + UNAME_MACHINE="alphaev68" + ;; + 3-1307) + UNAME_MACHINE="alphaev7" + ;; + esac + fi + rm -f $dummy.s $dummy && rmdir $tmpdir + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit 0 ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit 0 ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit 0 ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit 0;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit 0 ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit 0 ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit 0 ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit 0;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit 0;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit 0 ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit 0 ;; + DRS?6000:UNIX_SV:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7 && exit 0 ;; + esac ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + i86pc:SunOS:5.*:*) + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit 0 ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit 0 ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit 0 ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit 0 ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit 0 ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit 0 ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit 0 ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit 0 ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit 0 ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit 0 ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c \ + && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ + && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 + rm -f $dummy.c $dummy && rmdir $tmpdir + echo mips-mips-riscos${UNAME_RELEASE} + exit 0 ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit 0 ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit 0 ;; + Night_Hawk:*:*:PowerMAX_OS) + echo powerpc-harris-powermax + exit 0 ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit 0 ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit 0 ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit 0 ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit 0 ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit 0 ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit 0 ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit 0 ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit 0 ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit 0 ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit 0 ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit 0 ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit 0 ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 + rm -f $dummy.c $dummy && rmdir $tmpdir + echo rs6000-ibm-aix3.2.5 + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit 0 ;; + *:AIX:*:[45]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit 0 ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit 0 ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit 0 ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit 0 ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit 0 ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit 0 ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit 0 ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit 0 ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi + rm -f $dummy.c $dummy && rmdir $tmpdir + fi ;; + esac + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit 0 ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit 0 ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 + rm -f $dummy.c $dummy && rmdir $tmpdir + echo unknown-hitachi-hiuxwe2 + exit 0 ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit 0 ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit 0 ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit 0 ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit 0 ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit 0 ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit 0 ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit 0 ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit 0 ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit 0 ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit 0 ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit 0 ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + 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 0 ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*T3D:*:*:*) + echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit 0 ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit 0 ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:FreeBSD:*:*) + # Determine whether the default compiler uses glibc. + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #if __GLIBC__ >= 2 + LIBC=gnu + #else + LIBC= + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` + rm -f $dummy.c && rmdir $tmpdir + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} + exit 0 ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit 0 ;; + i*:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit 0 ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit 0 ;; + x86:Interix*:3*) + echo i386-pc-interix3 + exit 0 ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i386-pc-interix + exit 0 ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit 0 ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit 0 ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + *:GNU:*:*) + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit 0 ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit 0 ;; + arm*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + mips:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips + #undef mipsel + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mipsel + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + rm -f $dummy.c && rmdir $tmpdir + test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0 + ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit 0 ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit 0 ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit 0 ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit 0 ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit 0 ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit 0 ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit 0 ;; + i*86:Linux:*:*) + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + # Set LC_ALL=C to ensure ld outputs messages in English. + ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ + | sed -ne '/supported targets:/!d + s/[ ][ ]*/ /g + s/.*supported targets: *// + s/ .*// + p'` + case "$ld_supported_targets" in + elf32-i386) + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" + ;; + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit 0 ;; + coff-i386) + echo "${UNAME_MACHINE}-pc-linux-gnucoff" + exit 0 ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + exit 0 ;; + esac + # Determine whether the default compiler is a.out or elf + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #ifdef __ELF__ + # ifdef __GLIBC__ + # if __GLIBC__ >= 2 + LIBC=gnu + # else + LIBC=gnulibc1 + # endif + # else + LIBC=gnulibc1 + # endif + #else + #ifdef __INTEL_COMPILER + LIBC=gnu + #else + LIBC=gnuaout + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` + rm -f $dummy.c && rmdir $tmpdir + test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 + test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 + ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit 0 ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit 0 ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit 0 ;; + i*86:*:5:[78]*) + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit 0 ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit 0 ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit 0 ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i386. + echo i386-pc-msdosdjgpp + exit 0 ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit 0 ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit 0 ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit 0 ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit 0 ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit 0 ;; + M68*:*:R3V[567]*:*) + test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; + 3[34]??:*: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) + 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 0 + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4 && exit 0 ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit 0 ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit 0 ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit 0 ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit 0 ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit 0 ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit 0 ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit 0 ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit 0 ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit 0 ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit 0 ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit 0 ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit 0 ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit 0 ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit 0 ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit 0 ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit 0 ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Darwin:*:*) + echo `uname -p`-apple-darwin${UNAME_RELEASE} + exit 0 ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit 0 ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit 0 ;; + NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit 0 ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit 0 ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit 0 ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit 0 ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit 0 ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit 0 ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit 0 ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit 0 ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit 0 ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit 0 ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit 0 ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit 0 ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit 0 ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit 0 ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 +rm -f $dummy.c $dummy && rmdir $tmpdir + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit 0 ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + c34*) + echo c34-convex-bsd + exit 0 ;; + c38*) + echo c38-convex-bsd + exit 0 ;; + c4*) + echo c4-convex-bsd + exit 0 ;; + esac +fi + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/config.h.in b/config.h.in new file mode 100644 index 0000000..cd948ca --- /dev/null +++ b/config.h.in @@ -0,0 +1,58 @@ +/* config.h.in. Generated from configure.in by autoheader. */ + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDBOOL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the 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 header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Version number of package */ +#undef VERSION diff --git a/config.sub b/config.sub new file mode 100755 index 0000000..1dea9b7 --- /dev/null +++ b/config.sub @@ -0,0 +1,1470 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002 Free Software Foundation, Inc. + +timestamp='2002-09-05' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +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 0 ;; + --version | -v ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit 0;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | freebsd*-gnu* | storm-chaos* | os2-emx* | windows32-* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis) + os= + basic_machine=$1 + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ + | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k \ + | m32r | m68000 | m68k | m88k | mcore \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64vr | mips64vrel \ + | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mipsisa32 | mipsisa32el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | ns16k | ns32k \ + | openrisc | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | sh | sh[1234] | sh3e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ + | strongarm \ + | tahoe | thumb | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xscale | xstormy16 | xtensa \ + | z8k) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* \ + | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* \ + | clipper-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* \ + | m32r-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | mcore-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39 | mipstx39el \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | sh-* | sh[1234]-* | sh3e-* | sh[34]eb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ + | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* | tic30-* | tic4x-* | tic54x-* | tic80-* | tron-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ + | xtensa-* \ + | ymp-* \ + | z8k-*) + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + crds | unos) + basic_machine=m68k-crds + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + mmix*) + basic_machine=mmix-knuth + os=-mmixware + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + or32 | or32-*) + basic_machine=or32-unknown + os=-coff + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2) + basic_machine=i686-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3d) + basic_machine=alpha-cray + os=-unicos + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tic4x | c4x*) + basic_machine=tic4x-unknown + os=-coff + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + windows32) + basic_machine=i386-pc + os=-windows32-msvcrt + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh3 | sh4 | sh3eb | sh4eb | sh[1234]le | sh3ele) + basic_machine=sh-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparc | sparcv9 | sparcv9b) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ + | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* | -powermax*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto*) + os=-nto-qnx + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-ibm) + os=-aix + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/configure b/configure new file mode 100755 index 0000000..c876d6f --- /dev/null +++ b/configure @@ -0,0 +1,21652 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.61. +# +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + fi +done + +# Required to use basename. +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 + + +# Name of the executable. +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# CDPATH. +$as_unset CDPATH + + +if test "x$CONFIG_SHELL" = x; then + if (eval ":") 2>/dev/null; then + as_have_required=yes +else + as_have_required=no +fi + + if test $as_have_required = yes && (eval ": +(as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=\$LINENO + as_lineno_2=\$LINENO + test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && + test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } +") 2> /dev/null; then + : +else + as_candidate_shells= + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + case $as_dir in + /*) + for as_base in sh bash ksh sh5; do + as_candidate_shells="$as_candidate_shells $as_dir/$as_base" + done;; + esac +done +IFS=$as_save_IFS + + + for as_shell in $as_candidate_shells $SHELL; do + # Try only shells that exist, to save several forks. + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { ("$as_shell") 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +_ASEOF +}; then + CONFIG_SHELL=$as_shell + as_have_required=yes + if { "$as_shell" 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +(as_func_return () { + (exit $1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = "$1" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test $exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } + +_ASEOF +}; then + break +fi + +fi + + done + + if test "x$CONFIG_SHELL" != x; then + for as_var in BASH_ENV ENV + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + + if test $as_have_required = no; then + echo This script requires a shell more modern than all the + echo shells that I found on your system. Please install a + echo modern shell, or manually run the script under such a + echo shell if you do have one. + { (exit 1); exit 1; } +fi + + +fi + +fi + + + +(eval "as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0") || { + echo No shell found that supports shell functions. + echo Please tell autoconf@gnu.org about your system, + echo including any error possibly output before this + echo message +} + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # scripts with optimization help from Paolo Bonzini. 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" || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; +esac + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +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 +fi +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +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=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + + + +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','` + ;; +esac + +echo=${ECHO-echo} +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then + # Yippee, $echo works! + : +else + # Restart under the correct shell. + exec $SHELL "$0" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat </dev/null 2>&1 && unset CDPATH + +if test -z "$ECHO"; then +if test "X${echo_test_string+set}" != Xset; then +# find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if (echo_test_string=`eval $cmd`) 2>/dev/null && + echo_test_string=`eval $cmd` && + (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null + then + break + fi + done +fi + +if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : +else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$echo" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + echo='print -r' + elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} + else + # Try using printf. + echo='printf %s\n' + if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + echo="$CONFIG_SHELL $0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + echo="$CONFIG_SHELL $0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do + if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "$0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} + else + # Oops. We lost completely, so just stick with echo. + echo=echo + fi + fi + fi + fi +fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +ECHO=$echo +if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then + ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" +fi + + + + +tagnames=${tagnames+${tagnames},}CXX + +tagnames=${tagnames+${tagnames},}F77 + +exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= + +ac_unique_file="configure.in" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='SHELL +PATH_SEPARATOR +PACKAGE_NAME +PACKAGE_TARNAME +PACKAGE_VERSION +PACKAGE_STRING +PACKAGE_BUGREPORT +exec_prefix +prefix +program_transform_name +bindir +sbindir +libexecdir +datarootdir +datadir +sysconfdir +sharedstatedir +localstatedir +includedir +oldincludedir +docdir +infodir +htmldir +dvidir +pdfdir +psdir +libdir +localedir +mandir +DEFS +ECHO_C +ECHO_N +ECHO_T +LIBS +build_alias +host_alias +target_alias +INSTALL_PROGRAM +INSTALL_SCRIPT +INSTALL_DATA +am__isrc +CYGPATH_W +PACKAGE +VERSION +ACLOCAL +AUTOCONF +AUTOMAKE +AUTOHEADER +MAKEINFO +install_sh +STRIP +INSTALL_STRIP_PROGRAM +mkdir_p +AWK +SET_MAKE +am__leading_dot +AMTAR +am__tar +am__untar +CC +CFLAGS +LDFLAGS +CPPFLAGS +ac_ct_CC +EXEEXT +OBJEXT +DEPDIR +am__include +am__quote +AMDEP_TRUE +AMDEP_FALSE +AMDEPBACKSLASH +CCDEPMODE +am__fastdepCC_TRUE +am__fastdepCC_FALSE +CPP +GREP +EGREP +build +build_cpu +build_vendor +build_os +host +host_cpu +host_vendor +host_os +SED +LN_S +ECHO +AR +RANLIB +CXX +CXXFLAGS +ac_ct_CXX +CXXDEPMODE +am__fastdepCXX_TRUE +am__fastdepCXX_FALSE +CXXCPP +F77 +FFLAGS +ac_ct_F77 +LIBTOOL +LIBOBJS +LTLIBOBJS' +ac_subst_files='' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP +CXX +CXXFLAGS +CCC +CXXCPP +F77 +FFLAGS' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE}' +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=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` + eval enable_$ac_feature=no ;; + + -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_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` + eval enable_$ac_feature=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` + eval with_$ac_package=\$ac_optarg ;; + + -without-* | --without-*) + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` + eval with_$ac_package=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +# Be sure to have absolute directory names. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; } +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + { echo "$as_me: error: Working directory cannot be determined" >&2 + { (exit 1); exit 1; }; } +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + { echo "$as_me: error: pwd does not report name of working directory" >&2 + { (exit 1); exit 1; }; } + + +# 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 -- "$0" || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X"$0" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 + { (exit 1); exit 1; }; } + 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 this package to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] + --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 + + cat <<\_ACEOF + +Optional Features: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + --enable-shared[=PKGS] build shared libraries [default=yes] + --enable-static[=PKGS] build static libraries [default=yes] + --enable-fast-install[=PKGS] + optimize for fast installation [default=yes] + --disable-libtool-lock avoid locking (might break parallel builds) + +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-pic try to use only PIC/non-PIC objects [default=use + both] + --with-tags[=TAGS] include additional configurations [automatic] + +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 C/C++/Objective C preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + CXX C++ compiler command + CXXFLAGS C++ compiler flags + CXXCPP C++ preprocessor + F77 Fortran 77 compiler command + FFLAGS Fortran 77 compiler flags + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +_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" || continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +configure +generated by GNU Autoconf 2.61 + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006 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 +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 $as_me, which was +generated by GNU Autoconf 2.61. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + echo "PATH: $as_dir" +done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$ac_configure_args1 '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + ac_configure_args="$ac_configure_args '$ac_arg'" + ;; + esac + done +done +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + cat <<\_ASBOX +## ---------------- ## +## Cache variables. ## +## ---------------- ## +_ASBOX + 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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_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 + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------------- ## +## File substitutions. ## +## ------------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); 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 + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer explicitly selected file to automatically selected ones. +if test -n "$CONFIG_SITE"; then + set x "$CONFIG_SITE" +elif test "x$prefix" != xNONE; then + set x "$prefix/share/config.site" "$prefix/etc/config.site" +else + set x "$ac_default_prefix/share/config.site" \ + "$ac_default_prefix/etc/config.site" +fi +shift +for ac_site_file +do + if test -r "$ac_site_file"; then + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $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,) + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } +fi + + + + + + + + + + + + + + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +ac_config_headers="$ac_config_headers config.h" + +am__api_version='1.10' + +ac_aux_dir= +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 +echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} + { (exit 1); exit 1; }; } +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done +IFS=$as_save_IFS + + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ echo "$as_me:$LINENO: checking whether build environment is sane" >&5 +echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; } +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&5 +echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&2;} + { (exit 1); exit 1; }; } + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! +Check your system clock" >&5 +echo "$as_me: error: newly created file is older than distributed files! +Check your system clock" >&2;} + { (exit 1); exit 1; }; } +fi +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. echo might interpret backslashes. +# By default was `s,x,x', remove it if useless. +cat <<\_ACEOF >conftest.sed +s/[\\$]/&&/g;s/;s,x,x,$// +_ACEOF +program_transform_name=`echo $program_transform_name | sed -f conftest.sed` +rm -f conftest.sed + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 +echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +{ echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 +echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } +if test -z "$MKDIR_P"; then + if test "${ac_cv_path_mkdir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done +done +IFS=$as_save_IFS + +fi + + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + test -d ./--version && rmdir ./--version + MKDIR_P="$ac_install_sh -d" + fi +fi +{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5 +echo "${ECHO_T}$MKDIR_P" >&6; } + +mkdir_p="$MKDIR_P" +case $mkdir_p in + [\\/$]* | ?:[\\/]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_AWK+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AWK="$ac_prog" + echo "$as_me:$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 + { echo "$as_me:$LINENO: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } +set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + SET_MAKE= +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 +echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} + { (exit 1); exit 1; }; } + fi +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=sunifdef + VERSION=3.1.3 + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} + +# 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 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + echo "$as_me:$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 + { echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}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 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + echo "$as_me:$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 + { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&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" + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. + +AMTAR=${AMTAR-"${am_missing_run}tar"} + +am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' + + + + + +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 +echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi + + +{ echo "$as_me:$LINENO: result: $_am_result" >&5 +echo "${ECHO_T}$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$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 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$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 + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&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 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$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 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + echo "$as_me:$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 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.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 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$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 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.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 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$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 + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO: checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -V >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +# +# List of possible output files, starting from the most likely. +# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) +# only as a last resort. b.out is created by i960 compilers. +ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' +# +# The IRIX 6 linker writes into existing files which may not be +# executable, retaining their permissions. Remove them first so a +# subsequent execution test works. +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; 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 | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi + +{ echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6; } +if test -z "$ac_file"; then + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } +fi + +ac_exeext=$ac_cv_exeext + +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:$LINENO: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + +rm -f a.out a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6; } + +{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest$ac_cv_exeext +{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; 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 ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_compiler_gnu=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + CFLAGS="" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_c89=$ac_arg +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6; } ;; + xno) + { echo "$as_me:$LINENO: result: unsupported" >&5 +echo "${ECHO_T}unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; +esac + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +depcc="$CC" am_compiler_list= + +{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + 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 + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + 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 + ;; + none) break ;; + esac + # 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. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} 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 sub/conftest.${OBJEXT-o} 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 +{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi + +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi + +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi + +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi + +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Extract the first word of "grep ggrep" to use in msg output +if test -z "$GREP"; then +set dummy grep ggrep; ac_prog_name=$2 +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_path_GREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + # Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'GREP' >> "conftest.nl" + "$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 + ac_count=`expr $ac_count + 1` + 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 + + +fi + +GREP="$ac_cv_path_GREP" +if test -z "$GREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi + +else + ac_cv_path_GREP=$GREP +fi + + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +echo "${ECHO_T}$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + # Extract the first word of "egrep" to use in msg output +if test -z "$EGREP"; then +set dummy egrep; ac_prog_name=$2 +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_path_EGREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + # Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + 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 + + +fi + +EGREP="$ac_cv_path_EGREP" +if test -z "$EGREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi + +else + ac_cv_path_EGREP=$EGREP +fi + + + fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_header_stdc=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. + + + + + + + + + +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_Header=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + +for ac_header in stdbool.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +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 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$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 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$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 + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&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 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$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 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + echo "$as_me:$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 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.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 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$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 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.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 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$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 + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO: checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -V >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_compiler_gnu=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + CFLAGS="" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_c89=$ac_arg +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6; } ;; + xno) + { echo "$as_me:$LINENO: result: unsupported" >&5 +echo "${ECHO_T}unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; +esac + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +depcc="$CC" am_compiler_list= + +{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + 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 + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + 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 + ;; + none) break ;; + esac + # 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. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} 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 sub/conftest.${OBJEXT-o} 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 +{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +echo "${ECHO_T}$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 + + +# Check whether --enable-shared was given. +if test "${enable_shared+set}" = set; then + enableval=$enable_shared; p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_shared=yes +fi + + +# Check whether --enable-static was given. +if test "${enable_static+set}" = set; then + enableval=$enable_static; p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_static=yes +fi + + +# Check whether --enable-fast-install was given. +if test "${enable_fast_install+set}" = set; then + enableval=$enable_fast_install; p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_fast_install=yes +fi + + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 +echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} + { (exit 1); exit 1; }; } + +{ echo "$as_me:$LINENO: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6; } +if test "${ac_cv_build+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_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 && + { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 +echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + { (exit 1); exit 1; }; } +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 +echo "$as_me: error: invalid value of canonical build" >&2;} + { (exit 1); exit 1; }; };; +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 + + +{ echo "$as_me:$LINENO: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6; } +if test "${ac_cv_host+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + 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` || + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} + { (exit 1); exit 1; }; } +fi + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 +echo "$as_me: error: invalid value of canonical host" >&2;} + { (exit 1); exit 1; }; };; +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 + + +{ echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 +echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6; } +if test "${lt_cv_path_SED+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$lt_ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$lt_ac_prog$ac_exec_ext"; }; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +IFS=$as_save_IFS +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done + +fi + +SED=$lt_cv_path_SED + +{ echo "$as_me:$LINENO: result: $SED" >&5 +echo "${ECHO_T}$SED" >&6; } + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { echo "$as_me:$LINENO: checking for ld used by $CC" >&5 +echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { echo "$as_me:$LINENO: checking for GNU ld" >&5 +echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } +else + { echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; } +fi +if test "${lt_cv_path_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +echo "${ECHO_T}$LD" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi +test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 +echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} + { (exit 1); exit 1; }; } +{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; } +if test "${lt_cv_prog_gnu_ld+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + +{ echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 +echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6; } +if test "${lt_cv_ld_reload_flag+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_ld_reload_flag='-r' +fi +{ echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 +echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6; } +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + +{ echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 +echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6; } +if test "${lt_cv_path_NM+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm +fi +fi +{ echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 +echo "${ECHO_T}$lt_cv_path_NM" >&6; } +NM="$lt_cv_path_NM" + +{ echo "$as_me:$LINENO: checking whether ln -s works" >&5 +echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +else + { echo "$as_me:$LINENO: result: no, using $LN_S" >&5 +echo "${ECHO_T}no, using $LN_S" >&6; } +fi + +{ echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5 +echo $ECHO_N "checking how to recognize dependent libraries... $ECHO_C" >&6; } +if test "${lt_cv_deplibs_check_method+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# `unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# which responds to the $file_magic_cmd with a given extended regex. +# If you have `file' or equivalent on your system and you're not sure +# whether `pass_all' will *always* work, you probably want this one. + +case $host_os in +aix4* | aix5*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi[45]*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; + +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump', + # unless we find 'file', for example because we are cross-compiling. + if ( file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[3-9]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux* | k*bsd*-gnu) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +nto-qnx*) + lt_cv_deplibs_check_method=unknown + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +{ echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 +echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6; } +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + +# Check whether --enable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then + enableval=$enable_libtool_lock; +fi + +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '#line 5708 "configure"' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + libsuff=64 + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + { echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 +echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6; } +if test "${lt_cv_cc_needs_belf+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + lt_cv_cc_needs_belf=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + lt_cv_cc_needs_belf=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi +{ echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 +echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6; } + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) LD="${LD-ld} -64" ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + + +esac + +need_locks="$enable_libtool_lock" + + + +for ac_header in dlfcn.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { echo "$as_me:$LINENO: result: $CXX" >&5 +echo "${ECHO_T}$CXX" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 +echo "${ECHO_T}$ac_ct_CXX" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$ac_ct_CXX" && break +done + + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi +fi + + fi +fi +# Provide some information about the compiler. +echo "$as_me:$LINENO: checking for C++ compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -V >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +{ echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6; } +if test "${ac_cv_cxx_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_compiler_gnu=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6; } +GXX=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +{ echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 +echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6; } +if test "${ac_cv_prog_cxx_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cxx_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + CXXFLAGS="" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cxx_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6; } +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +depcc="$CXX" am_compiler_list= + +{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } +if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CXX_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + 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 + ;; + none) break ;; + esac + # 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. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} 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 sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CXX_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CXX_dependencies_compiler_type=none +fi + +fi +{ echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6; } +CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then + am__fastdepCXX_TRUE= + am__fastdepCXX_FALSE='#' +else + am__fastdepCXX_TRUE='#' + am__fastdepCXX_FALSE= +fi + + + + +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +{ echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 +echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6; } +if test -z "$CXXCPP"; then + if test "${ac_cv_prog_CXXCPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CXXCPP needs to be expanded + for CXXCPP in "$CXX -E" "/lib/cpp" + do + ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi + +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi + +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CXXCPP=$CXXCPP + +fi + CXXCPP=$ac_cv_prog_CXXCPP +else + ac_cv_prog_CXXCPP=$CXXCPP +fi +{ echo "$as_me:$LINENO: result: $CXXCPP" >&5 +echo "${ECHO_T}$CXXCPP" >&6; } +ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi + +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi + +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +fi + + +ac_ext=f +ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' +ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_f77_compiler_gnu +if test -n "$ac_tool_prefix"; then + for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$F77"; then + ac_cv_prog_F77="$F77" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_F77="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +F77=$ac_cv_prog_F77 +if test -n "$F77"; then + { echo "$as_me:$LINENO: result: $F77" >&5 +echo "${ECHO_T}$F77" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$F77" && break + done +fi +if test -z "$F77"; then + ac_ct_F77=$F77 + for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_F77"; then + ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_F77="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_F77=$ac_cv_prog_ac_ct_F77 +if test -n "$ac_ct_F77"; then + { echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 +echo "${ECHO_T}$ac_ct_F77" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$ac_ct_F77" && break +done + + if test "x$ac_ct_F77" = x; then + F77="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + F77=$ac_ct_F77 + fi +fi + + +# Provide some information about the compiler. +echo "$as_me:$LINENO: checking for Fortran 77 compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -V >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +rm -f a.out + +# If we don't use `.F' as extension, the preprocessor is not run on the +# input file. (Note that this only needs to work for GNU compilers.) +ac_save_ext=$ac_ext +ac_ext=F +{ echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6; } +if test "${ac_cv_f77_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF + program main +#ifndef __GNUC__ + choke me +#endif + + end +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_f77_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_compiler_gnu=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_f77_compiler_gnu=$ac_compiler_gnu + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6; } +ac_ext=$ac_save_ext +ac_test_FFLAGS=${FFLAGS+set} +ac_save_FFLAGS=$FFLAGS +FFLAGS= +{ echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 +echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6; } +if test "${ac_cv_prog_f77_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + FFLAGS=-g +cat >conftest.$ac_ext <<_ACEOF + program main + + end +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_f77_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_f77_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_prog_f77_g=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 +echo "${ECHO_T}$ac_cv_prog_f77_g" >&6; } +if test "$ac_test_FFLAGS" = set; then + FFLAGS=$ac_save_FFLAGS +elif test $ac_cv_prog_f77_g = yes; then + if test "x$ac_cv_f77_compiler_gnu" = xyes; then + FFLAGS="-g -O2" + else + FFLAGS="-g" + fi +else + if test "x$ac_cv_f77_compiler_gnu" = xyes; then + FFLAGS="-O2" + else + FFLAGS= + fi +fi + +G77=`test $ac_compiler_gnu = yes && echo yes` +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! + +# find the maximum length of command line arguments +{ echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 +echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6; } +if test "${lt_cv_sys_max_cmd_len+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \ + = "XX$teststring") >/dev/null 2>&1 && + new_result=`expr "X$teststring" : ".*" 2>&1` && + lt_cv_sys_max_cmd_len=$new_result && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + teststring= + # Add a significant safety factor because C++ compilers can tack on massive + # amounts of additional arguments before passing them to the linker. + # It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac + +fi + +if test -n $lt_cv_sys_max_cmd_len ; then + { echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 +echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6; } +else + { echo "$as_me:$LINENO: result: none" >&5 +echo "${ECHO_T}none" >&6; } +fi + + + + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +{ echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 +echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6; } +if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[BCDEGRST]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([_A-Za-z][_A-Za-z0-9]*\)' + +# Transform an extracted symbol line into a proper C declaration +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32*) + symcode='[ABCDGISTW]' + ;; +hpux*) # Its linker distinguishes data from code symbols + if test "$host_cpu" = ia64; then + symcode='[ABCDEGRST]' + fi + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + ;; +linux* | k*bsd*-gnu) + if test "$host_cpu" = ia64; then + symcode='[ABCDGIRSTW]' + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[ABCDGIRSTW]' ;; +esac + +# Try without a prefix undercore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 + (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if grep ' nm_test_var$' "$nlist" >/dev/null; then + if grep ' nm_test_func$' "$nlist" >/dev/null; then + cat < conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif + +EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' + + cat <> conftest.$ac_ext +#if defined (__STDC__) && __STDC__ +# define lt_ptr_t void * +#else +# define lt_ptr_t char * +# define const +#endif + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + lt_ptr_t address; +} +lt_preloaded_symbols[] = +{ +EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext + cat <<\EOF >> conftest.$ac_ext + {0, (lt_ptr_t) 0} +}; + +#ifdef __cplusplus +} +#endif +EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -f conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done + +fi + +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + { echo "$as_me:$LINENO: result: failed" >&5 +echo "${ECHO_T}failed" >&6; } +else + { echo "$as_me:$LINENO: result: ok" >&5 +echo "${ECHO_T}ok" >&6; } +fi + +{ echo "$as_me:$LINENO: checking for objdir" >&5 +echo $ECHO_N "checking for objdir... $ECHO_C" >&6; } +if test "${lt_cv_objdir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null +fi +{ echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 +echo "${ECHO_T}$lt_cv_objdir" >&6; } +objdir=$lt_cv_objdir + + + + + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='sed -e 1s/^X//' +sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +# Constants: +rm="rm -f" + +# Global variables: +default_ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a +ltmain="$ac_aux_dir/ltmain.sh" +ofile="$default_ofile" +with_gnu_ld="$lt_cv_prog_gnu_ld" + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { echo "$as_me:$LINENO: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_AR="ar" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 +echo "${ECHO_T}$ac_ct_AR" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +else + AR="$ac_cv_prog_AR" +fi + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + echo "$as_me:$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 + { echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}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 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + echo "$as_me:$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 + { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +test -z "$AS" && AS=as +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$DLLTOOL" && DLLTOOL=dlltool +test -z "$LD" && LD=ld +test -z "$LN_S" && LN_S="ln -s" +test -z "$MAGIC_CMD" && MAGIC_CMD=file +test -z "$NM" && NM=nm +test -z "$SED" && SED=sed +test -z "$OBJDUMP" && OBJDUMP=objdump +test -z "$RANLIB" && RANLIB=: +test -z "$STRIP" && STRIP=: +test -z "$ac_objext" && ac_objext=o + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +# Only perform the check for file, if the check method requires it +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + { echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 +echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6; } +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/${ac_tool_prefix}file; then + lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +echo "${ECHO_T}$MAGIC_CMD" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + { echo "$as_me:$LINENO: checking for file" >&5 +echo $ECHO_N "checking for file... $ECHO_C" >&6; } +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/file; then + lt_cv_path_MAGIC_CMD="$ac_dir/file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +echo "${ECHO_T}$MAGIC_CMD" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +enable_dlopen=no +enable_win32_dll=no + +# Check whether --enable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then + enableval=$enable_libtool_lock; +fi + +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + + +# Check whether --with-pic was given. +if test "${with_pic+set}" = set; then + withval=$with_pic; pic_mode="$withval" +else + pic_mode=default +fi + +test -z "$pic_mode" && pic_mode=default + +# Use C for the default configuration in the libtool script +tagname= +lt_save_CC="$CC" +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +objext=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + + +lt_prog_compiler_no_builtin_flag= + +if test "$GCC" = yes; then + lt_prog_compiler_no_builtin_flag=' -fno-builtin' + + +{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; } +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:7972: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:7976: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $rm conftest* + +fi +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; } + +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +else + : +fi + +fi + +lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= + +{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } + + if test "$GCC" = yes; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + ;; + + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + ;; + + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic='-qnocommon' + lt_prog_compiler_wl='-Wl,' + ;; + esac + ;; + + mingw* | cygwin* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + linux* | k*bsd*-gnu) + case $cc_basename in + icc* | ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + *Sun\ F*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; + esac + ;; + esac + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + rdos*) + lt_prog_compiler_static='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_can_build_shared=no + ;; + + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared=no + ;; + esac + fi + +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic" >&6; } + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + +{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6; } +if test "${lt_prog_compiler_pic_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:8262: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:8266: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works=yes + fi + fi + $rm conftest* + +fi +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6; } + +if test x"$lt_prog_compiler_pic_works" = xyes; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac +else + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no +fi + +fi +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= + ;; + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; +esac + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } +if test "${lt_prog_compiler_static_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_static_works=yes + fi + else + lt_prog_compiler_static_works=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works" >&6; } + +if test x"$lt_prog_compiler_static_works" = xyes; then + : +else + lt_prog_compiler_static= +fi + + +{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } +if test "${lt_cv_prog_compiler_c_o+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:8366: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:8370: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6; } + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6; } + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + +{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } + + runpath_var= + allow_undefined_flag= + enable_shared_with_static_runtimes=no + archive_cmds= + archive_expsym_cmds= + old_archive_From_new_cmds= + old_archive_from_expsyms_cmds= + export_dynamic_flag_spec= + whole_archive_flag_spec= + thread_safe_flag_spec= + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld= + hardcode_libdir_separator= + hardcode_direct=no + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + link_all_deplibs=unknown + hardcode_automatic=no + module_cmds= + module_expsym_cmds= + always_export_symbols=no + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms="_GLOBAL_OFFSET_TABLE_" + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + extract_expsyms_cmds= + # Just being paranoid about ensuring that cc_basename is set. + for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + 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 + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec= + fi + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + cat <&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +EOF + fi + ;; + + amigaos*) + archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + ld_shlibs=no + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + + interix[3-9]*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | k*bsd*-gnu) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + *) + tmp_sharedflag='-shared' ;; + esac + archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test $supports_anon_versioning = yes; then + archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + else + ld_shlibs=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +EOF + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + + if test "$ld_shlibs" = no; then + runpath_var= + hardcode_libdir_flag_spec= + export_dynamic_flag_spec= + whole_archive_flag_spec= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds='' + hardcode_direct=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag=' ${wl}-bernotok' + allow_undefined_flag=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + archive_cmds_need_lc=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + # see comment about different semantics on the GNU ld section + ld_shlibs=no + ;; + + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_From_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes=yes + ;; + + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[012]) + allow_undefined_flag='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + whole_archive_flag_spec='' + link_all_deplibs=yes + if test "$GCC" = yes ; then + output_verbose_link_cmd='echo' + archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' + module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs=no + ;; + esac + fi + ;; + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + freebsd1*) + ld_shlibs=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + export_dynamic_flag_spec='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + + hardcode_direct=yes + export_dynamic_flag_spec='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_libdir_flag_spec_ld='+b $libdir' + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + export_dynamic_flag_spec='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_ld='-rpath $libdir' + fi + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + link_all_deplibs=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + hardcode_shlibpath_var=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + else + ld_shlibs=no + fi + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + hardcode_libdir_separator=: + ;; + + solaris*) + no_undefined_flag=' -z text' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + wlarc='' + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' + fi + ;; + esac + link_all_deplibs=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds='$CC -r -o $output$reload_objs' + hardcode_direct=no + ;; + motorola) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag='${wl}-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='${wl}-z,text' + allow_undefined_flag='${wl}-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + *) + ld_shlibs=no + ;; + esac + fi + +{ echo "$as_me:$LINENO: result: $ld_shlibs" >&5 +echo "${ECHO_T}$ld_shlibs" >&6; } +test "$ld_shlibs" = no && can_build_shared=no + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } + $rm conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc=no + else + archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + { echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 +echo "${ECHO_T}$archive_cmds_need_lc" >&6; } + ;; + esac + fi + ;; +esac + +{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" + +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$lt_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e 's/;/ /g'` + else + lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`echo $lt_tmp_lt_search_path_spec | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[lt_foo]++; } + if (lt_freq[lt_foo] == 1) { print lt_foo; } +}'` + sys_lib_search_path_spec=`echo $lt_search_path_spec` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix[3-9]*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux* | k*bsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6; } +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || \ + test -n "$runpath_var" || \ + test "X$hardcode_automatic" = "Xyes" ; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no && + test "$hardcode_minus_L" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +{ echo "$as_me:$LINENO: result: $hardcode_action" >&5 +echo "${ECHO_T}$hardcode_action" >&6; } + +if test "$hardcode_action" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + +striplib= +old_striplib= +{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 +echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; } +if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + ;; + *) + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + ;; + esac +fi + +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_dl_dlopen=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } +if test $ac_cv_lib_dl_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + *) + { echo "$as_me:$LINENO: checking for shl_load" >&5 +echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; } +if test "${ac_cv_func_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define shl_load to an innocuous variant, in case declares shl_load. + For example, HP-UX 11i declares gettimeofday. */ +#define shl_load innocuous_shl_load + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char shl_load (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef shl_load + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_shl_load || defined __stub___shl_load +choke me +#endif + +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_func_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_func_shl_load=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 +echo "${ECHO_T}$ac_cv_func_shl_load" >&6; } +if test $ac_cv_func_shl_load = yes; then + lt_cv_dlopen="shl_load" +else + { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; } +if test "${ac_cv_lib_dld_shl_load+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_dld_shl_load=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_dld_shl_load=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; } +if test $ac_cv_lib_dld_shl_load = yes; then + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" +else + { echo "$as_me:$LINENO: checking for dlopen" >&5 +echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; } +if test "${ac_cv_func_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define dlopen to an innocuous variant, in case declares dlopen. + For example, HP-UX 11i declares gettimeofday. */ +#define dlopen innocuous_dlopen + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char dlopen (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef dlopen + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_dlopen || defined __stub___dlopen +choke me +#endif + +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_func_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_func_dlopen=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 +echo "${ECHO_T}$ac_cv_func_dlopen" >&6; } +if test $ac_cv_func_dlopen = yes; then + lt_cv_dlopen="dlopen" +else + { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } +if test "${ac_cv_lib_dl_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_dl_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_dl_dlopen=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } +if test $ac_cv_lib_dl_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 +echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; } +if test "${ac_cv_lib_svld_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_svld_dlopen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_svld_dlopen=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; } +if test $ac_cv_lib_svld_dlopen = yes; then + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 +echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; } +if test "${ac_cv_lib_dld_dld_link+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dld_link (); +int +main () +{ +return dld_link (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_dld_dld_link=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_dld_dld_link=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; } +if test $ac_cv_lib_dld_dld_link = yes; then + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 +echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; } +if test "${lt_cv_dlopen_self+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + else + puts (dlerror ()); + + exit (status); +} +EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self" >&6; } + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 +echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; } +if test "${lt_cv_dlopen_self_static+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + else + puts (dlerror ()); + + exit (status); +} +EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; } + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + + +# Report which library types will actually be built +{ echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 +echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: result: $can_build_shared" >&5 +echo "${ECHO_T}$can_build_shared" >&6; } + +{ echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 +echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; } +test "$can_build_shared" = "no" && enable_shared=no + +# On AIX, shared libraries and static libraries use the same namespace, and +# are all built from PIC. +case $host_os in +aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + +aix4* | aix5*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; +esac +{ echo "$as_me:$LINENO: result: $enable_shared" >&5 +echo "${ECHO_T}$enable_shared" >&6; } + +{ echo "$as_me:$LINENO: checking whether to build static libraries" >&5 +echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; } +# Make sure either enable_shared or enable_static is yes. +test "$enable_shared" = yes || enable_static=yes +{ echo "$as_me:$LINENO: result: $enable_static" >&5 +echo "${ECHO_T}$enable_static" >&6; } + +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler \ + CC \ + LD \ + lt_prog_compiler_wl \ + lt_prog_compiler_pic \ + lt_prog_compiler_static \ + lt_prog_compiler_no_builtin_flag \ + export_dynamic_flag_spec \ + thread_safe_flag_spec \ + whole_archive_flag_spec \ + enable_shared_with_static_runtimes \ + old_archive_cmds \ + old_archive_from_new_cmds \ + predep_objects \ + postdep_objects \ + predeps \ + postdeps \ + compiler_lib_search_path \ + archive_cmds \ + archive_expsym_cmds \ + postinstall_cmds \ + postuninstall_cmds \ + old_archive_from_expsyms_cmds \ + allow_undefined_flag \ + no_undefined_flag \ + export_symbols_cmds \ + hardcode_libdir_flag_spec \ + hardcode_libdir_flag_spec_ld \ + hardcode_libdir_separator \ + hardcode_automatic \ + module_cmds \ + module_expsym_cmds \ + lt_cv_prog_compiler_c_o \ + fix_srcfile_path \ + exclude_expsyms \ + include_expsyms; do + + case $var in + old_archive_cmds | \ + old_archive_from_new_cmds | \ + archive_cmds | \ + archive_expsym_cmds | \ + module_cmds | \ + module_expsym_cmds | \ + old_archive_from_expsyms_cmds | \ + export_symbols_cmds | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="${ofile}T" + trap "$rm \"$cfgfile\"; exit 1" 1 2 15 + $rm -f "$cfgfile" + { echo "$as_me:$LINENO: creating $ofile" >&5 +echo "$as_me: creating $ofile" >&6;} + + cat <<__EOF__ >> "$cfgfile" +#! $SHELL + +# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 +# Free Software Foundation, Inc. +# +# This file is part of GNU Libtool: +# Originally by Gordon Matzigkeit , 1996 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="$SED -e 1s/^X//" + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# The names of the tagged configurations supported by this script. +available_tags= + +# ### BEGIN LIBTOOL CONFIG + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# A language-specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU C compiler? +with_gcc=$GCC + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$lt_STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path=$lt_fix_srcfile_path + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms + +# ### END LIBTOOL CONFIG + +__EOF__ + + + case $host_os in + aix3*) + cat <<\EOF >> "$cfgfile" + +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +EOF + ;; + esac + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || \ + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + 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 + +CC="$lt_save_CC" + + +# Check whether --with-tags was given. +if test "${with_tags+set}" = set; then + withval=$with_tags; tagnames="$withval" +fi + + +if test -f "$ltmain" && test -n "$tagnames"; then + if test ! -f "${ofile}"; then + { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5 +echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;} + fi + + if test -z "$LTCC"; then + eval "`$SHELL ${ofile} --config | grep '^LTCC='`" + if test -z "$LTCC"; then + { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5 +echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} + else + { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 +echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} + fi + fi + if test -z "$LTCFLAGS"; then + eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" + fi + + # Extract list of available tagged configurations in $ofile. + # Note that this assumes the entire list is on one line. + available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` + + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for tagname in $tagnames; do + IFS="$lt_save_ifs" + # Check whether tagname contains only valid characters + case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in + "") ;; + *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5 +echo "$as_me: error: invalid tag name: $tagname" >&2;} + { (exit 1); exit 1; }; } + ;; + esac + + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null + then + { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5 +echo "$as_me: error: tag name \"$tagname\" already exists" >&2;} + { (exit 1); exit 1; }; } + fi + + # Update the list of available tags. + if test -n "$tagname"; then + echo appending configuration tag \"$tagname\" to $ofile + + case $tagname in + CXX) + if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + + + +archive_cmds_need_lc_CXX=no +allow_undefined_flag_CXX= +always_export_symbols_CXX=no +archive_expsym_cmds_CXX= +export_dynamic_flag_spec_CXX= +hardcode_direct_CXX=no +hardcode_libdir_flag_spec_CXX= +hardcode_libdir_flag_spec_ld_CXX= +hardcode_libdir_separator_CXX= +hardcode_minus_L_CXX=no +hardcode_shlibpath_var_CXX=unsupported +hardcode_automatic_CXX=no +module_cmds_CXX= +module_expsym_cmds_CXX= +link_all_deplibs_CXX=unknown +old_archive_cmds_CXX=$old_archive_cmds +no_undefined_flag_CXX= +whole_archive_flag_spec_CXX= +enable_shared_with_static_runtimes_CXX=no + +# Dependencies to place before and after the object being linked: +predep_objects_CXX= +postdep_objects_CXX= +predeps_CXX= +postdeps_CXX= +compiler_lib_search_path_CXX= + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +objext_CXX=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(int, char *[]) { return(0); }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_LD=$LD +lt_save_GCC=$GCC +GCC=$GXX +lt_save_with_gnu_ld=$with_gnu_ld +lt_save_path_LD=$lt_cv_path_LD +if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx +else + $as_unset lt_cv_prog_gnu_ld +fi +if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX +else + $as_unset lt_cv_path_LD +fi +test -z "${LDCXX+set}" || LD=$LDCXX +CC=${CXX-"c++"} +compiler=$CC +compiler_CXX=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +# We don't want -fno-exception wen compiling C++ code, so set the +# no_builtin_flag separately +if test "$GXX" = yes; then + lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' +else + lt_prog_compiler_no_builtin_flag_CXX= +fi + +if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { echo "$as_me:$LINENO: checking for ld used by $CC" >&5 +echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { echo "$as_me:$LINENO: checking for GNU ld" >&5 +echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } +else + { echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; } +fi +if test "${lt_cv_path_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +echo "${ECHO_T}$LD" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi +test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 +echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} + { (exit 1); exit 1; }; } +{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; } +if test "${lt_cv_prog_gnu_ld+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ + grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_CXX= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + +else + GXX=no + with_gnu_ld=no + wlarc= +fi + +# PORTME: fill in a description of your system's C++ link characteristics +{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } +ld_shlibs_CXX=yes +case $host_os in + aix3*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds_CXX='' + hardcode_direct_CXX=yes + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + + if test "$GXX" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct_CXX=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L_CXX=yes + hardcode_libdir_flag_spec_CXX='-L$libdir' + hardcode_libdir_separator_CXX= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols_CXX=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag_CXX='-berok' + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" + + archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag_CXX="-z nodefs" + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_CXX=' ${wl}-bernotok' + allow_undefined_flag_CXX=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_CXX='$convenience' + archive_cmds_need_lc_CXX=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_CXX=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs_CXX=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_CXX='-L$libdir' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=no + enable_shared_with_static_runtimes_CXX=yes + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_CXX=no + fi + ;; + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[012]) + allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + archive_cmds_need_lc_CXX=no + hardcode_direct_CXX=no + hardcode_automatic_CXX=yes + hardcode_shlibpath_var_CXX=unsupported + whole_archive_flag_spec_CXX='' + link_all_deplibs_CXX=yes + + if test "$GXX" = yes ; then + lt_int_apple_cc_single_mod=no + output_verbose_link_cmd='echo' + if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then + lt_int_apple_cc_single_mod=yes + fi + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + else + archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + fi + module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' + module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs_CXX=no + ;; + esac + fi + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + freebsd[12]*) + # C++ shared libraries reported to be fairly broken before switch to ELF + ld_shlibs_CXX=no + ;; + freebsd-elf*) + archive_cmds_need_lc_CXX=no + ;; + freebsd* | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + ld_shlibs_CXX=yes + ;; + gnu*) + ;; + hpux9*) + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_CXX=: + export_dynamic_flag_spec_CXX='${wl}-E' + hardcode_direct_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + case $host_cpu in + hppa*64*|ia64*) ;; + *) + export_dynamic_flag_spec_CXX='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + ;; + *) + hardcode_direct_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + interix[3-9]*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' + fi + fi + link_all_deplibs_CXX=yes + ;; + esac + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + ;; + linux* | k*bsd*-gnu) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + + hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc*) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + archive_cmds_need_lc_CXX=no + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC*) + # Portland Group C++ compiler + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' + hardcode_libdir_flag_spec_CXX='-R$libdir' + whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + + # Not sure whether something based on + # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 + # would be better. + output_verbose_link_cmd='echo' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; + esac + ;; + lynxos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + m88k*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + openbsd2*) + # C++ shared libraries are fairly broken + ld_shlibs_CXX=no + ;; + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + export_dynamic_flag_spec_CXX='${wl}-E' + whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd='echo' + else + ld_shlibs_CXX=no + fi + ;; + osf3*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + hardcode_libdir_separator_CXX=: + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' + + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + cxx*) + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + hardcode_libdir_separator_CXX=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + cxx*) + allow_undefined_flag_CXX=' -expect_unresolved \*' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ + $rm $lib.exp' + + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + psos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + archive_cmds_need_lc_CXX=yes + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_shlibpath_var_CXX=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. + # Supported since Solaris 2.6 (maybe 2.5.1?) + whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' + ;; + esac + link_all_deplibs_CXX=yes + + output_verbose_link_cmd='echo' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + no_undefined_flag_CXX=' ${wl}-z ${wl}defs' + if $CC --version | grep -v '^2\.7' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + fi + + hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + ;; + esac + fi + ;; + esac + ;; + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag_CXX='${wl}-z,text' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + # So that behaviour is only enabled if SCOABSPATH is set to a + # non-empty value in the environment. Most likely only useful for + # creating official distributions of packages. + # This is a hack until libtool officially supports absolute path + # names for shared libraries. + no_undefined_flag_CXX='${wl}-z,text' + allow_undefined_flag_CXX='${wl}-z,nodefs' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + export_dynamic_flag_spec_CXX='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + vxworks*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; +esac +{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 +echo "${ECHO_T}$ld_shlibs_CXX" >&6; } +test "$ld_shlibs_CXX" = no && can_build_shared=no + +GCC_CXX="$GXX" +LD_CXX="$LD" + + +cat > conftest.$ac_ext <&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + # The `*' in the case matches for architectures that use `case' in + # $output_verbose_cmd can trigger glob expansion during the loop + # eval without this substitution. + output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"` + + for p in `eval $output_verbose_link_cmd`; do + case $p in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test $p = "-L" \ + || test $p = "-R"; then + prev=$p + continue + else + prev= + fi + + if test "$pre_test_object_deps_done" = no; then + case $p in + -L* | -R*) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$compiler_lib_search_path_CXX"; then + compiler_lib_search_path_CXX="${prev}${p}" + else + compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$postdeps_CXX"; then + postdeps_CXX="${prev}${p}" + else + postdeps_CXX="${postdeps_CXX} ${prev}${p}" + fi + fi + ;; + + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test "$pre_test_object_deps_done" = no; then + if test -z "$predep_objects_CXX"; then + predep_objects_CXX="$p" + else + predep_objects_CXX="$predep_objects_CXX $p" + fi + else + if test -z "$postdep_objects_CXX"; then + postdep_objects_CXX="$p" + else + postdep_objects_CXX="$postdep_objects_CXX $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling CXX test program" +fi + +$rm -f confest.$objext + +# PORTME: override above test on systems where it is broken +case $host_os in +interix[3-9]*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + predep_objects_CXX= + postdep_objects_CXX= + postdeps_CXX= + ;; + +linux*) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + # + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + if test "$solaris_use_stlport4" != yes; then + postdeps_CXX='-library=Cstd -library=Crun' + fi + ;; + esac + ;; + +solaris*) + case $cc_basename in + CC*) + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + # Adding this requires a known-good setup of shared libraries for + # Sun compiler versions before 5.6, else PIC objects from an old + # archive will be linked into the output, leading to subtle bugs. + if test "$solaris_use_stlport4" != yes; then + postdeps_CXX='-library=Cstd -library=Crun' + fi + ;; + esac + ;; +esac + + +case " $postdeps_CXX " in +*" -lc "*) archive_cmds_need_lc_CXX=no ;; +esac + +lt_prog_compiler_wl_CXX= +lt_prog_compiler_pic_CXX= +lt_prog_compiler_static_CXX= + +{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } + + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + fi + ;; + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' + ;; + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | os2* | pw32*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic_CXX='-DDLL_EXPORT' + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_CXX='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + lt_prog_compiler_pic_CXX= + ;; + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_CXX=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + else + case $host_os in + aix4* | aix5*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + else + lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic_CXX='-qnocommon' + lt_prog_compiler_wl_CXX='-Wl,' + ;; + esac + ;; + dgux*) + case $cc_basename in + ec++*) + lt_prog_compiler_pic_CXX='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then + lt_prog_compiler_pic_CXX='+Z' + fi + ;; + aCC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_CXX='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux* | k*bsd*-gnu) + case $cc_basename in + KCC*) + # KAI C++ Compiler + lt_prog_compiler_wl_CXX='--backend -Wl,' + lt_prog_compiler_pic_CXX='-fPIC' + ;; + icpc* | ecpc*) + # Intel C++ + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-static' + ;; + pgCC*) + # Portland Group C++ compiler. + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-fpic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + lt_prog_compiler_wl_CXX='-Qoption ld ' + ;; + esac + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + lt_prog_compiler_pic_CXX='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + lt_prog_compiler_wl_CXX='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + lt_prog_compiler_pic_CXX='-pic' + ;; + cxx*) + # Digital/Compaq C++ + lt_prog_compiler_wl_CXX='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + lt_prog_compiler_wl_CXX='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + lt_prog_compiler_pic_CXX='-pic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + lcc*) + # Lucid + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + lt_prog_compiler_pic_CXX='-KPIC' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + esac + ;; + vxworks*) + ;; + *) + lt_prog_compiler_can_build_shared_CXX=no + ;; + esac + fi + +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6; } + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_CXX"; then + +{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6; } +if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works_CXX=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:13237: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:13241: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works_CXX=yes + fi + fi + $rm conftest* + +fi +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6; } + +if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then + case $lt_prog_compiler_pic_CXX in + "" | " "*) ;; + *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; + esac +else + lt_prog_compiler_pic_CXX= + lt_prog_compiler_can_build_shared_CXX=no +fi + +fi +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_CXX= + ;; + *) + lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" + ;; +esac + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" +{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } +if test "${lt_prog_compiler_static_works_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works_CXX=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_static_works_CXX=yes + fi + else + lt_prog_compiler_static_works_CXX=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_CXX" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works_CXX" >&6; } + +if test x"$lt_prog_compiler_static_works_CXX" = xyes; then + : +else + lt_prog_compiler_static_CXX= +fi + + +{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } +if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o_CXX=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:13341: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:13345: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_CXX=yes + fi + fi + chmod u+w . 2>&5 + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6; } + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6; } + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + +{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } + + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + case $host_os in + aix4* | aix5*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + export_symbols_cmds_CXX="$ltdll_cmds" + ;; + cygwin* | mingw*) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;/^.*[ ]__nm__/s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac + +{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 +echo "${ECHO_T}$ld_shlibs_CXX" >&6; } +test "$ld_shlibs_CXX" = no && can_build_shared=no + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_CXX" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_CXX=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds_CXX in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } + $rm conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_CXX + pic_flag=$lt_prog_compiler_pic_CXX + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_CXX + allow_undefined_flag_CXX= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc_CXX=no + else + archive_cmds_need_lc_CXX=yes + fi + allow_undefined_flag_CXX=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 +echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6; } + ;; + esac + fi + ;; +esac + +{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" + +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix[3-9]*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux* | k*bsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6; } +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } +hardcode_action_CXX= +if test -n "$hardcode_libdir_flag_spec_CXX" || \ + test -n "$runpath_var_CXX" || \ + test "X$hardcode_automatic_CXX" = "Xyes" ; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct_CXX" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no && + test "$hardcode_minus_L_CXX" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action_CXX=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_CXX=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_CXX=unsupported +fi +{ echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 +echo "${ECHO_T}$hardcode_action_CXX" >&6; } + +if test "$hardcode_action_CXX" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_CXX \ + CC_CXX \ + LD_CXX \ + lt_prog_compiler_wl_CXX \ + lt_prog_compiler_pic_CXX \ + lt_prog_compiler_static_CXX \ + lt_prog_compiler_no_builtin_flag_CXX \ + export_dynamic_flag_spec_CXX \ + thread_safe_flag_spec_CXX \ + whole_archive_flag_spec_CXX \ + enable_shared_with_static_runtimes_CXX \ + old_archive_cmds_CXX \ + old_archive_from_new_cmds_CXX \ + predep_objects_CXX \ + postdep_objects_CXX \ + predeps_CXX \ + postdeps_CXX \ + compiler_lib_search_path_CXX \ + archive_cmds_CXX \ + archive_expsym_cmds_CXX \ + postinstall_cmds_CXX \ + postuninstall_cmds_CXX \ + old_archive_from_expsyms_cmds_CXX \ + allow_undefined_flag_CXX \ + no_undefined_flag_CXX \ + export_symbols_cmds_CXX \ + hardcode_libdir_flag_spec_CXX \ + hardcode_libdir_flag_spec_ld_CXX \ + hardcode_libdir_separator_CXX \ + hardcode_automatic_CXX \ + module_cmds_CXX \ + module_expsym_cmds_CXX \ + lt_cv_prog_compiler_c_o_CXX \ + fix_srcfile_path_CXX \ + exclude_expsyms_CXX \ + include_expsyms_CXX; do + + case $var in + old_archive_cmds_CXX | \ + old_archive_from_new_cmds_CXX | \ + archive_cmds_CXX | \ + archive_expsym_cmds_CXX | \ + module_cmds_CXX | \ + module_expsym_cmds_CXX | \ + old_archive_from_expsyms_cmds_CXX | \ + export_symbols_cmds_CXX | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="$ofile" + + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_CXX + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# A language-specific compiler. +CC=$lt_compiler_CXX + +# Is the compiler the GNU C compiler? +with_gcc=$GCC_CXX + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD_CXX + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$lt_STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_CXX + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_CXX +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_CXX + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds_CXX +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds_CXX +archive_expsym_cmds=$lt_archive_expsym_cmds_CXX +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_CXX +module_expsym_cmds=$lt_module_expsym_cmds_CXX + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects_CXX + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects_CXX + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_CXX + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_CXX + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_CXX + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_CXX + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_CXX + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_CXX + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_CXX + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_CXX + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic_CXX + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_CXX + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path=$lt_fix_srcfile_path + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_CXX + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_CXX + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_CXX + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_CXX + +# ### END LIBTOOL TAG CONFIG: $tagname + +__EOF__ + + +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + 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 + +CC=$lt_save_CC +LDCXX=$LD +LD=$lt_save_LD +GCC=$lt_save_GCC +with_gnu_ldcxx=$with_gnu_ld +with_gnu_ld=$lt_save_with_gnu_ld +lt_cv_path_LDCXX=$lt_cv_path_LD +lt_cv_path_LD=$lt_save_path_LD +lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld +lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld + + else + tagname="" + fi + ;; + + F77) + if test -n "$F77" && test "X$F77" != "Xno"; then + +ac_ext=f +ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' +ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_f77_compiler_gnu + + +archive_cmds_need_lc_F77=no +allow_undefined_flag_F77= +always_export_symbols_F77=no +archive_expsym_cmds_F77= +export_dynamic_flag_spec_F77= +hardcode_direct_F77=no +hardcode_libdir_flag_spec_F77= +hardcode_libdir_flag_spec_ld_F77= +hardcode_libdir_separator_F77= +hardcode_minus_L_F77=no +hardcode_automatic_F77=no +module_cmds_F77= +module_expsym_cmds_F77= +link_all_deplibs_F77=unknown +old_archive_cmds_F77=$old_archive_cmds +no_undefined_flag_F77= +whole_archive_flag_spec_F77= +enable_shared_with_static_runtimes_F77=no + +# Source file extension for f77 test sources. +ac_ext=f + +# Object file extension for compiled f77 test sources. +objext=o +objext_F77=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="\ + subroutine t + return + end +" + +# Code to be used in simple link tests +lt_simple_link_test_code="\ + program t + end +" + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${F77-"f77"} +compiler=$CC +compiler_F77=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +{ echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 +echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: result: $can_build_shared" >&5 +echo "${ECHO_T}$can_build_shared" >&6; } + +{ echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 +echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; } +test "$can_build_shared" = "no" && enable_shared=no + +# On AIX, shared libraries and static libraries use the same namespace, and +# are all built from PIC. +case $host_os in +aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; +aix4* | aix5*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; +esac +{ echo "$as_me:$LINENO: result: $enable_shared" >&5 +echo "${ECHO_T}$enable_shared" >&6; } + +{ echo "$as_me:$LINENO: checking whether to build static libraries" >&5 +echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; } +# Make sure either enable_shared or enable_static is yes. +test "$enable_shared" = yes || enable_static=yes +{ echo "$as_me:$LINENO: result: $enable_static" >&5 +echo "${ECHO_T}$enable_static" >&6; } + +GCC_F77="$G77" +LD_F77="$LD" + +lt_prog_compiler_wl_F77= +lt_prog_compiler_pic_F77= +lt_prog_compiler_static_F77= + +{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } + + if test "$GCC" = yes; then + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_static_F77='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_F77='-Bstatic' + fi + ;; + + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4' + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic_F77='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_F77='-fno-common' + ;; + + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared_F77=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_F77=-Kconform_pic + fi + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_F77='-fPIC' + ;; + esac + ;; + + *) + lt_prog_compiler_pic_F77='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl_F77='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_F77='-Bstatic' + else + lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp' + fi + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic_F77='-qnocommon' + lt_prog_compiler_wl_F77='-Wl,' + ;; + esac + ;; + + mingw* | cygwin* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_F77='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl_F77='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_F77='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static_F77='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl_F77='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static_F77='-non_shared' + ;; + + newsos6) + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + linux* | k*bsd*-gnu) + case $cc_basename in + icc* | ecc*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-fpic' + lt_prog_compiler_static_F77='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl_F77='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static_F77='-non_shared' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + lt_prog_compiler_wl_F77='-Wl,' + ;; + *Sun\ F*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + lt_prog_compiler_wl_F77='' + ;; + esac + ;; + esac + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl_F77='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static_F77='-non_shared' + ;; + + rdos*) + lt_prog_compiler_static_F77='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + lt_prog_compiler_wl_F77='-Qoption ld ';; + *) + lt_prog_compiler_wl_F77='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl_F77='-Qoption ld ' + lt_prog_compiler_pic_F77='-PIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic_F77='-Kconform_pic' + lt_prog_compiler_static_F77='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_can_build_shared_F77=no + ;; + + uts4*) + lt_prog_compiler_pic_F77='-pic' + lt_prog_compiler_static_F77='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared_F77=no + ;; + esac + fi + +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6; } + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_F77"; then + +{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6; } +if test "${lt_prog_compiler_pic_works_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works_F77=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_F77" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:14905: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:14909: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works_F77=yes + fi + fi + $rm conftest* + +fi +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6; } + +if test x"$lt_prog_compiler_pic_works_F77" = xyes; then + case $lt_prog_compiler_pic_F77 in + "" | " "*) ;; + *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; + esac +else + lt_prog_compiler_pic_F77= + lt_prog_compiler_can_build_shared_F77=no +fi + +fi +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_F77= + ;; + *) + lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77" + ;; +esac + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\" +{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } +if test "${lt_prog_compiler_static_works_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works_F77=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_static_works_F77=yes + fi + else + lt_prog_compiler_static_works_F77=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_F77" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works_F77" >&6; } + +if test x"$lt_prog_compiler_static_works_F77" = xyes; then + : +else + lt_prog_compiler_static_F77= +fi + + +{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } +if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o_F77=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:15009: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:15013: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_F77=yes + fi + fi + chmod u+w . 2>&5 + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6; } + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6; } + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + +{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } + + runpath_var= + allow_undefined_flag_F77= + enable_shared_with_static_runtimes_F77=no + archive_cmds_F77= + archive_expsym_cmds_F77= + old_archive_From_new_cmds_F77= + old_archive_from_expsyms_cmds_F77= + export_dynamic_flag_spec_F77= + whole_archive_flag_spec_F77= + thread_safe_flag_spec_F77= + hardcode_libdir_flag_spec_F77= + hardcode_libdir_flag_spec_ld_F77= + hardcode_libdir_separator_F77= + hardcode_direct_F77=no + hardcode_minus_L_F77=no + hardcode_shlibpath_var_F77=unsupported + link_all_deplibs_F77=unknown + hardcode_automatic_F77=no + module_cmds_F77= + module_expsym_cmds_F77= + always_export_symbols_F77=no + export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms_F77= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_" + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + extract_expsyms_cmds= + # Just being paranoid about ensuring that cc_basename is set. + for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs_F77=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_F77='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_F77= + fi + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs_F77=no + cat <&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +EOF + fi + ;; + + amigaos*) + archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_minus_L_F77=yes + + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + ld_shlibs_F77=no + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_F77=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs_F77=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_F77='-L$libdir' + allow_undefined_flag_F77=unsupported + always_export_symbols_F77=no + enable_shared_with_static_runtimes_F77=yes + export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_F77=no + fi + ;; + + interix[3-9]*) + hardcode_direct_F77=no + hardcode_shlibpath_var_F77=no + hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' + export_dynamic_flag_spec_F77='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_F77='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | k*bsd*-gnu) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + whole_archive_flag_spec_F77='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + *) + tmp_sharedflag='-shared' ;; + esac + archive_cmds_F77='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test $supports_anon_versioning = yes; then + archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + else + ld_shlibs_F77=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs_F77=no + cat <&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +EOF + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_F77=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs_F77=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' + else + ld_shlibs_F77=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_F77=no + fi + ;; + esac + + if test "$ld_shlibs_F77" = no; then + runpath_var= + hardcode_libdir_flag_spec_F77= + export_dynamic_flag_spec_F77= + whole_archive_flag_spec_F77= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag_F77=unsupported + always_export_symbols_F77=yes + archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L_F77=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct_F77=unsupported + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds_F77='' + hardcode_direct_F77=yes + hardcode_libdir_separator_F77=':' + link_all_deplibs_F77=yes + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct_F77=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L_F77=yes + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_libdir_separator_F77= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols_F77=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag_F77='-berok' + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF + program main + + end +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_f77_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag_F77="-z nodefs" + archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF + program main + + end +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_f77_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_F77=' ${wl}-bernotok' + allow_undefined_flag_F77=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_F77='$convenience' + archive_cmds_need_lc_F77=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_minus_L_F77=yes + # see comment about different semantics on the GNU ld section + ld_shlibs_F77=no + ;; + + bsdi[45]*) + export_dynamic_flag_spec_F77=-rdynamic + ;; + + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec_F77=' ' + allow_undefined_flag_F77=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_From_new_cmds_F77='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds_F77='lib -OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path_F77='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes_F77=yes + ;; + + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[012]) + allow_undefined_flag_F77='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + archive_cmds_need_lc_F77=no + hardcode_direct_F77=no + hardcode_automatic_F77=yes + hardcode_shlibpath_var_F77=unsupported + whole_archive_flag_spec_F77='' + link_all_deplibs_F77=yes + if test "$GCC" = yes ; then + output_verbose_link_cmd='echo' + archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' + module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs_F77=no + ;; + esac + fi + ;; + + dgux*) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_shlibpath_var_F77=no + ;; + + freebsd1*) + ld_shlibs_F77=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=yes + hardcode_minus_L_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_F77=: + hardcode_direct_F77=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_F77=yes + export_dynamic_flag_spec_F77='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_F77=: + + hardcode_direct_F77=yes + export_dynamic_flag_spec_F77='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_F77=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_F77=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_libdir_flag_spec_ld_F77='+b $libdir' + hardcode_direct_F77=no + hardcode_shlibpath_var_F77=no + ;; + *) + hardcode_direct_F77=yes + export_dynamic_flag_spec_F77='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_F77=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_ld_F77='-rpath $libdir' + fi + hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_F77=: + link_all_deplibs_F77=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + newsos6) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=yes + hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_F77=: + hardcode_shlibpath_var_F77=no + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' + export_dynamic_flag_spec_F77='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_F77='-R$libdir' + ;; + *) + archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' + ;; + esac + fi + else + ld_shlibs_F77=no + fi + ;; + + os2*) + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_minus_L_F77=yes + allow_undefined_flag_F77=unsupported + archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag_F77=' -expect_unresolved \*' + archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_F77=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag_F77=' -expect_unresolved \*' + archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec_F77='-rpath $libdir' + fi + hardcode_libdir_separator_F77=: + ;; + + solaris*) + no_undefined_flag_F77=' -z text' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + wlarc='' + archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + fi + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_shlibpath_var_F77=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + whole_archive_flag_spec_F77='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' + fi + ;; + esac + link_all_deplibs_F77=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_direct_F77=yes + hardcode_minus_L_F77=yes + hardcode_shlibpath_var_F77=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds_F77='$CC -r -o $output$reload_objs' + hardcode_direct_F77=no + ;; + motorola) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var_F77=no + ;; + + sysv4.3*) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_F77=no + export_dynamic_flag_spec_F77='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_F77=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs_F77=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag_F77='${wl}-z,text' + archive_cmds_need_lc_F77=no + hardcode_shlibpath_var_F77=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag_F77='${wl}-z,text' + allow_undefined_flag_F77='${wl}-z,nodefs' + archive_cmds_need_lc_F77=no + hardcode_shlibpath_var_F77=no + hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator_F77=':' + link_all_deplibs_F77=yes + export_dynamic_flag_spec_F77='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds_F77='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_F77='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_shlibpath_var_F77=no + ;; + + *) + ld_shlibs_F77=no + ;; + esac + fi + +{ echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 +echo "${ECHO_T}$ld_shlibs_F77" >&6; } +test "$ld_shlibs_F77" = no && can_build_shared=no + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_F77" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_F77=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds_F77 in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } + $rm conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_F77 + pic_flag=$lt_prog_compiler_pic_F77 + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_F77 + allow_undefined_flag_F77= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc_F77=no + else + archive_cmds_need_lc_F77=yes + fi + allow_undefined_flag_F77=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 +echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6; } + ;; + esac + fi + ;; +esac + +{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" + +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix[3-9]*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux* | k*bsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6; } +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } +hardcode_action_F77= +if test -n "$hardcode_libdir_flag_spec_F77" || \ + test -n "$runpath_var_F77" || \ + test "X$hardcode_automatic_F77" = "Xyes" ; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct_F77" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no && + test "$hardcode_minus_L_F77" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action_F77=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_F77=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_F77=unsupported +fi +{ echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 +echo "${ECHO_T}$hardcode_action_F77" >&6; } + +if test "$hardcode_action_F77" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_F77 \ + CC_F77 \ + LD_F77 \ + lt_prog_compiler_wl_F77 \ + lt_prog_compiler_pic_F77 \ + lt_prog_compiler_static_F77 \ + lt_prog_compiler_no_builtin_flag_F77 \ + export_dynamic_flag_spec_F77 \ + thread_safe_flag_spec_F77 \ + whole_archive_flag_spec_F77 \ + enable_shared_with_static_runtimes_F77 \ + old_archive_cmds_F77 \ + old_archive_from_new_cmds_F77 \ + predep_objects_F77 \ + postdep_objects_F77 \ + predeps_F77 \ + postdeps_F77 \ + compiler_lib_search_path_F77 \ + archive_cmds_F77 \ + archive_expsym_cmds_F77 \ + postinstall_cmds_F77 \ + postuninstall_cmds_F77 \ + old_archive_from_expsyms_cmds_F77 \ + allow_undefined_flag_F77 \ + no_undefined_flag_F77 \ + export_symbols_cmds_F77 \ + hardcode_libdir_flag_spec_F77 \ + hardcode_libdir_flag_spec_ld_F77 \ + hardcode_libdir_separator_F77 \ + hardcode_automatic_F77 \ + module_cmds_F77 \ + module_expsym_cmds_F77 \ + lt_cv_prog_compiler_c_o_F77 \ + fix_srcfile_path_F77 \ + exclude_expsyms_F77 \ + include_expsyms_F77; do + + case $var in + old_archive_cmds_F77 | \ + old_archive_from_new_cmds_F77 | \ + archive_cmds_F77 | \ + archive_expsym_cmds_F77 | \ + module_cmds_F77 | \ + module_expsym_cmds_F77 | \ + old_archive_from_expsyms_cmds_F77 | \ + export_symbols_cmds_F77 | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="$ofile" + + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_F77 + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77 + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# A language-specific compiler. +CC=$lt_compiler_F77 + +# Is the compiler the GNU C compiler? +with_gcc=$GCC_F77 + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD_F77 + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$lt_STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_F77 + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_F77 +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77 + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_F77 + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77 + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77 + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77 + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds_F77 +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77 + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77 + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds_F77 +archive_expsym_cmds=$lt_archive_expsym_cmds_F77 +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_F77 +module_expsym_cmds=$lt_module_expsym_cmds_F77 + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects_F77 + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects_F77 + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_F77 + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_F77 + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_F77 + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_F77 + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_F77 + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_F77 + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77 + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77 + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77 + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_F77 + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_F77 + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_F77 + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic_F77 + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_F77 + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path=$lt_fix_srcfile_path + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_F77 + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_F77 + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_F77 + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_F77 + +# ### END LIBTOOL TAG CONFIG: $tagname + +__EOF__ + + +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + 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 + +CC="$lt_save_CC" + + else + tagname="" + fi + ;; + + GCJ) + if test -n "$GCJ" && test "X$GCJ" != "Xno"; then + + +# Source file extension for Java test sources. +ac_ext=java + +# Object file extension for compiled Java test sources. +objext=o +objext_GCJ=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="class foo {}" + +# Code to be used in simple link tests +lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${GCJ-"gcj"} +compiler=$CC +compiler_GCJ=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +# GCJ did not exist at the time GCC didn't implicitly link libc in. +archive_cmds_need_lc_GCJ=no + +old_archive_cmds_GCJ=$old_archive_cmds + + +lt_prog_compiler_no_builtin_flag_GCJ= + +if test "$GCC" = yes; then + lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin' + + +{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; } +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:17198: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:17202: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $rm conftest* + +fi +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; } + +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions" +else + : +fi + +fi + +lt_prog_compiler_wl_GCJ= +lt_prog_compiler_pic_GCJ= +lt_prog_compiler_static_GCJ= + +{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } + + if test "$GCC" = yes; then + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_static_GCJ='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_GCJ='-Bstatic' + fi + ;; + + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4' + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_GCJ='-fno-common' + ;; + + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared_GCJ=no + enable_shared=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_GCJ=-Kconform_pic + fi + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_GCJ='-fPIC' + ;; + esac + ;; + + *) + lt_prog_compiler_pic_GCJ='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl_GCJ='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_GCJ='-Bstatic' + else + lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp' + fi + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic_GCJ='-qnocommon' + lt_prog_compiler_wl_GCJ='-Wl,' + ;; + esac + ;; + + mingw* | cygwin* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl_GCJ='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_GCJ='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl_GCJ='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static_GCJ='-non_shared' + ;; + + newsos6) + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + linux* | k*bsd*-gnu) + case $cc_basename in + icc* | ecc*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-fpic' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl_GCJ='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static_GCJ='-non_shared' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + lt_prog_compiler_wl_GCJ='-Wl,' + ;; + *Sun\ F*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + lt_prog_compiler_wl_GCJ='' + ;; + esac + ;; + esac + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl_GCJ='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static_GCJ='-non_shared' + ;; + + rdos*) + lt_prog_compiler_static_GCJ='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + lt_prog_compiler_wl_GCJ='-Qoption ld ';; + *) + lt_prog_compiler_wl_GCJ='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl_GCJ='-Qoption ld ' + lt_prog_compiler_pic_GCJ='-PIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic_GCJ='-Kconform_pic' + lt_prog_compiler_static_GCJ='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_can_build_shared_GCJ=no + ;; + + uts4*) + lt_prog_compiler_pic_GCJ='-pic' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared_GCJ=no + ;; + esac + fi + +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6; } + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_GCJ"; then + +{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6; } +if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works_GCJ=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_GCJ" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:17488: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:17492: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works_GCJ=yes + fi + fi + $rm conftest* + +fi +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6; } + +if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then + case $lt_prog_compiler_pic_GCJ in + "" | " "*) ;; + *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;; + esac +else + lt_prog_compiler_pic_GCJ= + lt_prog_compiler_can_build_shared_GCJ=no +fi + +fi +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_GCJ= + ;; + *) + lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ" + ;; +esac + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\" +{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } +if test "${lt_prog_compiler_static_works_GCJ+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works_GCJ=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_static_works_GCJ=yes + fi + else + lt_prog_compiler_static_works_GCJ=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_GCJ" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works_GCJ" >&6; } + +if test x"$lt_prog_compiler_static_works_GCJ" = xyes; then + : +else + lt_prog_compiler_static_GCJ= +fi + + +{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } +if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o_GCJ=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:17592: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:17596: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_GCJ=yes + fi + fi + chmod u+w . 2>&5 + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6; } + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6; } + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + +{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } + + runpath_var= + allow_undefined_flag_GCJ= + enable_shared_with_static_runtimes_GCJ=no + archive_cmds_GCJ= + archive_expsym_cmds_GCJ= + old_archive_From_new_cmds_GCJ= + old_archive_from_expsyms_cmds_GCJ= + export_dynamic_flag_spec_GCJ= + whole_archive_flag_spec_GCJ= + thread_safe_flag_spec_GCJ= + hardcode_libdir_flag_spec_GCJ= + hardcode_libdir_flag_spec_ld_GCJ= + hardcode_libdir_separator_GCJ= + hardcode_direct_GCJ=no + hardcode_minus_L_GCJ=no + hardcode_shlibpath_var_GCJ=unsupported + link_all_deplibs_GCJ=unknown + hardcode_automatic_GCJ=no + module_cmds_GCJ= + module_expsym_cmds_GCJ= + always_export_symbols_GCJ=no + export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms_GCJ= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_" + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + extract_expsyms_cmds= + # Just being paranoid about ensuring that cc_basename is set. + for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs_GCJ=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_GCJ='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_GCJ= + fi + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs_GCJ=no + cat <&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +EOF + fi + ;; + + amigaos*) + archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_minus_L_GCJ=yes + + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + ld_shlibs_GCJ=no + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_GCJ=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_GCJ='-L$libdir' + allow_undefined_flag_GCJ=unsupported + always_export_symbols_GCJ=no + enable_shared_with_static_runtimes_GCJ=yes + export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_GCJ=no + fi + ;; + + interix[3-9]*) + hardcode_direct_GCJ=no + hardcode_shlibpath_var_GCJ=no + hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' + export_dynamic_flag_spec_GCJ='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds_GCJ='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_GCJ='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | k*bsd*-gnu) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + whole_archive_flag_spec_GCJ='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + *) + tmp_sharedflag='-shared' ;; + esac + archive_cmds_GCJ='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test $supports_anon_versioning = yes; then + archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + else + ld_shlibs_GCJ=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs_GCJ=no + cat <&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +EOF + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs_GCJ=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; + esac + + if test "$ld_shlibs_GCJ" = no; then + runpath_var= + hardcode_libdir_flag_spec_GCJ= + export_dynamic_flag_spec_GCJ= + whole_archive_flag_spec_GCJ= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag_GCJ=unsupported + always_export_symbols_GCJ=yes + archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L_GCJ=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct_GCJ=unsupported + fi + ;; + + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds_GCJ='' + hardcode_direct_GCJ=yes + hardcode_libdir_separator_GCJ=':' + link_all_deplibs_GCJ=yes + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct_GCJ=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L_GCJ=yes + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_libdir_separator_GCJ= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols_GCJ=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag_GCJ='-berok' + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag_GCJ="-z nodefs" + archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_GCJ=' ${wl}-bernotok' + allow_undefined_flag_GCJ=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_GCJ='$convenience' + archive_cmds_need_lc_GCJ=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_minus_L_GCJ=yes + # see comment about different semantics on the GNU ld section + ld_shlibs_GCJ=no + ;; + + bsdi[45]*) + export_dynamic_flag_spec_GCJ=-rdynamic + ;; + + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec_GCJ=' ' + allow_undefined_flag_GCJ=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_From_new_cmds_GCJ='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds_GCJ='lib -OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes_GCJ=yes + ;; + + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[012]) + allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + archive_cmds_need_lc_GCJ=no + hardcode_direct_GCJ=no + hardcode_automatic_GCJ=yes + hardcode_shlibpath_var_GCJ=unsupported + whole_archive_flag_spec_GCJ='' + link_all_deplibs_GCJ=yes + if test "$GCC" = yes ; then + output_verbose_link_cmd='echo' + archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' + module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs_GCJ=no + ;; + esac + fi + ;; + + dgux*) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_shlibpath_var_GCJ=no + ;; + + freebsd1*) + ld_shlibs_GCJ=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=yes + hardcode_minus_L_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + hardcode_direct_GCJ=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_GCJ=yes + export_dynamic_flag_spec_GCJ='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + + hardcode_direct_GCJ=yes + export_dynamic_flag_spec_GCJ='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_GCJ=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_libdir_flag_spec_ld_GCJ='+b $libdir' + hardcode_direct_GCJ=no + hardcode_shlibpath_var_GCJ=no + ;; + *) + hardcode_direct_GCJ=yes + export_dynamic_flag_spec_GCJ='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_GCJ=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir' + fi + hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + link_all_deplibs_GCJ=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + newsos6) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=yes + hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + hardcode_shlibpath_var_GCJ=no + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' + export_dynamic_flag_spec_GCJ='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_GCJ='-R$libdir' + ;; + *) + archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' + ;; + esac + fi + else + ld_shlibs_GCJ=no + fi + ;; + + os2*) + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_minus_L_GCJ=yes + allow_undefined_flag_GCJ=unsupported + archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag_GCJ=' -expect_unresolved \*' + archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag_GCJ=' -expect_unresolved \*' + archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec_GCJ='-rpath $libdir' + fi + hardcode_libdir_separator_GCJ=: + ;; + + solaris*) + no_undefined_flag_GCJ=' -z text' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + wlarc='' + archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + fi + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_shlibpath_var_GCJ=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' + fi + ;; + esac + link_all_deplibs_GCJ=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_direct_GCJ=yes + hardcode_minus_L_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds_GCJ='$CC -r -o $output$reload_objs' + hardcode_direct_GCJ=no + ;; + motorola) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var_GCJ=no + ;; + + sysv4.3*) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_GCJ=no + export_dynamic_flag_spec_GCJ='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_GCJ=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs_GCJ=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag_GCJ='${wl}-z,text' + archive_cmds_need_lc_GCJ=no + hardcode_shlibpath_var_GCJ=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds_GCJ='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_GCJ='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag_GCJ='${wl}-z,text' + allow_undefined_flag_GCJ='${wl}-z,nodefs' + archive_cmds_need_lc_GCJ=no + hardcode_shlibpath_var_GCJ=no + hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator_GCJ=':' + link_all_deplibs_GCJ=yes + export_dynamic_flag_spec_GCJ='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds_GCJ='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_GCJ='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_shlibpath_var_GCJ=no + ;; + + *) + ld_shlibs_GCJ=no + ;; + esac + fi + +{ echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 +echo "${ECHO_T}$ld_shlibs_GCJ" >&6; } +test "$ld_shlibs_GCJ" = no && can_build_shared=no + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_GCJ" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_GCJ=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds_GCJ in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } + $rm conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_GCJ + pic_flag=$lt_prog_compiler_pic_GCJ + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ + allow_undefined_flag_GCJ= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc_GCJ=no + else + archive_cmds_need_lc_GCJ=yes + fi + allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 +echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6; } + ;; + esac + fi + ;; +esac + +{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" + +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix[3-9]*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux* | k*bsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6; } +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } +hardcode_action_GCJ= +if test -n "$hardcode_libdir_flag_spec_GCJ" || \ + test -n "$runpath_var_GCJ" || \ + test "X$hardcode_automatic_GCJ" = "Xyes" ; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct_GCJ" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no && + test "$hardcode_minus_L_GCJ" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action_GCJ=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_GCJ=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_GCJ=unsupported +fi +{ echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 +echo "${ECHO_T}$hardcode_action_GCJ" >&6; } + +if test "$hardcode_action_GCJ" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_GCJ \ + CC_GCJ \ + LD_GCJ \ + lt_prog_compiler_wl_GCJ \ + lt_prog_compiler_pic_GCJ \ + lt_prog_compiler_static_GCJ \ + lt_prog_compiler_no_builtin_flag_GCJ \ + export_dynamic_flag_spec_GCJ \ + thread_safe_flag_spec_GCJ \ + whole_archive_flag_spec_GCJ \ + enable_shared_with_static_runtimes_GCJ \ + old_archive_cmds_GCJ \ + old_archive_from_new_cmds_GCJ \ + predep_objects_GCJ \ + postdep_objects_GCJ \ + predeps_GCJ \ + postdeps_GCJ \ + compiler_lib_search_path_GCJ \ + archive_cmds_GCJ \ + archive_expsym_cmds_GCJ \ + postinstall_cmds_GCJ \ + postuninstall_cmds_GCJ \ + old_archive_from_expsyms_cmds_GCJ \ + allow_undefined_flag_GCJ \ + no_undefined_flag_GCJ \ + export_symbols_cmds_GCJ \ + hardcode_libdir_flag_spec_GCJ \ + hardcode_libdir_flag_spec_ld_GCJ \ + hardcode_libdir_separator_GCJ \ + hardcode_automatic_GCJ \ + module_cmds_GCJ \ + module_expsym_cmds_GCJ \ + lt_cv_prog_compiler_c_o_GCJ \ + fix_srcfile_path_GCJ \ + exclude_expsyms_GCJ \ + include_expsyms_GCJ; do + + case $var in + old_archive_cmds_GCJ | \ + old_archive_from_new_cmds_GCJ | \ + archive_cmds_GCJ | \ + archive_expsym_cmds_GCJ | \ + module_cmds_GCJ | \ + module_expsym_cmds_GCJ | \ + old_archive_from_expsyms_cmds_GCJ | \ + export_symbols_cmds_GCJ | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="$ofile" + + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_GCJ + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# A language-specific compiler. +CC=$lt_compiler_GCJ + +# Is the compiler the GNU C compiler? +with_gcc=$GCC_GCJ + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD_GCJ + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$lt_STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_GCJ + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_GCJ +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_GCJ + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds_GCJ +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds_GCJ +archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_GCJ +module_expsym_cmds=$lt_module_expsym_cmds_GCJ + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects_GCJ + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects_GCJ + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_GCJ + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_GCJ + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_GCJ + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_GCJ + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_GCJ + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_GCJ + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_GCJ + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic_GCJ + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_GCJ + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path=$lt_fix_srcfile_path + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_GCJ + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_GCJ + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_GCJ + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_GCJ + +# ### END LIBTOOL TAG CONFIG: $tagname + +__EOF__ + + +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + 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 + +CC="$lt_save_CC" + + else + tagname="" + fi + ;; + + RC) + + +# Source file extension for RC test sources. +ac_ext=rc + +# Object file extension for compiled RC test sources. +objext=o +objext_RC=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' + +# Code to be used in simple link tests +lt_simple_link_test_code="$lt_simple_compile_test_code" + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${RC-"windres"} +compiler=$CC +compiler_RC=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + +lt_cv_prog_compiler_c_o_RC=yes + +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_RC \ + CC_RC \ + LD_RC \ + lt_prog_compiler_wl_RC \ + lt_prog_compiler_pic_RC \ + lt_prog_compiler_static_RC \ + lt_prog_compiler_no_builtin_flag_RC \ + export_dynamic_flag_spec_RC \ + thread_safe_flag_spec_RC \ + whole_archive_flag_spec_RC \ + enable_shared_with_static_runtimes_RC \ + old_archive_cmds_RC \ + old_archive_from_new_cmds_RC \ + predep_objects_RC \ + postdep_objects_RC \ + predeps_RC \ + postdeps_RC \ + compiler_lib_search_path_RC \ + archive_cmds_RC \ + archive_expsym_cmds_RC \ + postinstall_cmds_RC \ + postuninstall_cmds_RC \ + old_archive_from_expsyms_cmds_RC \ + allow_undefined_flag_RC \ + no_undefined_flag_RC \ + export_symbols_cmds_RC \ + hardcode_libdir_flag_spec_RC \ + hardcode_libdir_flag_spec_ld_RC \ + hardcode_libdir_separator_RC \ + hardcode_automatic_RC \ + module_cmds_RC \ + module_expsym_cmds_RC \ + lt_cv_prog_compiler_c_o_RC \ + fix_srcfile_path_RC \ + exclude_expsyms_RC \ + include_expsyms_RC; do + + case $var in + old_archive_cmds_RC | \ + old_archive_from_new_cmds_RC | \ + archive_cmds_RC | \ + archive_expsym_cmds_RC | \ + module_cmds_RC | \ + module_expsym_cmds_RC | \ + old_archive_from_expsyms_cmds_RC | \ + export_symbols_cmds_RC | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + +cfgfile="$ofile" + + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname + +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_RC + +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# A language-specific compiler. +CC=$lt_compiler_RC + +# Is the compiler the GNU C compiler? +with_gcc=$GCC_RC + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD_RC + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$lt_STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_RC + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_RC +pic_mode=$pic_mode + +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_RC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds_RC +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC + +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds_RC +archive_expsym_cmds=$lt_archive_expsym_cmds_RC +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_RC +module_expsym_cmds=$lt_module_expsym_cmds_RC + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=$lt_predep_objects_RC + +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=$lt_postdep_objects_RC + +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_RC + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_RC + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_RC + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_RC + +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_RC + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_RC + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC + +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_RC + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_RC + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_RC + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic_RC + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_RC + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path=$lt_fix_srcfile_path + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_RC + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_RC + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_RC + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_RC + +# ### END LIBTOOL TAG CONFIG: $tagname + +__EOF__ + + +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + 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 + +CC="$lt_save_CC" + + ;; + + *) + { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5 +echo "$as_me: error: Unsupported tag name: $tagname" >&2;} + { (exit 1); exit 1; }; } + ;; + esac + + # Append the new tag name to the list of available tags. + if test -n "$tagname" ; then + available_tags="$available_tags $tagname" + fi + fi + done + IFS="$lt_save_ifs" + + # Now substitute the updated list of available tags. + if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then + mv "${ofile}T" "$ofile" + chmod +x "$ofile" + else + rm -f "${ofile}T" + { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5 +echo "$as_me: error: unable to update list of available tagged configurations." >&2;} + { (exit 1); exit 1; }; } + fi +fi + + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + +# Prevent multiple expansion + + + + + + + + + + + + + + + + + + + + + +ac_config_files="$ac_config_files Makefile src/Makefile man/Makefile test_sunifdef/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_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + test "x$cache_file" != "x/dev/null" && + { echo "$as_me:$LINENO: updating cache $cache_file" >&5 +echo "$as_me: updating cache $cache_file" >&6;} + cat confcache >$cache_file + else + { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +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=`echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi + +: ${CONFIG_STATUS=./config.status} +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + fi +done + +# Required to use basename. +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 + + +# Name of the executable. +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# CDPATH. +$as_unset CDPATH + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # scripts with optimization help from Paolo Bonzini. 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" || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; +esac + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +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 +fi +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +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=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 + +# 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 $as_me, which was +generated by GNU Autoconf 2.61. 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 + +cat >>$CONFIG_STATUS <<_ACEOF +# 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_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +config.status +configured by $0, generated by GNU Autoconf 2.61, + with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" + +Copyright (C) 2006 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' +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + 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 ) + echo "$ac_cs_version"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + { echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) { echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" + 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 +if \$ac_cs_recheck; then + echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + CONFIG_SHELL=$SHELL + export CONFIG_SHELL + exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; + "test_sunifdef/Makefile") CONFIG_FILES="$CONFIG_FILES test_sunifdef/Makefile" ;; + + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason 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= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || +{ + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +# +# Set up the sed scripts for CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "$CONFIG_FILES"; then + +_ACEOF + + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +SHELL!$SHELL$ac_delim +PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim +PACKAGE_NAME!$PACKAGE_NAME$ac_delim +PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim +PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim +PACKAGE_STRING!$PACKAGE_STRING$ac_delim +PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim +exec_prefix!$exec_prefix$ac_delim +prefix!$prefix$ac_delim +program_transform_name!$program_transform_name$ac_delim +bindir!$bindir$ac_delim +sbindir!$sbindir$ac_delim +libexecdir!$libexecdir$ac_delim +datarootdir!$datarootdir$ac_delim +datadir!$datadir$ac_delim +sysconfdir!$sysconfdir$ac_delim +sharedstatedir!$sharedstatedir$ac_delim +localstatedir!$localstatedir$ac_delim +includedir!$includedir$ac_delim +oldincludedir!$oldincludedir$ac_delim +docdir!$docdir$ac_delim +infodir!$infodir$ac_delim +htmldir!$htmldir$ac_delim +dvidir!$dvidir$ac_delim +pdfdir!$pdfdir$ac_delim +psdir!$psdir$ac_delim +libdir!$libdir$ac_delim +localedir!$localedir$ac_delim +mandir!$mandir$ac_delim +DEFS!$DEFS$ac_delim +ECHO_C!$ECHO_C$ac_delim +ECHO_N!$ECHO_N$ac_delim +ECHO_T!$ECHO_T$ac_delim +LIBS!$LIBS$ac_delim +build_alias!$build_alias$ac_delim +host_alias!$host_alias$ac_delim +target_alias!$target_alias$ac_delim +INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim +INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim +INSTALL_DATA!$INSTALL_DATA$ac_delim +am__isrc!$am__isrc$ac_delim +CYGPATH_W!$CYGPATH_W$ac_delim +PACKAGE!$PACKAGE$ac_delim +VERSION!$VERSION$ac_delim +ACLOCAL!$ACLOCAL$ac_delim +AUTOCONF!$AUTOCONF$ac_delim +AUTOMAKE!$AUTOMAKE$ac_delim +AUTOHEADER!$AUTOHEADER$ac_delim +MAKEINFO!$MAKEINFO$ac_delim +install_sh!$install_sh$ac_delim +STRIP!$STRIP$ac_delim +INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim +mkdir_p!$mkdir_p$ac_delim +AWK!$AWK$ac_delim +SET_MAKE!$SET_MAKE$ac_delim +am__leading_dot!$am__leading_dot$ac_delim +AMTAR!$AMTAR$ac_delim +am__tar!$am__tar$ac_delim +am__untar!$am__untar$ac_delim +CC!$CC$ac_delim +CFLAGS!$CFLAGS$ac_delim +LDFLAGS!$LDFLAGS$ac_delim +CPPFLAGS!$CPPFLAGS$ac_delim +ac_ct_CC!$ac_ct_CC$ac_delim +EXEEXT!$EXEEXT$ac_delim +OBJEXT!$OBJEXT$ac_delim +DEPDIR!$DEPDIR$ac_delim +am__include!$am__include$ac_delim +am__quote!$am__quote$ac_delim +AMDEP_TRUE!$AMDEP_TRUE$ac_delim +AMDEP_FALSE!$AMDEP_FALSE$ac_delim +AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim +CCDEPMODE!$CCDEPMODE$ac_delim +am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim +am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim +CPP!$CPP$ac_delim +GREP!$GREP$ac_delim +EGREP!$EGREP$ac_delim +build!$build$ac_delim +build_cpu!$build_cpu$ac_delim +build_vendor!$build_vendor$ac_delim +build_os!$build_os$ac_delim +host!$host$ac_delim +host_cpu!$host_cpu$ac_delim +host_vendor!$host_vendor$ac_delim +host_os!$host_os$ac_delim +SED!$SED$ac_delim +LN_S!$LN_S$ac_delim +ECHO!$ECHO$ac_delim +AR!$AR$ac_delim +RANLIB!$RANLIB$ac_delim +CXX!$CXX$ac_delim +CXXFLAGS!$CXXFLAGS$ac_delim +ac_ct_CXX!$ac_ct_CXX$ac_delim +CXXDEPMODE!$CXXDEPMODE$ac_delim +am__fastdepCXX_TRUE!$am__fastdepCXX_TRUE$ac_delim +am__fastdepCXX_FALSE!$am__fastdepCXX_FALSE$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi + +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +_ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +CEOF$ac_eof +_ACEOF + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +CXXCPP!$CXXCPP$ac_delim +F77!$F77$ac_delim +FFLAGS!$FFLAGS$ac_delim +ac_ct_F77!$ac_ct_F77$ac_delim +LIBTOOL!$LIBTOOL$ac_delim +LIBOBJS!$LIBOBJS$ac_delim +LTLIBOBJS!$LTLIBOBJS$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 7; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi + +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end +_ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +:end +s/|#_!!_#|//g +CEOF$ac_eof +_ACEOF + + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/ +s/:*\${srcdir}:*/:/ +s/:*@srcdir@:*/:/ +s/^\([^=]*=[ ]*\):*/\1/ +s/:*$// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF +fi # test -n "$CONFIG_FILES" + + +for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 +echo "$as_me: error: Invalid tag $ac_tag." >&2;} + { (exit 1); exit 1; }; };; + :[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="$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 || + { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { (exit 1); exit 1; }; };; + esac + ac_file_inputs="$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 "`IFS=: + echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + fi + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin";; + 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 || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir="$ac_dir" + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} + { (exit 1); exit 1; }; }; } + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# 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= + +case `sed -n '/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p +' $ac_file_inputs` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + 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 + sed "$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s&@configure_input@&$configure_input&;t t +s&@top_builddir@&$ac_top_builddir_sub&;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 +" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&5 +echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&2;} + + rm -f "$tmp/stdin" + case $ac_file in + -) cat "$tmp/out"; rm -f "$tmp/out";; + *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; + esac + ;; + :H) + # + # CONFIG_HEADER + # +_ACEOF + +# Transform confdefs.h into a sed script `conftest.defines', that +# substitutes the proper values into config.h.in to produce config.h. +rm -f conftest.defines conftest.tail +# First, append a space to every undef/define line, to ease matching. +echo 's/$/ /' >conftest.defines +# Then, protect against being on the right side of a sed subst, or in +# an unquoted here document, in config.status. If some macros were +# called several times there might be several #defines for the same +# symbol, which is useless. But do not sort them, since the last +# AC_DEFINE must be honored. +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where +# NAME is the cpp macro being defined, VALUE is the value it is being given. +# PARAMS is the parameter list in the macro definition--in most cases, it's +# just an empty string. +ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' +ac_dB='\\)[ (].*,\\1define\\2' +ac_dC=' ' +ac_dD=' ,' + +uniq confdefs.h | + sed -n ' + t rset + :rset + s/^[ ]*#[ ]*define[ ][ ]*// + t ok + d + :ok + s/[\\&,]/\\&/g + s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p + s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p + ' >>conftest.defines + +# Remove the space that was appended to ease matching. +# Then 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. +# (The regexp can be short, since the line contains either #define or #undef.) +echo 's/ $// +s,^[ #]*u.*,/* & */,' >>conftest.defines + +# Break up conftest.defines: +ac_max_sed_lines=50 + +# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" +# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" +# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" +# et cetera. +ac_in='$ac_file_inputs' +ac_out='"$tmp/out1"' +ac_nxt='"$tmp/out2"' + +while : +do + # Write a here document: + cat >>$CONFIG_STATUS <<_ACEOF + # First, check the format of the line: + cat >"\$tmp/defines.sed" <<\\CEOF +/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def +/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def +b +:def +_ACEOF + sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS + echo 'CEOF + sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS + ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in + sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail + grep . conftest.tail >/dev/null || break + rm -f conftest.defines + mv conftest.tail conftest.defines +done +rm -f conftest.defines conftest.tail + +echo "ac_result=$ac_in" >>$CONFIG_STATUS +cat >>$CONFIG_STATUS <<\_ACEOF + if test x"$ac_file" != x-; then + echo "/* $configure_input */" >"$tmp/config.h" + cat "$ac_result" >>"$tmp/config.h" + if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then + { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f $ac_file + mv "$tmp/config.h" $ac_file + fi + else + echo "/* $configure_input */" + cat "$ac_result" + fi + rm -f "$tmp/out12" +# Compute $ac_file's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $ac_file | $ac_file:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $ac_file" >`$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 || +echo X$ac_file | + 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) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 +echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir=$dirpart/$fdir + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} + { (exit 1); exit 1; }; }; } + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done + ;; + + esac +done # for ac_tag + + +{ (exit 0); exit 0; } +_ACEOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi + diff --git a/configure.in b/configure.in new file mode 100644 index 0000000..f925ebe --- /dev/null +++ b/configure.in @@ -0,0 +1,11 @@ +AC_INIT(configure.in) + +AM_CONFIG_HEADER(config.h) +AM_INIT_AUTOMAKE(sunifdef, 3.1.3) +AC_CHECK_HEADERS(stdbool.h) + +AC_LANG_C +AC_PROG_CC +AM_PROG_LIBTOOL + +AC_OUTPUT(Makefile src/Makefile man/Makefile test_sunifdef/Makefile) diff --git a/depcomp b/depcomp new file mode 100755 index 0000000..4c20c6c --- /dev/null +++ b/depcomp @@ -0,0 +1,441 @@ +#! /bin/sh + +# depcomp - compile a program generating dependencies as side-effects +# Copyright 1999, 2000 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# As a special exception 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 . + +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 +# `libtool' can also be set to `yes' or `no'. + +depfile=${depfile-`echo "$object" | sed 's,\([^/]*\)$,.deps/\1,;s/\.\([^.]*\)$/.P\1/'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +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. + "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz +## The second -e expression handles DOS-style file names with drive letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the `deleted header file' problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. + tr ' ' ' +' < "$tmpdepfile" | +## Some versions of gcc put a space before the `:'. On the theory +## that the space means something, we add a space to the output as +## well. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like `#:fec' to the end of the + # dependency line. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ + tr ' +' ' ' >> $depfile + echo >> $depfile + + # The second pass generates a dummy entry for each header file. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> $depfile + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. 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. + stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'` + tmpdepfile="$stripped.u" + outname="$stripped.o" + if test "$libtool" = yes; then + "$@" -Wc,-M + else + "$@" -M + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + + if test -f "$tmpdepfile"; then + # Each line is of the form `foo.o: dependent.h'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" + sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +icc) + # Must come before tru64. + + # Intel's C compiler understands `-MD -MF file'. However + # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c + # will fill foo.d with something like + # foo.o: sub/foo.c + # foo.o: sub/foo.h + # which is wrong. We want: + # sub/foo.o: sub/foo.c + # sub/foo.o: sub/foo.h + # sub/foo.c: + # sub/foo.h: + + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed -e "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + sed -e "s,^[^:]*: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" + rm -f "$tmpdepfile" + ;; + +tru64) + # The Tru64 AIX 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. + + tmpdepfile1="$object.d" + tmpdepfile2=`echo "$object" | sed -e 's/.o$/.d/'` + if test "$libtool" = yes; then + "$@" -Wc,-MD + else + "$@" -MD + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + if test -f "$tmpdepfile1"; then + tmpdepfile="$tmpdepfile1" + else + tmpdepfile="$tmpdepfile2" + fi + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a space and a tab in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +#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 proprocessed file to stdout, regardless of -o, + # because we must use -o when running libtool. + test -z "$dashmflag" && dashmflag=-M + ( IFS=" " + case " $* " in + *" --mode=compile "*) # this is libtool, let us make it quiet + for arg + do # cycle over the arguments + case "$arg" in + "--mode=compile") + # insert --quiet before "--mode=compile" + set fnord "$@" --quiet + shift # fnord + ;; + esac + set fnord "$@" "$arg" + shift # fnord + shift # "$arg" + done + ;; + esac + "$@" $dashmflag | sed 's:^[^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + ) & + proc=$! + "$@" + stat=$? + wait "$proc" + if test "$stat" != 0; then exit $stat; fi + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + tr ' ' ' +' < "$tmpdepfile" | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + # X makedepend + ( + shift + cleared=no + for arg in "$@"; do + case $cleared in no) + set ""; shift + cleared=yes + esac + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift;; + -*) + ;; + *) + set fnord "$@" "$arg"; shift;; + esac + done + obj_suffix="`echo $object | sed 's/^.*\././'`" + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} 2>/dev/null -o"$obj_suffix" -f"$tmpdepfile" "$@" + ) & + proc=$! + "$@" + stat=$? + wait "$proc" + if test "$stat" != 0; then exit $stat; fi + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + tail +3 "$tmpdepfile" | tr ' ' ' +' | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the proprocessed file to stdout, regardless of -o, + # because we must use -o when running libtool. + ( IFS=" " + case " $* " in + *" --mode=compile "*) + for arg + do # cycle over the arguments + case $arg in + "--mode=compile") + # insert --quiet before "--mode=compile" + set fnord "$@" --quiet + shift # fnord + ;; + esac + set fnord "$@" "$arg" + shift # fnord + shift # "$arg" + done + ;; + esac + "$@" -E | + sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | + sed '$ s: \\$::' > "$tmpdepfile" + ) & + proc=$! + "$@" + stat=$? + wait "$proc" + if test "$stat" != 0; then exit $stat; fi + 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 proprocessed file to stdout, regardless of -o, + # because we must use -o when running libtool. + ( IFS=" " + case " $* " in + *" --mode=compile "*) + for arg + do # cycle over the arguments + case $arg in + "--mode=compile") + # insert --quiet before "--mode=compile" + set fnord "$@" --quiet + shift # fnord + ;; + esac + set fnord "$@" "$arg" + shift # fnord + shift # "$arg" + done + ;; + esac + "$@" -E | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" + ) & + proc=$! + "$@" + stat=$? + wait "$proc" + if test "$stat" != 0; then exit $stat; fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" + echo " " >> "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 diff --git a/install-sh b/install-sh new file mode 100755 index 0000000..2137f0f --- /dev/null +++ b/install-sh @@ -0,0 +1,276 @@ +#!/bin/sh +# +# install - install a program, script, or datafile +# This comes from X11R5 (mit/util/scripts/install.sh). +# +# Copyright 1991 by the Massachusetts Institute of Technology +# +# Permission to use, copy, modify, distribute, and sell this software and its +# documentation for any purpose is hereby granted without fee, provided that +# the above copyright notice appear in all copies and that both that +# copyright notice and this permission notice appear in supporting +# documentation, and that the name of M.I.T. not be used in advertising or +# publicity pertaining to distribution of the software without specific, +# written prior permission. M.I.T. makes no representations about the +# suitability of this software for any purpose. It is provided "as is" +# without express or implied warranty. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. It can only install one file at a time, a restriction +# shared with many OS's install programs. + + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" + + +# put in absolute paths if you don't have them in your path; or use env. vars. + +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" +mkdirprog="${MKDIRPROG-mkdir}" + +transformbasename="" +transform_arg="" +instcmd="$mvprog" +chmodcmd="$chmodprog 0755" +chowncmd="" +chgrpcmd="" +stripcmd="" +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src="" +dst="" +dir_arg="" + +while [ x"$1" != x ]; do + case $1 in + -c) instcmd=$cpprog + shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + -s) stripcmd=$stripprog + shift + continue;; + + -t=*) transformarg=`echo $1 | sed 's/-t=//'` + shift + continue;; + + -b=*) transformbasename=`echo $1 | sed 's/-b=//'` + shift + continue;; + + *) if [ x"$src" = x ] + then + src=$1 + else + # this colon is to work around a 386BSD /bin/sh bug + : + dst=$1 + fi + shift + continue;; + esac +done + +if [ x"$src" = x ] +then + echo "$0: no input file specified" >&2 + exit 1 +else + : +fi + +if [ x"$dir_arg" != x ]; then + dst=$src + src="" + + if [ -d "$dst" ]; then + instcmd=: + chmodcmd="" + else + instcmd=$mkdirprog + fi +else + +# Waiting for this to be detected by the "$instcmd $src $dsttmp" command +# might cause directories to be created, which would be especially bad +# if $src (and thus $dsttmp) contains '*'. + + if [ -f "$src" ] || [ -d "$src" ] + then + : + else + echo "$0: $src does not exist" >&2 + exit 1 + fi + + if [ x"$dst" = x ] + then + echo "$0: no destination specified" >&2 + exit 1 + else + : + fi + +# If destination is a directory, append the input filename; if your system +# does not like double slashes in filenames, you may need to add some logic + + if [ -d "$dst" ] + then + dst=$dst/`basename "$src"` + else + : + fi +fi + +## this sed command emulates the dirname command +dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` + +# Make sure that the destination directory exists. +# this part is taken from Noah Friedman's mkinstalldirs script + +# Skip lots of stat calls in the usual case. +if [ ! -d "$dstdir" ]; then +defaultIFS=' + ' +IFS="${IFS-$defaultIFS}" + +oIFS=$IFS +# Some sh's can't handle IFS=/ for some reason. +IFS='%' +set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` +IFS=$oIFS + +pathcomp='' + +while [ $# -ne 0 ] ; do + pathcomp=$pathcomp$1 + shift + + if [ ! -d "$pathcomp" ] ; + then + $mkdirprog "$pathcomp" + else + : + fi + + pathcomp=$pathcomp/ +done +fi + +if [ x"$dir_arg" != x ] +then + $doit $instcmd "$dst" && + + if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dst"; else : ; fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dst"; else : ; fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dst"; else : ; fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dst"; else : ; fi +else + +# If we're going to rename the final executable, determine the name now. + + if [ x"$transformarg" = x ] + then + dstfile=`basename "$dst"` + else + dstfile=`basename "$dst" $transformbasename | + sed $transformarg`$transformbasename + fi + +# don't allow the sed command to completely eliminate the filename + + if [ x"$dstfile" = x ] + then + dstfile=`basename "$dst"` + else + : + fi + +# Make a couple of temp file names in the proper directory. + + dsttmp=$dstdir/#inst.$$# + rmtmp=$dstdir/#rm.$$# + +# Trap to clean up temp files at exit. + + trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0 + trap '(exit $?); exit' 1 2 13 15 + +# Move or copy the file name to the temp name + + $doit $instcmd "$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 $instcmd $src $dsttmp" command. + + if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dsttmp"; else :;fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp"; else :;fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dsttmp"; else :;fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; else :;fi && + +# 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. + +{ + if [ -f "$dstdir/$dstfile" ] + then + $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null || + $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null || + { + echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 + (exit 1); exit + } + else + : + fi +} && + +# Now rename the file to the real destination. + + $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" + +fi && + +# The final little trick to "correctly" pass the exit status to the exit trap. + +{ + (exit 0); exit +} diff --git a/ltmain.sh b/ltmain.sh new file mode 100644 index 0000000..b36e997 --- /dev/null +++ b/ltmain.sh @@ -0,0 +1,6343 @@ +# ltmain.sh - Provide generalized library-building support services. +# NOTE: Changing this file will not affect anything until you rerun configure. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003 +# Free Software Foundation, Inc. +# Originally by Gordon Matzigkeit , 1996 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Check that we have a working $echo. +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then + # Yippee, $echo works! + : +else + # Restart under the correct shell, and then maybe $echo will work. + exec $SHELL "$0" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat <&2 + $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 + exit 1 +fi + +# Global variables. +mode=$default_mode +nonopt= +prev= +prevopt= +run= +show="$echo" +show_help= +execute_dlfiles= +lo2o="s/\\.lo\$/.${objext}/" +o2lo="s/\\.${objext}\$/.lo/" + +##################################### +# Shell function definitions: +# This seems to be the best place for them + +# Need a lot of goo to handle *both* DLLs and import libs +# Has to be a shell function in order to 'eat' the argument +# that is supplied when $file_magic_command is called. +win32_libid () { + win32_libid_type="unknown" + win32_fileres=`file -L $1 2>/dev/null` + case $win32_fileres in + *ar\ archive\ import\ library*) # definitely import + win32_libid_type="x86 archive import" + ;; + *ar\ archive*) # could be an import, or static + if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ + grep -E 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then + win32_nmres=`eval $NM -f posix -A $1 | \ + sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'` + if test "X$win32_nmres" = "Ximport" ; then + win32_libid_type="x86 archive import" + else + win32_libid_type="x86 archive static" + fi + fi + ;; + *DLL*) + win32_libid_type="x86 DLL" + ;; + *executable*) # but shell scripts are "executable" too... + case $win32_fileres in + *MS\ Windows\ PE\ Intel*) + win32_libid_type="x86 DLL" + ;; + esac + ;; + esac + $echo $win32_libid_type +} + +# End of Shell function definitions +##################################### + +# Parse our command line options once, thoroughly. +while test "$#" -gt 0 +do + arg="$1" + shift + + case $arg in + -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; + *) optarg= ;; + esac + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + execute_dlfiles) + execute_dlfiles="$execute_dlfiles $arg" + ;; + tag) + tagname="$arg" + + # Check whether tagname contains only valid characters + case $tagname in + *[!-_A-Za-z0-9,/]*) + $echo "$progname: invalid tag name: $tagname" 1>&2 + exit 1 + ;; + esac + + case $tagname in + CC) + # Don't test for the "default" C tag, as we know, it's there, but + # not specially marked. + ;; + *) + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then + taglist="$taglist $tagname" + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`" + else + $echo "$progname: ignoring unknown tag $tagname" 1>&2 + fi + ;; + esac + ;; + *) + eval "$prev=\$arg" + ;; + esac + + prev= + prevopt= + continue + fi + + # Have we seen a non-optional argument yet? + case $arg in + --help) + show_help=yes + ;; + + --version) + $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" + $echo + $echo "Copyright (C) 2003 Free Software Foundation, Inc." + $echo "This is free software; see the source for copying conditions. There is NO" + $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + exit 0 + ;; + + --config) + ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0 + # Now print the configurations for the tags. + for tagname in $taglist; do + ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0" + done + exit 0 + ;; + + --debug) + $echo "$progname: enabling shell trace mode" + set -x + ;; + + --dry-run | -n) + run=: + ;; + + --features) + $echo "host: $host" + if test "$build_libtool_libs" = yes; then + $echo "enable shared libraries" + else + $echo "disable shared libraries" + fi + if test "$build_old_libs" = yes; then + $echo "enable static libraries" + else + $echo "disable static libraries" + fi + exit 0 + ;; + + --finish) mode="finish" ;; + + --mode) prevopt="--mode" prev=mode ;; + --mode=*) mode="$optarg" ;; + + --preserve-dup-deps) duplicate_deps="yes" ;; + + --quiet | --silent) + show=: + ;; + + --tag) prevopt="--tag" prev=tag ;; + --tag=*) + set tag "$optarg" ${1+"$@"} + shift + prev=tag + ;; + + -dlopen) + prevopt="-dlopen" + prev=execute_dlfiles + ;; + + -*) + $echo "$modename: unrecognized option \`$arg'" 1>&2 + $echo "$help" 1>&2 + exit 1 + ;; + + *) + nonopt="$arg" + break + ;; + esac +done + +if test -n "$prevopt"; then + $echo "$modename: option \`$prevopt' requires an argument" 1>&2 + $echo "$help" 1>&2 + exit 1 +fi + +# If this variable is set in any of the actions, the command in it +# will be execed at the end. This prevents here-documents from being +# left over by shells. +exec_cmd= + +if test -z "$show_help"; then + + # Infer the operation mode. + if test -z "$mode"; then + $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 + $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2 + case $nonopt in + *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) + mode=link + for arg + do + case $arg in + -c) + mode=compile + break + ;; + esac + done + ;; + *db | *dbx | *strace | *truss) + mode=execute + ;; + *install*|cp|mv) + mode=install + ;; + *rm) + mode=uninstall + ;; + *) + # If we have no mode, but dlfiles were specified, then do execute mode. + test -n "$execute_dlfiles" && mode=execute + + # Just use the default operation mode. + if test -z "$mode"; then + if test -n "$nonopt"; then + $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 + else + $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 + fi + fi + ;; + esac + fi + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$execute_dlfiles" && test "$mode" != execute; then + $echo "$modename: unrecognized option \`-dlopen'" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + # Change the help message to a mode-specific one. + generic_help="$help" + help="Try \`$modename --help --mode=$mode' for more information." + + # These modes are in order of execution frequency so that they run quickly. + case $mode in + # libtool compile mode + compile) + modename="$modename: compile" + # Get the compilation command and the source file. + base_compile= + srcfile="$nonopt" # always keep a non-empty value in "srcfile" + suppress_output= + arg_mode=normal + libobj= + + for arg + do + case "$arg_mode" in + arg ) + # do not "continue". Instead, add this to base_compile + lastarg="$arg" + arg_mode=normal + ;; + + target ) + libobj="$arg" + arg_mode=normal + continue + ;; + + normal ) + # Accept any command-line options. + case $arg in + -o) + if test -n "$libobj" ; then + $echo "$modename: you cannot specify \`-o' more than once" 1>&2 + exit 1 + fi + arg_mode=target + continue + ;; + + -static) + build_old_libs=yes + continue + ;; + + -prefer-pic) + pic_mode=yes + continue + ;; + + -prefer-non-pic) + pic_mode=no + continue + ;; + + -Xcompiler) + arg_mode=arg # the next one goes into the "base_compile" arg list + continue # The current "srcfile" will either be retained or + ;; # replaced later. I would guess that would be a bug. + + -Wc,*) + args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` + lastarg= + save_ifs="$IFS"; IFS=',' + for arg in $args; do + IFS="$save_ifs" + + # Double-quote args containing other shell metacharacters. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + lastarg="$lastarg $arg" + done + IFS="$save_ifs" + lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` + + # Add the arguments to base_compile. + base_compile="$base_compile $lastarg" + continue + ;; + + * ) + # Accept the current argument as the source file. + # The previous "srcfile" becomes the current argument. + # + lastarg="$srcfile" + srcfile="$arg" + ;; + esac # case $arg + ;; + esac # case $arg_mode + + # Aesthetically quote the previous argument. + lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` + + case $lastarg in + # Double-quote args containing other shell metacharacters. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + lastarg="\"$lastarg\"" + ;; + esac + + base_compile="$base_compile $lastarg" + done # for arg + + case $arg_mode in + arg) + $echo "$modename: you must specify an argument for -Xcompile" + exit 1 + ;; + target) + $echo "$modename: you must specify a target with \`-o'" 1>&2 + exit 1 + ;; + *) + # Get the name of the library object. + [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` + ;; + esac + + # Recognize several different file suffixes. + # If the user specifies -o file.o, it is replaced with file.lo + xform='[cCFSifmso]' + case $libobj in + *.ada) xform=ada ;; + *.adb) xform=adb ;; + *.ads) xform=ads ;; + *.asm) xform=asm ;; + *.c++) xform=c++ ;; + *.cc) xform=cc ;; + *.ii) xform=ii ;; + *.class) xform=class ;; + *.cpp) xform=cpp ;; + *.cxx) xform=cxx ;; + *.f90) xform=f90 ;; + *.for) xform=for ;; + *.java) xform=java ;; + esac + + libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` + + case $libobj in + *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; + *) + $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 + exit 1 + ;; + esac + + # Infer tagged configuration to use if any are available and + # if one wasn't chosen via the "--tag" command line option. + # Only attempt this if the compiler in the base compile + # command doesn't match the default compiler. + if test -n "$available_tags" && test -z "$tagname"; then + case $base_compile in + # Blanks in the command may have been stripped by the calling shell, + # but not from the CC environment variable when configure was run. + " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "*) ;; + # Blanks at the start of $base_compile will cause this to fail + # if we don't check for them as well. + *) + for z in $available_tags; do + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`" + case "$base_compile " in + "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) + # The compiler in the base compile command matches + # the one in the tagged configuration. + # Assume this is the tagged configuration we want. + tagname=$z + break + ;; + esac + fi + done + # If $tagname still isn't set, then no tagged configuration + # was found and let the user know that the "--tag" command + # line option must be used. + if test -z "$tagname"; then + $echo "$modename: unable to infer tagged configuration" + $echo "$modename: specify a tag with \`--tag'" 1>&2 + exit 1 +# else +# $echo "$modename: using $tagname tagged configuration" + fi + ;; + esac + fi + + objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` + xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$obj"; then + xdir= + else + xdir=$xdir/ + fi + lobj=${xdir}$objdir/$objname + + if test -z "$base_compile"; then + $echo "$modename: you must specify a compilation command" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + # Delete any leftover library objects. + if test "$build_old_libs" = yes; then + removelist="$obj $lobj $libobj ${libobj}T" + else + removelist="$lobj $libobj ${libobj}T" + fi + + $run $rm $removelist + trap "$run $rm $removelist; exit 1" 1 2 15 + + # On Cygwin there's no "real" PIC flag so we must build both object types + case $host_os in + cygwin* | mingw* | pw32* | os2*) + pic_mode=default + ;; + esac + if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then + # non-PIC code in shared libraries is not supported + pic_mode=default + fi + + # Calculate the filename of the output object if compiler does + # not support -o with -c + if test "$compiler_c_o" = no; then + output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} + lockfile="$output_obj.lock" + removelist="$removelist $output_obj $lockfile" + trap "$run $rm $removelist; exit 1" 1 2 15 + else + output_obj= + need_locks=no + lockfile= + fi + + # Lock this critical section if it is needed + # We use this script file to make the link, it avoids creating a new file + if test "$need_locks" = yes; then + until $run ln "$0" "$lockfile" 2>/dev/null; do + $show "Waiting for $lockfile to be removed" + sleep 2 + done + elif test "$need_locks" = warn; then + if test -f "$lockfile"; then + $echo "\ +*** ERROR, $lockfile exists and contains: +`cat $lockfile 2>/dev/null` + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $run $rm $removelist + exit 1 + fi + $echo $srcfile > "$lockfile" + fi + + if test -n "$fix_srcfile_path"; then + eval srcfile=\"$fix_srcfile_path\" + fi + + $run $rm "$libobj" "${libobj}T" + + # Create a libtool object file (analogous to a ".la" file), + # but don't create it if we're doing a dry run. + test -z "$run" && cat > ${libobj}T </dev/null`" != "X$srcfile"; then + $echo "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $run $rm $removelist + exit 1 + fi + + # Just move the object if needed, then go on to compile the next one + if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then + $show "$mv $output_obj $lobj" + if $run $mv $output_obj $lobj; then : + else + error=$? + $run $rm $removelist + exit $error + fi + fi + + # Append the name of the PIC object to the libtool object file. + test -z "$run" && cat >> ${libobj}T <> ${libobj}T </dev/null`" != "X$srcfile"; then + $echo "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $run $rm $removelist + exit 1 + fi + + # Just move the object if needed + if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then + $show "$mv $output_obj $obj" + if $run $mv $output_obj $obj; then : + else + error=$? + $run $rm $removelist + exit $error + fi + fi + + # Append the name of the non-PIC object the libtool object file. + # Only append if the libtool object file exists. + test -z "$run" && cat >> ${libobj}T <> ${libobj}T <&2 + fi + if test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + else + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + fi + build_libtool_libs=no + build_old_libs=yes + prefer_static_libs=yes + break + ;; + esac + done + + # See if our shared archives depend on static archives. + test -n "$old_archive_from_new_cmds" && build_old_libs=yes + + # Go through the arguments, transforming them on the way. + while test "$#" -gt 0; do + arg="$1" + base_compile="$base_compile $arg" + shift + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test + ;; + *) qarg=$arg ;; + esac + libtool_args="$libtool_args $qarg" + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + output) + compile_command="$compile_command @OUTPUT@" + finalize_command="$finalize_command @OUTPUT@" + ;; + esac + + case $prev in + dlfiles|dlprefiles) + if test "$preload" = no; then + # Add the symbol object into the linking commands. + compile_command="$compile_command @SYMFILE@" + finalize_command="$finalize_command @SYMFILE@" + preload=yes + fi + case $arg in + *.la | *.lo) ;; # We handle these cases below. + force) + if test "$dlself" = no; then + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + self) + if test "$prev" = dlprefiles; then + dlself=yes + elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then + dlself=yes + else + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + *) + if test "$prev" = dlfiles; then + dlfiles="$dlfiles $arg" + else + dlprefiles="$dlprefiles $arg" + fi + prev= + continue + ;; + esac + ;; + expsyms) + export_symbols="$arg" + if test ! -f "$arg"; then + $echo "$modename: symbol file \`$arg' does not exist" + exit 1 + fi + prev= + continue + ;; + expsyms_regex) + export_symbols_regex="$arg" + prev= + continue + ;; + inst_prefix) + inst_prefix_dir="$arg" + prev= + continue + ;; + release) + release="-$arg" + prev= + continue + ;; + objectlist) + if test -f "$arg"; then + save_arg=$arg + moreargs= + for fil in `cat $save_arg` + do +# moreargs="$moreargs $fil" + arg=$fil + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + pic_object= + non_pic_object= + + # Read the .lo file + # If there is no directory component, then add one. + case $arg in + */* | *\\*) . $arg ;; + *) . ./$arg ;; + esac + + if test -z "$pic_object" || \ + test -z "$non_pic_object" || + test "$pic_object" = none && \ + test "$non_pic_object" = none; then + $echo "$modename: cannot find name of object for \`$arg'" 1>&2 + exit 1 + fi + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + dlfiles="$dlfiles $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + dlprefiles="$dlprefiles $pic_object" + prev= + fi + + # A PIC object. + libobjs="$libobjs $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + non_pic_objects="$non_pic_objects $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + fi + else + # Only an error if not doing a dry-run. + if test -z "$run"; then + $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 + exit 1 + else + # Dry-run case. + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` + non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` + libobjs="$libobjs $pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + fi + fi + done + else + $echo "$modename: link input file \`$save_arg' does not exist" + exit 1 + fi + arg=$save_arg + prev= + continue + ;; + rpath | xrpath) + # We need an absolute path. + case $arg in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + $echo "$modename: only absolute run-paths are allowed" 1>&2 + exit 1 + ;; + esac + if test "$prev" = rpath; then + case "$rpath " in + *" $arg "*) ;; + *) rpath="$rpath $arg" ;; + esac + else + case "$xrpath " in + *" $arg "*) ;; + *) xrpath="$xrpath $arg" ;; + esac + fi + prev= + continue + ;; + xcompiler) + compiler_flags="$compiler_flags $qarg" + prev= + compile_command="$compile_command $qarg" + finalize_command="$finalize_command $qarg" + continue + ;; + xlinker) + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $wl$qarg" + prev= + compile_command="$compile_command $wl$qarg" + finalize_command="$finalize_command $wl$qarg" + continue + ;; + xcclinker) + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $qarg" + prev= + compile_command="$compile_command $qarg" + finalize_command="$finalize_command $qarg" + continue + ;; + *) + eval "$prev=\"\$arg\"" + prev= + continue + ;; + esac + fi # test -n "$prev" + + prevarg="$arg" + + case $arg in + -all-static) + if test -n "$link_static_flag"; then + compile_command="$compile_command $link_static_flag" + finalize_command="$finalize_command $link_static_flag" + fi + continue + ;; + + -allow-undefined) + # FIXME: remove this flag sometime in the future. + $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 + continue + ;; + + -avoid-version) + avoid_version=yes + continue + ;; + + -dlopen) + prev=dlfiles + continue + ;; + + -dlpreopen) + prev=dlprefiles + continue + ;; + + -export-dynamic) + export_dynamic=yes + continue + ;; + + -export-symbols | -export-symbols-regex) + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + $echo "$modename: more than one -exported-symbols argument is not allowed" + exit 1 + fi + if test "X$arg" = "X-export-symbols"; then + prev=expsyms + else + prev=expsyms_regex + fi + continue + ;; + + -inst-prefix-dir) + prev=inst_prefix + continue + ;; + + # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* + # so, if we see these flags be careful not to treat them like -L + -L[A-Z][A-Z]*:*) + case $with_gcc/$host in + no/*-*-irix* | /*-*-irix*) + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + ;; + esac + continue + ;; + + -L*) + dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 + exit 1 + fi + dir="$absdir" + ;; + esac + case "$deplibs " in + *" -L$dir "*) ;; + *) + deplibs="$deplibs -L$dir" + lib_search_path="$lib_search_path $dir" + ;; + esac + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + case :$dllsearchpath: in + *":$dir:"*) ;; + *) dllsearchpath="$dllsearchpath:$dir";; + esac + ;; + esac + continue + ;; + + -l*) + if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then + case $host in + *-*-cygwin* | *-*-pw32* | *-*-beos*) + # These systems don't actually have a C or math library (as such) + continue + ;; + *-*-freebsd*-gnu*) + # prevent being parsed by the freebsd regexp below + ;; + *-*-mingw* | *-*-os2*) + # These systems don't actually have a C library (as such) + test "X$arg" = "X-lc" && continue + ;; + *-*-openbsd* | *-*-freebsd*) + # Do not include libc due to us having libc/libc_r. + test "X$arg" = "X-lc" && continue + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C and math libraries are in the System framework + deplibs="$deplibs -framework System" + continue + esac + elif test "X$arg" = "X-lc_r"; then + case $host in + *-*-freebsd*-gnu*) + # prevent being parsed by the freebsd regexp below + ;; + *-*-openbsd*) + # Do not include libc_r directly, use -pthread flag. + continue + ;; + esac + fi + deplibs="$deplibs $arg" + continue + ;; + + -module) + module=yes + continue + ;; + + # gcc -m* arguments should be passed to the linker via $compiler_flags + # in order to pass architecture information to the linker + # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo + # but this is not reliable with gcc because gcc may use -mfoo to + # select a different linker, different libraries, etc, while + # -Wl,-mfoo simply passes -mfoo to the linker. + -m*) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + if test "$with_gcc" = "yes" ; then + compiler_flags="$compiler_flags $arg" + fi + continue + ;; + + -shrext) + prev=shrext + continue + ;; + + -no-fast-install) + fast_install=no + continue + ;; + + -no-install) + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + # The PATH hackery in wrapper scripts is required on Windows + # in order for the loader to find any dlls it needs. + $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 + $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 + fast_install=no + ;; + *) no_install=yes ;; + esac + continue + ;; + + -no-undefined) + allow_undefined=no + continue + ;; + + -objectlist) + prev=objectlist + continue + ;; + + -o) prev=output ;; + + -release) + prev=release + continue + ;; + + -rpath) + prev=rpath + continue + ;; + + -R) + prev=xrpath + continue + ;; + + -R*) + dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + $echo "$modename: only absolute run-paths are allowed" 1>&2 + exit 1 + ;; + esac + case "$xrpath " in + *" $dir "*) ;; + *) xrpath="$xrpath $dir" ;; + esac + continue + ;; + + -static) + # The effects of -static are defined in a previous loop. + # We used to do the same as -all-static on platforms that + # didn't have a PIC flag, but the assumption that the effects + # would be equivalent was wrong. It would break on at least + # Digital Unix and AIX. + continue + ;; + + -thread-safe) + thread_safe=yes + continue + ;; + + -version-info) + prev=vinfo + continue + ;; + -version-number) + prev=vinfo + vinfo_number=yes + continue + ;; + + -Wc,*) + args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + case $flag in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + flag="\"$flag\"" + ;; + esac + arg="$arg $wl$flag" + compiler_flags="$compiler_flags $flag" + done + IFS="$save_ifs" + arg=`$echo "X$arg" | $Xsed -e "s/^ //"` + ;; + + -Wl,*) + args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + case $flag in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + flag="\"$flag\"" + ;; + esac + arg="$arg $wl$flag" + compiler_flags="$compiler_flags $wl$flag" + linker_flags="$linker_flags $flag" + done + IFS="$save_ifs" + arg=`$echo "X$arg" | $Xsed -e "s/^ //"` + ;; + + -Xcompiler) + prev=xcompiler + continue + ;; + + -Xlinker) + prev=xlinker + continue + ;; + + -XCClinker) + prev=xcclinker + continue + ;; + + # Some other compiler flag. + -* | +*) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + add_flags="$add_flags $arg" + ;; + + *.$objext) + # A standard object. + objs="$objs $arg" + ;; + + *.lo) + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + pic_object= + non_pic_object= + + # Read the .lo file + # If there is no directory component, then add one. + case $arg in + */* | *\\*) . $arg ;; + *) . ./$arg ;; + esac + + if test -z "$pic_object" || \ + test -z "$non_pic_object" || + test "$pic_object" = none && \ + test "$non_pic_object" = none; then + $echo "$modename: cannot find name of object for \`$arg'" 1>&2 + exit 1 + fi + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + dlfiles="$dlfiles $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + dlprefiles="$dlprefiles $pic_object" + prev= + fi + + # A PIC object. + libobjs="$libobjs $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + non_pic_objects="$non_pic_objects $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + fi + else + # Only an error if not doing a dry-run. + if test -z "$run"; then + $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 + exit 1 + else + # Dry-run case. + + # Extract subdirectory from the argument. + xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$arg"; then + xdir= + else + xdir="$xdir/" + fi + + pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` + non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` + libobjs="$libobjs $pic_object" + non_pic_objects="$non_pic_objects $non_pic_object" + fi + fi + ;; + + *.$libext) + # An archive. + deplibs="$deplibs $arg" + old_deplibs="$old_deplibs $arg" + continue + ;; + + *.la) + # A libtool-controlled library. + + if test "$prev" = dlfiles; then + # This library was specified with -dlopen. + dlfiles="$dlfiles $arg" + prev= + elif test "$prev" = dlprefiles; then + # The library was specified with -dlpreopen. + dlprefiles="$dlprefiles $arg" + prev= + else + deplibs="$deplibs $arg" + fi + continue + ;; + + # Some other compiler argument. + *) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + arg="\"$arg\"" + ;; + esac + add_flags="$add_flags $arg" + ;; + esac # arg + + # Now actually substitute the argument into the commands. + if test -n "$arg"; then + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + fi + done # argument parsing loop + + if test -n "$prev"; then + $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + # Infer tagged configuration to use if any are available and + # if one wasn't chosen via the "--tag" command line option. + # Only attempt this if the compiler in the base link + # command doesn't match the default compiler. + if test -n "$available_tags" && test -z "$tagname"; then + case $base_compile in + # Blanks in the command may have been stripped by the calling shell, + # but not from the CC environment variable when configure was run. + "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) ;; + # Blanks at the start of $base_compile will cause this to fail + # if we don't check for them as well. + *) + for z in $available_tags; do + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`" + case $base_compile in + "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) + # The compiler in $compile_command matches + # the one in the tagged configuration. + # Assume this is the tagged configuration we want. + tagname=$z + break + ;; + esac + fi + done + # If $tagname still isn't set, then no tagged configuration + # was found and let the user know that the "--tag" command + # line option must be used. + if test -z "$tagname"; then + $echo "$modename: unable to infer tagged configuration" + $echo "$modename: specify a tag with \`--tag'" 1>&2 + exit 1 +# else +# $echo "$modename: using $tagname tagged configuration" + fi + ;; + esac + fi + + if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then + eval arg=\"$export_dynamic_flag_spec\" + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + fi + + oldlibs= + # calculate the name of the file, without its directory + outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` + libobjs_save="$libobjs" + + if test -n "$shlibpath_var"; then + # get the directories listed in $shlibpath_var + eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` + else + shlib_search_path= + fi + eval sys_lib_search_path=\"$sys_lib_search_path_spec\" + eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" + + output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` + if test "X$output_objdir" = "X$output"; then + output_objdir="$objdir" + else + output_objdir="$output_objdir/$objdir" + fi + # Create the object directory. + if test ! -d "$output_objdir"; then + $show "$mkdir $output_objdir" + $run $mkdir $output_objdir + status=$? + if test "$status" -ne 0 && test ! -d "$output_objdir"; then + exit $status + fi + fi + + # Determine the type of output + case $output in + "") + $echo "$modename: you must specify an output file" 1>&2 + $echo "$help" 1>&2 + exit 1 + ;; + *.$libext) linkmode=oldlib ;; + *.lo | *.$objext) linkmode=obj ;; + *.la) linkmode=lib ;; + *) linkmode=prog ;; # Anything else should be a program. + esac + + case $host in + *cygwin* | *mingw* | *pw32*) + # don't eliminate duplcations in $postdeps and $predeps + duplicate_compiler_generated_deps=yes + ;; + *) + duplicate_compiler_generated_deps=$duplicate_deps + ;; + esac + specialdeplibs= + + libs= + # Find all interdependent deplibs by searching for libraries + # that are linked more than once (e.g. -la -lb -la) + for deplib in $deplibs; do + if test "X$duplicate_deps" = "Xyes" ; then + case "$libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + libs="$libs $deplib" + done + + if test "$linkmode" = lib; then + libs="$predeps $libs $compiler_lib_search_path $postdeps" + + # Compute libraries that are listed more than once in $predeps + # $postdeps and mark them as special (i.e., whose duplicates are + # not to be eliminated). + pre_post_deps= + if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then + for pre_post_dep in $predeps $postdeps; do + case "$pre_post_deps " in + *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; + esac + pre_post_deps="$pre_post_deps $pre_post_dep" + done + fi + pre_post_deps= + fi + + deplibs= + newdependency_libs= + newlib_search_path= + need_relink=no # whether we're linking any uninstalled libtool libraries + notinst_deplibs= # not-installed libtool libraries + notinst_path= # paths that contain not-installed libtool libraries + case $linkmode in + lib) + passes="conv link" + for file in $dlfiles $dlprefiles; do + case $file in + *.la) ;; + *) + $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 + exit 1 + ;; + esac + done + ;; + prog) + compile_deplibs= + finalize_deplibs= + alldeplibs=no + newdlfiles= + newdlprefiles= + passes="conv scan dlopen dlpreopen link" + ;; + *) passes="conv" + ;; + esac + for pass in $passes; do + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan"; then + libs="$deplibs" + deplibs= + fi + if test "$linkmode" = prog; then + case $pass in + dlopen) libs="$dlfiles" ;; + dlpreopen) libs="$dlprefiles" ;; + link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; + esac + fi + if test "$pass" = dlopen; then + # Collect dlpreopened libraries + save_deplibs="$deplibs" + deplibs= + fi + for deplib in $libs; do + lib= + found=no + case $deplib in + -l*) + if test "$linkmode" != lib && test "$linkmode" != prog; then + $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 + continue + fi + if test "$pass" = conv && test "$allow_undefined" = yes; then + deplibs="$deplib $deplibs" + continue + fi + name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` + for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do + for search_ext in .la $shrext .so .a; do + # Search the libtool library + lib="$searchdir/lib${name}${search_ext}" + if test -f "$lib"; then + if test "$search_ext" = ".la"; then + found=yes + else + found=no + fi + break 2 + fi + done + done + if test "$found" != yes; then + # deplib doesn't seem to be a libtool library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + else # deplib is a libtool library + # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, + # We need to do some special things here, and not later. + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $deplib "*) + if (${SED} -e '2q' $lib | + grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + library_names= + old_library= + case $lib in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + esac + for l in $old_library $library_names; do + ll="$l" + done + if test "X$ll" = "X$old_library" ; then # only static version available + found=no + ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` + test "X$ladir" = "X$lib" && ladir="." + lib=$ladir/$old_library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + fi + ;; + *) ;; + esac + fi + fi + ;; # -l + -L*) + case $linkmode in + lib) + deplibs="$deplib $deplibs" + test "$pass" = conv && continue + newdependency_libs="$deplib $newdependency_libs" + newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` + ;; + prog) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + if test "$pass" = scan; then + deplibs="$deplib $deplibs" + newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + ;; + *) + $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 + ;; + esac # linkmode + continue + ;; # -L + -R*) + if test "$pass" = link; then + dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` + # Make sure the xrpath contains only unique directories. + case "$xrpath " in + *" $dir "*) ;; + *) xrpath="$xrpath $dir" ;; + esac + fi + deplibs="$deplib $deplibs" + continue + ;; + *.la) lib="$deplib" ;; + *.$libext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + case $linkmode in + lib) + if test "$deplibs_check_method" != pass_all; then + $echo + $echo "*** Warning: Trying to link with static lib archive $deplib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have" + $echo "*** because the file extensions .$libext of this argument makes me believe" + $echo "*** that it is just a static archive that I should not used here." + else + $echo + $echo "*** Warning: Linking the shared library $output against the" + $echo "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" + fi + continue + ;; + prog) + if test "$pass" != link; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + continue + ;; + esac # linkmode + ;; # *.$libext + *.lo | *.$objext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + elif test "$linkmode" = prog; then + if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then + # If there is no dlopen support or we're linking statically, + # we need to preload. + newdlprefiles="$newdlprefiles $deplib" + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + newdlfiles="$newdlfiles $deplib" + fi + fi + continue + ;; + %DEPLIBS%) + alldeplibs=yes + continue + ;; + esac # case $deplib + if test "$found" = yes || test -f "$lib"; then : + else + $echo "$modename: cannot find the library \`$lib'" 1>&2 + exit 1 + fi + + # Check to see that this really is a libtool archive. + if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit 1 + fi + + ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` + test "X$ladir" = "X$lib" && ladir="." + + dlname= + dlopen= + dlpreopen= + libdir= + library_names= + old_library= + # If the library was installed with an old release of libtool, + # it will not redefine variables installed, or shouldnotlink + installed=yes + shouldnotlink=no + + # Read the .la file + case $lib in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + esac + + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan" || + { test "$linkmode" != prog && test "$linkmode" != lib; }; then + test -n "$dlopen" && dlfiles="$dlfiles $dlopen" + test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" + fi + + if test "$pass" = conv; then + # Only check for convenience libraries + deplibs="$lib $deplibs" + tmp_libs= + for deplib in $dependency_libs; do + #echo "Adding $deplib to \$deplibs" + deplibs="$deplib $deplibs" + if test "X$duplicate_deps" = "Xyes" ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done + if test -z "$libdir"; then + if test -z "$old_library"; then + $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 + exit 1 + fi + # It is a libtool convenience library, so add in its objects. + convenience="$convenience $ladir/$objdir/$old_library" + old_convenience="$old_convenience $ladir/$objdir/$old_library" + elif test "$linkmode" != prog && test "$linkmode" != lib; then + $echo "$modename: \`$lib' is not a convenience library" 1>&2 + exit 1 + fi + continue + fi # $pass = conv + + + # Get the name of the library we link against. + linklib= + for l in $old_library $library_names; do + linklib="$l" + done + if test -z "$linklib"; then + $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 + exit 1 + fi + + # This library was specified with -dlopen. + if test "$pass" = dlopen; then + if test -z "$libdir"; then + $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 + exit 1 + fi + if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then + # If there is no dlname, no dlopen support or we're linking + # statically, we need to preload. We also need to preload any + # dependent libraries so libltdl's deplib preloader doesn't + # bomb out in the load deplibs phase. + dlprefiles="$dlprefiles $lib $dependency_libs" + else + newdlfiles="$newdlfiles $lib" + fi + continue + fi # $pass = dlopen + + # We need an absolute path. + case $ladir in + [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; + *) + abs_ladir=`cd "$ladir" && pwd` + if test -z "$abs_ladir"; then + $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 + $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 + abs_ladir="$ladir" + fi + ;; + esac + laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` + + # Find the relevant object directory and library name. + if test "X$installed" = Xyes; then + if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then + $echo "$modename: warning: library \`$lib' was moved." 1>&2 + dir="$ladir" + absdir="$abs_ladir" + libdir="$abs_ladir" + else + dir="$libdir" + absdir="$libdir" + fi + else + dir="$ladir/$objdir" + absdir="$abs_ladir/$objdir" + # Remove this search path later + notinst_path="$notinst_path $abs_ladir" + fi # $installed = yes + name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` + + # This library was specified with -dlpreopen. + if test "$pass" = dlpreopen; then + if test -z "$libdir"; then + $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 + exit 1 + fi + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + newdlprefiles="$newdlprefiles $dir/$old_library" + # Otherwise, use the dlname, so that lt_dlopen finds it. + elif test -n "$dlname"; then + newdlprefiles="$newdlprefiles $dir/$dlname" + else + newdlprefiles="$newdlprefiles $dir/$linklib" + fi + fi # $pass = dlpreopen + + if test -z "$libdir"; then + # Link the convenience library + if test "$linkmode" = lib; then + deplibs="$dir/$old_library $deplibs" + elif test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$dir/$old_library $compile_deplibs" + finalize_deplibs="$dir/$old_library $finalize_deplibs" + else + deplibs="$lib $deplibs" # used for prog,scan pass + fi + continue + fi + + + if test "$linkmode" = prog && test "$pass" != link; then + newlib_search_path="$newlib_search_path $ladir" + deplibs="$lib $deplibs" + + linkalldeplibs=no + if test "$link_all_deplibs" != no || test -z "$library_names" || + test "$build_libtool_libs" = no; then + linkalldeplibs=yes + fi + + tmp_libs= + for deplib in $dependency_libs; do + case $deplib in + -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test + esac + # Need to link against all dependency_libs? + if test "$linkalldeplibs" = yes; then + deplibs="$deplib $deplibs" + else + # Need to hardcode shared library paths + # or/and link against static libraries + newdependency_libs="$deplib $newdependency_libs" + fi + if test "X$duplicate_deps" = "Xyes" ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done # for deplib + continue + fi # $linkmode = prog... + + if test "$linkmode,$pass" = "prog,link"; then + if test -n "$library_names" && + { test "$prefer_static_libs" = no || test -z "$old_library"; }; then + # We need to hardcode the library path + if test -n "$shlibpath_var"; then + # Make sure the rpath contains only unique directories. + case "$temp_rpath " in + *" $dir "*) ;; + *" $absdir "*) ;; + *) temp_rpath="$temp_rpath $dir" ;; + esac + fi + + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) compile_rpath="$compile_rpath $absdir" + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" + esac + ;; + esac + fi # $linkmode,$pass = prog,link... + + if test "$alldeplibs" = yes && + { test "$deplibs_check_method" = pass_all || + { test "$build_libtool_libs" = yes && + test -n "$library_names"; }; }; then + # We only need to search for static libraries + continue + fi + fi + + link_static=no # Whether the deplib will be linked statically + if test -n "$library_names" && + { test "$prefer_static_libs" = no || test -z "$old_library"; }; then + if test "$installed" = no; then + notinst_deplibs="$notinst_deplibs $lib" + need_relink=yes + fi + # This is a shared library + + # Warn about portability, can't link against -module's on some systems (darwin) + if test "$shouldnotlink" = yes && test "$pass" = link ; then + $echo + if test "$linkmode" = prog; then + $echo "*** Warning: Linking the executable $output against the loadable module" + else + $echo "*** Warning: Linking the shared library $output against the loadable module" + fi + $echo "*** $linklib is not portable!" + fi + if test "$linkmode" = lib && + test "$hardcode_into_libs" = yes; then + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) compile_rpath="$compile_rpath $absdir" + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" + esac + ;; + esac + fi + + if test -n "$old_archive_from_expsyms_cmds"; then + # figure out the soname + set dummy $library_names + realname="$2" + shift; shift + libname=`eval \\$echo \"$libname_spec\"` + # use dlname if we got it. it's perfectly good, no? + if test -n "$dlname"; then + soname="$dlname" + elif test -n "$soname_spec"; then + # bleh windows + case $host in + *cygwin* | mingw*) + major=`expr $current - $age` + versuffix="-$major" + ;; + esac + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + + # Make a new name for the extract_expsyms_cmds to use + soroot="$soname" + soname=`$echo $soroot | ${SED} -e 's/^.*\///'` + newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" + + # If the library has no export list, then create one now + if test -f "$output_objdir/$soname-def"; then : + else + $show "extracting exported symbol list from \`$soname'" + save_ifs="$IFS"; IFS='~' + eval cmds=\"$extract_expsyms_cmds\" + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + fi + + # Create $newlib + if test -f "$output_objdir/$newlib"; then :; else + $show "generating import library for \`$soname'" + save_ifs="$IFS"; IFS='~' + eval cmds=\"$old_archive_from_expsyms_cmds\" + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + fi + # make sure the library variables are pointing to the new library + dir=$output_objdir + linklib=$newlib + fi # test -n "$old_archive_from_expsyms_cmds" + + if test "$linkmode" = prog || test "$mode" != relink; then + add_shlibpath= + add_dir= + add= + lib_linked=yes + case $hardcode_action in + immediate | unsupported) + if test "$hardcode_direct" = no; then + add="$dir/$linklib" + case $host in + *-*-sco3.2v5* ) add_dir="-L$dir" ;; + *-*-darwin* ) + # if the lib is a module then we can not link against it, someone + # is ignoring the new warnings I added + if /usr/bin/file -L $add 2> /dev/null | grep "bundle" >/dev/null ; then + $echo "** Warning, lib $linklib is a module, not a shared library" + if test -z "$old_library" ; then + $echo + $echo "** And there doesn't seem to be a static archive available" + $echo "** The link will probably fail, sorry" + else + add="$dir/$old_library" + fi + fi + esac + elif test "$hardcode_minus_L" = no; then + case $host in + *-*-sunos*) add_shlibpath="$dir" ;; + esac + add_dir="-L$dir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = no; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + relink) + if test "$hardcode_direct" = yes; then + add="$dir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$dir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case "$libdir" in + [\\/]*) + add_dir="-L$inst_prefix_dir$libdir $add_dir" + ;; + esac + fi + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + *) lib_linked=no ;; + esac + + if test "$lib_linked" != yes; then + $echo "$modename: configuration error: unsupported hardcode properties" + exit 1 + fi + + if test -n "$add_shlibpath"; then + case :$compile_shlibpath: in + *":$add_shlibpath:"*) ;; + *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; + esac + fi + if test "$linkmode" = prog; then + test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" + test -n "$add" && compile_deplibs="$add $compile_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + if test "$hardcode_direct" != yes && \ + test "$hardcode_minus_L" != yes && \ + test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + esac + fi + fi + fi + + if test "$linkmode" = prog || test "$mode" = relink; then + add_shlibpath= + add_dir= + add= + # Finalize command for both is simple: just hardcode it. + if test "$hardcode_direct" = yes; then + add="$libdir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$libdir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + esac + add="-l$name" + elif test "$hardcode_automatic" = yes; then + if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then + add="$inst_prefix_dir$libdir/$linklib" + else + add="$libdir/$linklib" + fi + else + # We cannot seem to hardcode it, guess we'll fake it. + add_dir="-L$libdir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case "$libdir" in + [\\/]*) + add_dir="-L$inst_prefix_dir$libdir $add_dir" + ;; + esac + fi + add="-l$name" + fi + + if test "$linkmode" = prog; then + test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" + test -n "$add" && finalize_deplibs="$add $finalize_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + fi + fi + elif test "$linkmode" = prog; then + # Here we assume that one of hardcode_direct or hardcode_minus_L + # is not unsupported. This is valid on all known static and + # shared platforms. + if test "$hardcode_direct" != unsupported; then + test -n "$old_library" && linklib="$old_library" + compile_deplibs="$dir/$linklib $compile_deplibs" + finalize_deplibs="$dir/$linklib $finalize_deplibs" + else + compile_deplibs="-l$name -L$dir $compile_deplibs" + finalize_deplibs="-l$name -L$dir $finalize_deplibs" + fi + elif test "$build_libtool_libs" = yes; then + # Not a shared library + if test "$deplibs_check_method" != pass_all; then + # We're trying link a shared library against a static one + # but the system doesn't support it. + + # Just print a warning and add the library to dependency_libs so + # that the program can be linked against the static library. + $echo + $echo "*** Warning: This system can not link to static lib archive $lib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have." + if test "$module" = yes; then + $echo "*** But as you try to build a module library, libtool will still create " + $echo "*** a static module, that should work as long as the dlopening application" + $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." + if test -z "$global_symbol_pipe"; then + $echo + $echo "*** However, this would only work if libtool was able to extract symbol" + $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + $echo "*** not find such a program. So, this module is probably useless." + $echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + else + convenience="$convenience $dir/$old_library" + old_convenience="$old_convenience $dir/$old_library" + deplibs="$dir/$old_library $deplibs" + link_static=yes + fi + fi # link shared/static library? + + if test "$linkmode" = lib; then + #if test -n "$dependency_libs" && + # { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || + # test "$link_static" = yes; }; then + # Extract -R from dependency_libs + temp_deplibs= + for libdir in $dependency_libs; do + case $libdir in + -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` + case " $xrpath " in + *" $temp_xrpath "*) ;; + *) xrpath="$xrpath $temp_xrpath";; + esac;; + *) temp_deplibs="$temp_deplibs $libdir";; + esac + done + dependency_libs="$temp_deplibs" + #fi + + newlib_search_path="$newlib_search_path $absdir" + # Link against this library + test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" + # ... and its dependency_libs + tmp_libs= + for deplib in $dependency_libs; do + newdependency_libs="$deplib $newdependency_libs" + if test "X$duplicate_deps" = "Xyes" ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done + + if test "$link_all_deplibs" != no; then + # Add the search paths of all dependency libraries + for deplib in $dependency_libs; do + case $deplib in + -L*) path="$deplib" ;; + *.la) + dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` + test "X$dir" = "X$deplib" && dir="." + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 + absdir="$dir" + fi + ;; + esac + if grep "^installed=no" $deplib > /dev/null; then + path="$absdir/$objdir" + else + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + if test -z "$libdir"; then + $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 + exit 1 + fi + if test "$absdir" != "$libdir"; then + # Sure, some shells/systems don't implement the -ef. + # Those will have to live with the warning. + test "$absdir" -ef "$libdir" > /dev/null 2>&1 || + $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 + fi + path="$absdir" + fi + depdepl= + case $host in + *-*-darwin*) + # we do not want to link against static libs, but need to link against shared + eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` + if test -n "$deplibrary_names" ; then + for tmp in $deplibrary_names ; do + depdepl=$tmp + done + if test -f "$path/$depdepl" ; then + depdepl="$path/$depdepl" + fi + # do not add paths which are already there + case " $newlib_search_path " in + *" $path "*) ;; + *) newlib_search_path="$newlib_search_path $path";; + esac + path="" + fi + ;; + *) + path="-L$path" + ;; + esac + + ;; + -l*) + case $host in + *-*-darwin*) + # Again, we only want to link against shared libraries + eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` + for tmp in $newlib_search_path ; do + if test -f "$tmp/lib$tmp_libs.dylib" ; then + eval depdepl="$tmp/lib$tmp_libs.dylib" + break + fi + done + path="" + ;; + *) continue ;; + esac + ;; + *) continue ;; + esac + case " $deplibs " in + *" $depdepl "*) ;; + *) deplibs="$deplibs $depdepl" ;; + esac + case " $deplibs " in + *" $path "*) ;; + *) deplibs="$deplibs $path" ;; + esac + done + fi # link_all_deplibs != no + fi # linkmode = lib + done # for deplib in $libs + dependency_libs="$newdependency_libs" + if test "$pass" = dlpreopen; then + # Link the dlpreopened libraries before other libraries + for deplib in $save_deplibs; do + deplibs="$deplib $deplibs" + done + fi + if test "$pass" != dlopen; then + if test "$pass" != conv; then + # Make sure lib_search_path contains only unique directories. + lib_search_path= + for dir in $newlib_search_path; do + case "$lib_search_path " in + *" $dir "*) ;; + *) lib_search_path="$lib_search_path $dir" ;; + esac + done + newlib_search_path= + fi + + if test "$linkmode,$pass" != "prog,link"; then + vars="deplibs" + else + vars="compile_deplibs finalize_deplibs" + fi + for var in $vars dependency_libs; do + # Add libraries to $var in reverse order + eval tmp_libs=\"\$$var\" + new_libs= + for deplib in $tmp_libs; do + # FIXME: Pedantically, this is the right thing to do, so + # that some nasty dependency loop isn't accidentally + # broken: + #new_libs="$deplib $new_libs" + # Pragmatically, this seems to cause very few problems in + # practice: + case $deplib in + -L*) new_libs="$deplib $new_libs" ;; + -R*) ;; + *) + # And here is the reason: when a library appears more + # than once as an explicit dependence of a library, or + # is implicitly linked in more than once by the + # compiler, it is considered special, and multiple + # occurrences thereof are not removed. Compare this + # with having the same library being listed as a + # dependency of multiple other libraries: in this case, + # we know (pedantically, we assume) the library does not + # need to be listed more than once, so we keep only the + # last copy. This is not always right, but it is rare + # enough that we require users that really mean to play + # such unportable linking tricks to link the library + # using -Wl,-lname, so that libtool does not consider it + # for duplicate removal. + case " $specialdeplibs " in + *" $deplib "*) new_libs="$deplib $new_libs" ;; + *) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$deplib $new_libs" ;; + esac + ;; + esac + ;; + esac + done + tmp_libs= + for deplib in $new_libs; do + case $deplib in + -L*) + case " $tmp_libs " in + *" $deplib "*) ;; + *) tmp_libs="$tmp_libs $deplib" ;; + esac + ;; + *) tmp_libs="$tmp_libs $deplib" ;; + esac + done + eval $var=\"$tmp_libs\" + done # for var + fi + # Last step: remove runtime libs from dependency_libs (they stay in deplibs) + tmp_libs= + for i in $dependency_libs ; do + case " $predeps $postdeps $compiler_lib_search_path " in + *" $i "*) + i="" + ;; + esac + if test -n "$i" ; then + tmp_libs="$tmp_libs $i" + fi + done + dependency_libs=$tmp_libs + done # for pass + if test "$linkmode" = prog; then + dlfiles="$newdlfiles" + dlprefiles="$newdlprefiles" + fi + + case $linkmode in + oldlib) + if test -n "$deplibs"; then + $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 + fi + + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 + fi + + if test -n "$rpath"; then + $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 + fi + + if test -n "$xrpath"; then + $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 + fi + + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 + fi + + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 + fi + + # Now set the variables for building old libraries. + build_libtool_libs=no + oldlibs="$output" + objs="$objs$old_deplibs" + ;; + + lib) + # Make sure we only generate libraries of the form `libNAME.la'. + case $outputname in + lib*) + name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` + eval shared_ext=\"$shrext\" + eval libname=\"$libname_spec\" + ;; + *) + if test "$module" = no; then + $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + if test "$need_lib_prefix" != no; then + # Add the "lib" prefix for modules if required + name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` + eval shared_ext=\"$shrext\" + eval libname=\"$libname_spec\" + else + libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` + fi + ;; + esac + + if test -n "$objs"; then + if test "$deplibs_check_method" != pass_all; then + $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 + exit 1 + else + $echo + $echo "*** Warning: Linking the shared library $output against the non-libtool" + $echo "*** objects $objs is not portable!" + libobjs="$libobjs $objs" + fi + fi + + if test "$dlself" != no; then + $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 + fi + + set dummy $rpath + if test "$#" -gt 2; then + $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 + fi + install_libdir="$2" + + oldlibs= + if test -z "$rpath"; then + if test "$build_libtool_libs" = yes; then + # Building a libtool convenience library. + # Some compilers have problems with a `.al' extension so + # convenience libraries should have the same extension an + # archive normally would. + oldlibs="$output_objdir/$libname.$libext $oldlibs" + build_libtool_libs=convenience + build_old_libs=yes + fi + + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 + fi + else + + # Parse the version information argument. + save_ifs="$IFS"; IFS=':' + set dummy $vinfo 0 0 0 + IFS="$save_ifs" + + if test -n "$8"; then + $echo "$modename: too many parameters to \`-version-info'" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + # convert absolute version numbers to libtool ages + # this retains compatibility with .la files and attempts + # to make the code below a bit more comprehensible + + case $vinfo_number in + yes) + number_major="$2" + number_minor="$3" + number_revision="$4" + # + # There are really only two kinds -- those that + # use the current revision as the major version + # and those that subtract age and use age as + # a minor version. But, then there is irix + # which has an extra 1 added just for fun + # + case $version_type in + darwin|linux|osf|windows) + current=`expr $number_major + $number_minor` + age="$number_minor" + revision="$number_revision" + ;; + freebsd-aout|freebsd-elf|sunos) + current="$number_major" + revision="$number_minor" + age="0" + ;; + irix|nonstopux) + current=`expr $number_major + $number_minor - 1` + age="$number_minor" + revision="$number_minor" + ;; + esac + ;; + no) + current="$2" + revision="$3" + age="$4" + ;; + esac + + # Check that each of the things are valid numbers. + case $current in + 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; + *) + $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit 1 + ;; + esac + + case $revision in + 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; + *) + $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit 1 + ;; + esac + + case $age in + 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; + *) + $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit 1 + ;; + esac + + if test "$age" -gt "$current"; then + $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit 1 + fi + + # Calculate the version variables. + major= + versuffix= + verstring= + case $version_type in + none) ;; + + darwin) + # Like Linux, but with the current version available in + # verstring for coding it into the library header + major=.`expr $current - $age` + versuffix="$major.$age.$revision" + # Darwin ld doesn't like 0 for these options... + minor_current=`expr $current + 1` + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + ;; + + freebsd-aout) + major=".$current" + versuffix=".$current.$revision"; + ;; + + freebsd-elf) + major=".$current" + versuffix=".$current"; + ;; + + irix | nonstopux) + major=`expr $current - $age + 1` + + case $version_type in + nonstopux) verstring_prefix=nonstopux ;; + *) verstring_prefix=sgi ;; + esac + verstring="$verstring_prefix$major.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$revision + while test "$loop" -ne 0; do + iface=`expr $revision - $loop` + loop=`expr $loop - 1` + verstring="$verstring_prefix$major.$iface:$verstring" + done + + # Before this point, $major must not contain `.'. + major=.$major + versuffix="$major.$revision" + ;; + + linux) + major=.`expr $current - $age` + versuffix="$major.$age.$revision" + ;; + + osf) + major=.`expr $current - $age` + versuffix=".$current.$age.$revision" + verstring="$current.$age.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$age + while test "$loop" -ne 0; do + iface=`expr $current - $loop` + loop=`expr $loop - 1` + verstring="$verstring:${iface}.0" + done + + # Make executables depend on our current version. + verstring="$verstring:${current}.0" + ;; + + sunos) + major=".$current" + versuffix=".$current.$revision" + ;; + + windows) + # Use '-' rather than '.', since we only want one + # extension on DOS 8.3 filesystems. + major=`expr $current - $age` + versuffix="-$major" + ;; + + *) + $echo "$modename: unknown library version type \`$version_type'" 1>&2 + $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 + exit 1 + ;; + esac + + # Clear the version info if we defaulted, and they specified a release. + if test -z "$vinfo" && test -n "$release"; then + major= + case $version_type in + darwin) + # we can't check for "0.0" in archive_cmds due to quoting + # problems, so we reset it completely + verstring= + ;; + *) + verstring="0.0" + ;; + esac + if test "$need_version" = no; then + versuffix= + else + versuffix=".0.0" + fi + fi + + # Remove version info from name if versioning should be avoided + if test "$avoid_version" = yes && test "$need_version" = no; then + major= + versuffix= + verstring="" + fi + + # Check to see if the archive will have undefined symbols. + if test "$allow_undefined" = yes; then + if test "$allow_undefined_flag" = unsupported; then + $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 + build_libtool_libs=no + build_old_libs=yes + fi + else + # Don't allow undefined symbols. + allow_undefined_flag="$no_undefined_flag" + fi + fi + + if test "$mode" != relink; then + # Remove our outputs, but don't remove object files since they + # may have been created when compiling PIC objects. + removelist= + tempremovelist=`$echo "$output_objdir/*"` + for p in $tempremovelist; do + case $p in + *.$objext) + ;; + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) + removelist="$removelist $p" + ;; + *) ;; + esac + done + if test -n "$removelist"; then + $show "${rm}r $removelist" + $run ${rm}r $removelist + fi + fi + + # Now set the variables for building old libraries. + if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then + oldlibs="$oldlibs $output_objdir/$libname.$libext" + + # Transform .lo files to .o files. + oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` + fi + + # Eliminate all temporary directories. + for path in $notinst_path; do + lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'` + deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'` + dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'` + done + + if test -n "$xrpath"; then + # If the user specified any rpath flags, then add them. + temp_xrpath= + for libdir in $xrpath; do + temp_xrpath="$temp_xrpath -R$libdir" + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" ;; + esac + done + if true || test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then + dependency_libs="$temp_xrpath $dependency_libs" + fi + fi + + # Make sure dlfiles contains only unique files that won't be dlpreopened + old_dlfiles="$dlfiles" + dlfiles= + for lib in $old_dlfiles; do + case " $dlprefiles $dlfiles " in + *" $lib "*) ;; + *) dlfiles="$dlfiles $lib" ;; + esac + done + + # Make sure dlprefiles contains only unique files + old_dlprefiles="$dlprefiles" + dlprefiles= + for lib in $old_dlprefiles; do + case "$dlprefiles " in + *" $lib "*) ;; + *) dlprefiles="$dlprefiles $lib" ;; + esac + done + + if test "$build_libtool_libs" = yes; then + if test -n "$rpath"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) + # these systems don't actually have a c library (as such)! + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C library is in the System framework + deplibs="$deplibs -framework System" + ;; + *-*-netbsd*) + # Don't link with libc until the a.out ld.so is fixed. + ;; + *-*-freebsd*-gnu*) + # Prevent $arg from being parsed by the freebsd regexp below. + if test "$build_libtool_need_lc" = "yes"; then + deplibs="$deplibs -lc" + fi + ;; + *-*-openbsd* | *-*-freebsd*) + # Do not include libc due to us having libc/libc_r. + test "X$arg" = "X-lc" && continue + ;; + *) + # Add libc to deplibs on all other systems if necessary. + if test "$build_libtool_need_lc" = "yes"; then + deplibs="$deplibs -lc" + fi + ;; + esac + fi + + # Transform deplibs into only deplibs that can be linked in shared. + name_save=$name + libname_save=$libname + release_save=$release + versuffix_save=$versuffix + major_save=$major + # I'm not sure if I'm treating the release correctly. I think + # release should show up in the -l (ie -lgmp5) so we don't want to + # add it in twice. Is that correct? + release="" + versuffix="" + major="" + newdeplibs= + droppeddeps=no + case $deplibs_check_method in + pass_all) + # Don't check for shared/static. Everything works. + # This might be a little naive. We might want to check + # whether the library exists or not. But this is on + # osf3 & osf4 and I'm not really sure... Just + # implementing what was already the behavior. + newdeplibs=$deplibs + ;; + test_compile) + # This code stresses the "libraries are programs" paradigm to its + # limits. Maybe even breaks it. We compile a program, linking it + # against the deplibs as a proxy for the library. Then we can check + # whether they linked in statically or dynamically with ldd. + $rm conftest.c + cat > conftest.c </dev/null` + for potent_lib in $potential_libs; do + # Follow soft links. + if ls -lLd "$potent_lib" 2>/dev/null \ + | grep " -> " >/dev/null; then + continue + fi + # The statement above tries to avoid entering an + # endless loop below, in case of cyclic links. + # We might still enter an endless loop, since a link + # loop can be closed while we follow links, + # but so what? + potlib="$potent_lib" + while test -h "$potlib" 2>/dev/null; do + potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` + case $potliblink in + [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; + *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; + esac + done + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ + | ${SED} 10q \ + | $EGREP "$file_magic_regex" > /dev/null; then + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + $echo + $echo "*** Warning: linker path does not have real file for library $a_deplib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have" + $echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $echo "*** with $libname but no candidates were found. (...for file magic test)" + else + $echo "*** with $libname and none of the candidates passed a file format test" + $echo "*** using a file magic. Last file checked: $potlib" + fi + fi + else + # Add a -L argument. + newdeplibs="$newdeplibs $a_deplib" + fi + done # Gone through all deplibs. + ;; + match_pattern*) + set dummy $deplibs_check_method + match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` + for a_deplib in $deplibs; do + name="`expr $a_deplib : '-l\(.*\)'`" + # If $name is empty we are operating on a -L argument. + if test -n "$name" && test "$name" != "0"; then + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $a_deplib "*) + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + ;; + esac + fi + if test -n "$a_deplib" ; then + libname=`eval \\$echo \"$libname_spec\"` + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do + potential_libs=`ls $i/$libname[.-]* 2>/dev/null` + for potent_lib in $potential_libs; do + potlib="$potent_lib" # see symlink-check above in file_magic test + if eval $echo \"$potent_lib\" 2>/dev/null \ + | ${SED} 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + $echo + $echo "*** Warning: linker path does not have real file for library $a_deplib." + $echo "*** I have the capability to make that library automatically link in when" + $echo "*** you link to this library. But I can only do this if you have a" + $echo "*** shared version of the library, which you do not appear to have" + $echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $echo "*** with $libname but no candidates were found. (...for regex pattern test)" + else + $echo "*** with $libname and none of the candidates passed a file format test" + $echo "*** using a regex pattern. Last file checked: $potlib" + fi + fi + else + # Add a -L argument. + newdeplibs="$newdeplibs $a_deplib" + fi + done # Gone through all deplibs. + ;; + none | unknown | *) + newdeplibs="" + tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ + -e 's/ -[LR][^ ]*//g'` + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + for i in $predeps $postdeps ; do + # can't use Xsed below, because $i might contain '/' + tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` + done + fi + if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ + | grep . >/dev/null; then + $echo + if test "X$deplibs_check_method" = "Xnone"; then + $echo "*** Warning: inter-library dependencies are not supported in this platform." + else + $echo "*** Warning: inter-library dependencies are not known to be supported." + fi + $echo "*** All declared inter-library dependencies are being dropped." + droppeddeps=yes + fi + ;; + esac + versuffix=$versuffix_save + major=$major_save + release=$release_save + libname=$libname_save + name=$name_save + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` + ;; + esac + + if test "$droppeddeps" = yes; then + if test "$module" = yes; then + $echo + $echo "*** Warning: libtool could not satisfy all declared inter-library" + $echo "*** dependencies of module $libname. Therefore, libtool will create" + $echo "*** a static module, that should work as long as the dlopening" + $echo "*** application is linked with the -dlopen flag." + if test -z "$global_symbol_pipe"; then + $echo + $echo "*** However, this would only work if libtool was able to extract symbol" + $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + $echo "*** not find such a program. So, this module is probably useless." + $echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + else + $echo "*** The inter-library dependencies that have been dropped here will be" + $echo "*** automatically added whenever a program is linked with this library" + $echo "*** or is declared to -dlopen it." + + if test "$allow_undefined" = no; then + $echo + $echo "*** Since this library must not contain undefined symbols," + $echo "*** because either the platform does not support them or" + $echo "*** it was explicitly requested with -no-undefined," + $echo "*** libtool will only create a static version of it." + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + fi + fi + # Done checking deplibs! + deplibs=$newdeplibs + fi + + # All the library-specific variables (install_libdir is set above). + library_names= + old_library= + dlname= + + # Test again, we may have decided not to build it any more + if test "$build_libtool_libs" = yes; then + if test "$hardcode_into_libs" = yes; then + # Hardcode the library paths + hardcode_libdirs= + dep_rpath= + rpath="$finalize_rpath" + test "$mode" != relink && test "$fast_install" = no && rpath="$compile_rpath$rpath" + for libdir in $rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + dep_rpath="$dep_rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) perm_rpath="$perm_rpath $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + if test -n "$hardcode_libdir_flag_spec_ld"; then + eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" + else + eval dep_rpath=\"$hardcode_libdir_flag_spec\" + fi + fi + if test -n "$runpath_var" && test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + rpath="$rpath$dir:" + done + eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" + fi + test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" + fi + + shlibpath="$finalize_shlibpath" + test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" + if test -n "$shlibpath"; then + eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" + fi + + # Get the real and link names of the library. + eval shared_ext=\"$shrext\" + eval library_names=\"$library_names_spec\" + set dummy $library_names + realname="$2" + shift; shift + + if test -n "$soname_spec"; then + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + if test -z "$dlname"; then + dlname=$soname + fi + + lib="$output_objdir/$realname" + for link + do + linknames="$linknames $link" + done + + # Use standard objects if they are pic + test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then + $show "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $run $rm $export_symbols + eval cmds=\"$export_symbols_cmds\" + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + if len=`expr "X$cmd" : ".*"` && + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then + $show "$cmd" + $run eval "$cmd" || exit $? + skipped_export=false + else + # The command line is too long to execute in one step. + $show "using reloadable object file for export list..." + skipped_export=: + fi + done + IFS="$save_ifs" + if test -n "$export_symbols_regex"; then + $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" + $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + $show "$mv \"${export_symbols}T\" \"$export_symbols\"" + $run eval '$mv "${export_symbols}T" "$export_symbols"' + fi + fi + fi + + if test -n "$export_symbols" && test -n "$include_expsyms"; then + $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' + fi + + tmp_deplibs= + for test_deplib in $deplibs; do + case " $convenience " in + *" $test_deplib "*) ;; + *) + tmp_deplibs="$tmp_deplibs $test_deplib" + ;; + esac + done + deplibs="$tmp_deplibs" + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + else + gentop="$output_objdir/${outputname}x" + $show "${rm}r $gentop" + $run ${rm}r "$gentop" + $show "$mkdir $gentop" + $run $mkdir "$gentop" + status=$? + if test "$status" -ne 0 && test ! -d "$gentop"; then + exit $status + fi + generated="$generated $gentop" + + for xlib in $convenience; do + # Extract the objects. + case $xlib in + [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; + *) xabs=`pwd`"/$xlib" ;; + esac + xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` + xdir="$gentop/$xlib" + + $show "${rm}r $xdir" + $run ${rm}r "$xdir" + $show "$mkdir $xdir" + $run $mkdir "$xdir" + status=$? + if test "$status" -ne 0 && test ! -d "$xdir"; then + exit $status + fi + # We will extract separately just the conflicting names and we will no + # longer touch any unique names. It is faster to leave these extract + # automatically by $AR in one run. + $show "(cd $xdir && $AR x $xabs)" + $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? + if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then + : + else + $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 + $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 + $AR t "$xabs" | sort | uniq -cd | while read -r count name + do + i=1 + while test "$i" -le "$count" + do + # Put our $i before any first dot (extension) + # Never overwrite any file + name_to="$name" + while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" + do + name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` + done + $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" + $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? + i=`expr $i + 1` + done + done + fi + + libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` + done + fi + fi + + if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then + eval flag=\"$thread_safe_flag_spec\" + linker_flags="$linker_flags $flag" + fi + + # Make a backup of the uninstalled library when relinking + if test "$mode" = relink; then + $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? + fi + + # Add all flags from the command line. We here create a library, + # but those flags were only added to compile_command and + # finalize_command, which are only used when creating executables. + # So do it by hand here. + compiler_flags="$compiler_flags $add_flags" + # Only add it to commands which use CC, instead of LD, i.e. + # only to $compiler_flags + #linker_flags="$linker_flags $add_flags" + + # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + eval cmds=\"$module_expsym_cmds\" + else + eval cmds=\"$module_cmds\" + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + eval cmds=\"$archive_expsym_cmds\" + else + eval cmds=\"$archive_cmds\" + fi + fi + + if test "X$skipped_export" != "X:" && len=`expr "X$cmds" : ".*"` && + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then + : + else + # The command line is too long to link in one step, link piecewise. + $echo "creating reloadable object files..." + + # Save the value of $output and $libobjs because we want to + # use them later. If we have whole_archive_flag_spec, we + # want to use save_libobjs as it was before + # whole_archive_flag_spec was expanded, because we can't + # assume the linker understands whole_archive_flag_spec. + # This may have to be revisited, in case too many + # convenience libraries get linked in and end up exceeding + # the spec. + if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + fi + save_output=$output + + # Clear the reloadable object creation command queue and + # initialize k to one. + test_cmds= + concat_cmds= + objlist= + delfiles= + last_robj= + k=1 + output=$output_objdir/$save_output-${k}.$objext + # Loop over the list of objects to be linked. + for obj in $save_libobjs + do + eval test_cmds=\"$reload_cmds $objlist $last_robj\" + if test "X$objlist" = X || + { len=`expr "X$test_cmds" : ".*"` && + test "$len" -le "$max_cmd_len"; }; then + objlist="$objlist $obj" + else + # The command $test_cmds is almost too long, add a + # command to the queue. + if test "$k" -eq 1 ; then + # The first file doesn't have a previous command to add. + eval concat_cmds=\"$reload_cmds $objlist $last_robj\" + else + # All subsequent reloadable object files will link in + # the last one created. + eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" + fi + last_robj=$output_objdir/$save_output-${k}.$objext + k=`expr $k + 1` + output=$output_objdir/$save_output-${k}.$objext + objlist=$obj + len=1 + fi + done + # Handle the remaining objects by creating one last + # reloadable object file. All subsequent reloadable object + # files will link in the last one created. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" + + if ${skipped_export-false}; then + $show "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $run $rm $export_symbols + libobjs=$output + # Append the command to create the export file. + eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" + fi + + # Set up a command to remove the reloadale object files + # after they are used. + i=0 + while test "$i" -lt "$k" + do + i=`expr $i + 1` + delfiles="$delfiles $output_objdir/$save_output-${i}.$objext" + done + + $echo "creating a temporary reloadable object file: $output" + + # Loop through the commands generated above and execute them. + save_ifs="$IFS"; IFS='~' + for cmd in $concat_cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + + libobjs=$output + # Restore the value of output. + output=$save_output + + if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + fi + # Expand the library linking commands again to reset the + # value of $libobjs for piecewise linking. + + # Do each of the archive commands. + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + eval cmds=\"$archive_expsym_cmds\" + else + eval cmds=\"$archive_cmds\" + fi + + # Append the command to remove the reloadable object files + # to the just-reset $cmds. + eval cmds=\"\$cmds~$rm $delfiles\" + fi + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + + # Restore the uninstalled library and exit + if test "$mode" = relink; then + $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? + exit 0 + fi + + # Create links to the real library. + for linkname in $linknames; do + if test "$realname" != "$linkname"; then + $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" + $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? + fi + done + + # If -module or -export-dynamic was specified, set the dlname. + if test "$module" = yes || test "$export_dynamic" = yes; then + # On all known operating systems, these are identical. + dlname="$soname" + fi + fi + ;; + + obj) + if test -n "$deplibs"; then + $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 + fi + + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 + fi + + if test -n "$rpath"; then + $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 + fi + + if test -n "$xrpath"; then + $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 + fi + + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 + fi + + case $output in + *.lo) + if test -n "$objs$old_deplibs"; then + $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 + exit 1 + fi + libobj="$output" + obj=`$echo "X$output" | $Xsed -e "$lo2o"` + ;; + *) + libobj= + obj="$output" + ;; + esac + + # Delete the old objects. + $run $rm $obj $libobj + + # Objects from convenience libraries. This assumes + # single-version convenience libraries. Whenever we create + # different ones for PIC/non-PIC, this we'll have to duplicate + # the extraction. + reload_conv_objs= + gentop= + # reload_cmds runs $LD directly, so let us get rid of + # -Wl from whole_archive_flag_spec + wl= + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" + else + gentop="$output_objdir/${obj}x" + $show "${rm}r $gentop" + $run ${rm}r "$gentop" + $show "$mkdir $gentop" + $run $mkdir "$gentop" + status=$? + if test "$status" -ne 0 && test ! -d "$gentop"; then + exit $status + fi + generated="$generated $gentop" + + for xlib in $convenience; do + # Extract the objects. + case $xlib in + [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; + *) xabs=`pwd`"/$xlib" ;; + esac + xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` + xdir="$gentop/$xlib" + + $show "${rm}r $xdir" + $run ${rm}r "$xdir" + $show "$mkdir $xdir" + $run $mkdir "$xdir" + status=$? + if test "$status" -ne 0 && test ! -d "$xdir"; then + exit $status + fi + # We will extract separately just the conflicting names and we will no + # longer touch any unique names. It is faster to leave these extract + # automatically by $AR in one run. + $show "(cd $xdir && $AR x $xabs)" + $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? + if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then + : + else + $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 + $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 + $AR t "$xabs" | sort | uniq -cd | while read -r count name + do + i=1 + while test "$i" -le "$count" + do + # Put our $i before any first dot (extension) + # Never overwrite any file + name_to="$name" + while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" + do + name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` + done + $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" + $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? + i=`expr $i + 1` + done + done + fi + + reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` + done + fi + fi + + # Create the old-style object. + reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test + + output="$obj" + eval cmds=\"$reload_cmds\" + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + + # Exit if we aren't doing a library object file. + if test -z "$libobj"; then + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop + fi + + exit 0 + fi + + if test "$build_libtool_libs" != yes; then + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop + fi + + # Create an invalid libtool object if no PIC, so that we don't + # accidentally link it into a program. + # $show "echo timestamp > $libobj" + # $run eval "echo timestamp > $libobj" || exit $? + exit 0 + fi + + if test -n "$pic_flag" || test "$pic_mode" != default; then + # Only do commands if we really have different PIC objects. + reload_objs="$libobjs $reload_conv_objs" + output="$libobj" + eval cmds=\"$reload_cmds\" + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + fi + + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop + fi + + exit 0 + ;; + + prog) + case $host in + *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; + esac + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 + fi + + if test "$preload" = yes; then + if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && + test "$dlopen_self_static" = unknown; then + $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." + fi + fi + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` + finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` + ;; + esac + + case $host in + *darwin*) + # Don't allow lazy linking, it breaks C++ global constructors + if test "$tagname" = CXX ; then + compile_command="$compile_command ${wl}-bind_at_load" + finalize_command="$finalize_command ${wl}-bind_at_load" + fi + ;; + esac + + compile_command="$compile_command $compile_deplibs" + finalize_command="$finalize_command $finalize_deplibs" + + if test -n "$rpath$xrpath"; then + # If the user specified any rpath flags, then add them. + for libdir in $rpath $xrpath; do + # This is the magic to use -rpath. + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" ;; + esac + done + fi + + # Now hardcode the library paths + rpath= + hardcode_libdirs= + for libdir in $compile_rpath $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + rpath="$rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) perm_rpath="$perm_rpath $libdir" ;; + esac + fi + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + case :$dllsearchpath: in + *":$libdir:"*) ;; + *) dllsearchpath="$dllsearchpath:$libdir";; + esac + ;; + esac + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + compile_rpath="$rpath" + + rpath= + hardcode_libdirs= + for libdir in $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + rpath="$rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$finalize_perm_rpath " in + *" $libdir "*) ;; + *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + finalize_rpath="$rpath" + + if test -n "$libobjs" && test "$build_old_libs" = yes; then + # Transform all the library objects into standard objects. + compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + fi + + dlsyms= + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + if test -n "$NM" && test -n "$global_symbol_pipe"; then + dlsyms="${outputname}S.c" + else + $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 + fi + fi + + if test -n "$dlsyms"; then + case $dlsyms in + "") ;; + *.c) + # Discover the nlist of each of the dlfiles. + nlist="$output_objdir/${outputname}.nm" + + $show "$rm $nlist ${nlist}S ${nlist}T" + $run $rm "$nlist" "${nlist}S" "${nlist}T" + + # Parse the name list into a source file. + $show "creating $output_objdir/$dlsyms" + + test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ +/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ +/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ + +#ifdef __cplusplus +extern \"C\" { +#endif + +/* Prevent the only kind of declaration conflicts we can make. */ +#define lt_preloaded_symbols some_other_symbol + +/* External symbol declarations for the compiler. */\ +" + + if test "$dlself" = yes; then + $show "generating symbol list for \`$output'" + + test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" + + # Add our own program objects to the symbol list. + progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + for arg in $progfiles; do + $show "extracting global C symbols from \`$arg'" + $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" + done + + if test -n "$exclude_expsyms"; then + $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' + $run eval '$mv "$nlist"T "$nlist"' + fi + + if test -n "$export_symbols_regex"; then + $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' + $run eval '$mv "$nlist"T "$nlist"' + fi + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + export_symbols="$output_objdir/$output.exp" + $run $rm $export_symbols + $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + else + $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"' + $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T' + $run eval 'mv "$nlist"T "$nlist"' + fi + fi + + for arg in $dlprefiles; do + $show "extracting global C symbols from \`$arg'" + name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` + $run eval '$echo ": $name " >> "$nlist"' + $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" + done + + if test -z "$run"; then + # Make sure we have at least an empty file. + test -f "$nlist" || : > "$nlist" + + if test -n "$exclude_expsyms"; then + $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T + $mv "$nlist"T "$nlist" + fi + + # Try sorting and uniquifying the output. + if grep -v "^: " < "$nlist" | + if sort -k 3 /dev/null 2>&1; then + sort -k 3 + else + sort +2 + fi | + uniq > "$nlist"S; then + : + else + grep -v "^: " < "$nlist" > "$nlist"S + fi + + if test -f "$nlist"S; then + eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' + else + $echo '/* NONE */' >> "$output_objdir/$dlsyms" + fi + + $echo >> "$output_objdir/$dlsyms" "\ + +#undef lt_preloaded_symbols + +#if defined (__STDC__) && __STDC__ +# define lt_ptr void * +#else +# define lt_ptr char * +# define const +#endif + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + lt_ptr address; +} +lt_preloaded_symbols[] = +{\ +" + + eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" + + $echo >> "$output_objdir/$dlsyms" "\ + {0, (lt_ptr) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif\ +" + fi + + pic_flag_for_symtable= + case $host in + # compiling the symbol table file with pic_flag works around + # a FreeBSD bug that causes programs to crash when -lm is + # linked before any other PIC object. But we must not use + # pic_flag when linking with -static. The problem exists in + # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. + *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) + case "$compile_command " in + *" -static "*) ;; + *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; + esac;; + *-*-hpux*) + case "$compile_command " in + *" -static "*) ;; + *) pic_flag_for_symtable=" $pic_flag";; + esac + esac + + # Now compile the dynamic symbol file. + $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" + $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? + + # Clean up the generated files. + $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" + $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" + + # Transform the symbol file into the correct name. + compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` + finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` + ;; + *) + $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 + exit 1 + ;; + esac + else + # We keep going just in case the user didn't refer to + # lt_preloaded_symbols. The linker will fail if global_symbol_pipe + # really was required. + + # Nullify the symbol file. + compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` + finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` + fi + + # AIX runtime linking requires linking programs with -Wl,-brtl and libs with -Wl,-G + # Also add -bnolibpath to the beginning of the link line, to clear the hardcoded runpath. + # Otherwise, things like the -L path to libgcc.a are accidentally hardcoded by ld. + # This does not apply on AIX for ia64, which uses a SysV linker. + case "$host" in + ia64-*-aix5*) ;; + *-*-aix4* | *-*-aix5*) + compile_command=`$echo "X$compile_command $wl-brtl" | $Xsed -e "s/\$CC/\$CC $wl-bnolibpath/1"` + finalize_command=`$echo "X$finalize_command $wl-brtl" | $Xsed -e "s/\$CC/\$CC $wl-bnolibpath/1"` ;; + esac + + if test "$need_relink" = no || test "$build_libtool_libs" != yes; then + # Replace the output file specification. + compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` + link_command="$compile_command$compile_rpath" + + # We have no uninstalled library dependencies, so finalize right now. + $show "$link_command" + $run eval "$link_command" + status=$? + + # Delete the generated files. + if test -n "$dlsyms"; then + $show "$rm $output_objdir/${outputname}S.${objext}" + $run $rm "$output_objdir/${outputname}S.${objext}" + fi + + exit $status + fi + + if test -n "$shlibpath_var"; then + # We should set the shlibpath_var + rpath= + for dir in $temp_rpath; do + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) + # Absolute path. + rpath="$rpath$dir:" + ;; + *) + # Relative path: add a thisdir entry. + rpath="$rpath\$thisdir/$dir:" + ;; + esac + done + temp_rpath="$rpath" + fi + + if test -n "$compile_shlibpath$finalize_shlibpath"; then + compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" + fi + if test -n "$finalize_shlibpath"; then + finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" + fi + + compile_var= + finalize_var= + if test -n "$runpath_var"; then + if test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + rpath="$rpath$dir:" + done + compile_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + if test -n "$finalize_perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $finalize_perm_rpath; do + rpath="$rpath$dir:" + done + finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + fi + + if test "$no_install" = yes; then + # We don't need to create a wrapper script. + link_command="$compile_var$compile_command$compile_rpath" + # Replace the output file specification. + link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` + # Delete the old output file. + $run $rm $output + # Link the executable and exit + $show "$link_command" + $run eval "$link_command" || exit $? + exit 0 + fi + + if test "$hardcode_action" = relink; then + # Fast installation is not supported + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + + $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 + $echo "$modename: \`$output' will be relinked during installation" 1>&2 + else + if test "$fast_install" != no; then + link_command="$finalize_var$compile_command$finalize_rpath" + if test "$fast_install" = yes; then + relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` + else + # fast_install is set to needless + relink_command= + fi + else + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + fi + fi + + # Replace the output file specification. + link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + + # Delete the old output files. + $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname + + $show "$link_command" + $run eval "$link_command" || exit $? + + # Now create the wrapper script. + $show "creating $output" + + # Quote the relink command for shipping. + if test -n "$relink_command"; then + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` + relink_command="$var=\"$var_value\"; export $var; $relink_command" + fi + done + relink_command="(cd `pwd`; $relink_command)" + relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` + fi + + # Quote $echo for shipping. + if test "X$echo" = "X$SHELL $0 --fallback-echo"; then + case $0 in + [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";; + *) qecho="$SHELL `pwd`/$0 --fallback-echo";; + esac + qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` + else + qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` + fi + + # Only actually do things if our run command is non-null. + if test -z "$run"; then + # win32 will think the script is a binary if it has + # a .exe suffix, so we strip it off here. + case $output in + *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; + esac + # test for cygwin because mv fails w/o .exe extensions + case $host in + *cygwin*) + exeext=.exe + outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; + *) exeext= ;; + esac + case $host in + *cygwin* | *mingw* ) + cwrappersource=`$echo ${objdir}/lt-${output}.c` + cwrapper=`$echo ${output}.exe` + $rm $cwrappersource $cwrapper + trap "$rm $cwrappersource $cwrapper; exit 1" 1 2 15 + + cat > $cwrappersource <> $cwrappersource<<"EOF" +#include +#include +#include +#include +#include +#include + +#if defined(PATH_MAX) +# define LT_PATHMAX PATH_MAX +#elif defined(MAXPATHLEN) +# define LT_PATHMAX MAXPATHLEN +#else +# define LT_PATHMAX 1024 +#endif + +#ifndef DIR_SEPARATOR +#define DIR_SEPARATOR '/' +#endif + +#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ + defined (__OS2__) +#define HAVE_DOS_BASED_FILE_SYSTEM +#ifndef DIR_SEPARATOR_2 +#define DIR_SEPARATOR_2 '\\' +#endif +#endif + +#ifndef DIR_SEPARATOR_2 +# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) +#else /* DIR_SEPARATOR_2 */ +# define IS_DIR_SEPARATOR(ch) \ + (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) +#endif /* DIR_SEPARATOR_2 */ + +#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) +#define XFREE(stale) do { \ + if (stale) { free ((void *) stale); stale = 0; } \ +} while (0) + +const char *program_name = NULL; + +void * xmalloc (size_t num); +char * xstrdup (const char *string); +char * basename (const char *name); +char * fnqualify(const char *path); +char * strendzap(char *str, const char *pat); +void lt_fatal (const char *message, ...); + +int +main (int argc, char *argv[]) +{ + char **newargz; + int i; + + program_name = (char *) xstrdup ((char *) basename (argv[0])); + newargz = XMALLOC(char *, argc+2); +EOF + + cat >> $cwrappersource <> $cwrappersource <<"EOF" + newargz[1] = fnqualify(argv[0]); + /* we know the script has the same name, without the .exe */ + /* so make sure newargz[1] doesn't end in .exe */ + strendzap(newargz[1],".exe"); + for (i = 1; i < argc; i++) + newargz[i+1] = xstrdup(argv[i]); + newargz[argc+1] = NULL; +EOF + + cat >> $cwrappersource <> $cwrappersource <<"EOF" +} + +void * +xmalloc (size_t num) +{ + void * p = (void *) malloc (num); + if (!p) + lt_fatal ("Memory exhausted"); + + return p; +} + +char * +xstrdup (const char *string) +{ + return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL +; +} + +char * +basename (const char *name) +{ + const char *base; + +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + /* Skip over the disk name in MSDOS pathnames. */ + if (isalpha (name[0]) && name[1] == ':') + name += 2; +#endif + + for (base = name; *name; name++) + if (IS_DIR_SEPARATOR (*name)) + base = name + 1; + return (char *) base; +} + +char * +fnqualify(const char *path) +{ + size_t size; + char *p; + char tmp[LT_PATHMAX + 1]; + + assert(path != NULL); + + /* Is it qualified already? */ +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + if (isalpha (path[0]) && path[1] == ':') + return xstrdup (path); +#endif + if (IS_DIR_SEPARATOR (path[0])) + return xstrdup (path); + + /* prepend the current directory */ + /* doesn't handle '~' */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal ("getcwd failed"); + size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */ + p = XMALLOC(char, size); + sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path); + return p; +} + +char * +strendzap(char *str, const char *pat) +{ + size_t len, patlen; + + assert(str != NULL); + assert(pat != NULL); + + len = strlen(str); + patlen = strlen(pat); + + if (patlen <= len) + { + str += len - patlen; + if (strcmp(str, pat) == 0) + *str = '\0'; + } + return str; +} + +static void +lt_error_core (int exit_status, const char * mode, + const char * message, va_list ap) +{ + fprintf (stderr, "%s: %s: ", program_name, mode); + vfprintf (stderr, message, ap); + fprintf (stderr, ".\n"); + + if (exit_status >= 0) + exit (exit_status); +} + +void +lt_fatal (const char *message, ...) +{ + va_list ap; + va_start (ap, message); + lt_error_core (EXIT_FAILURE, "FATAL", message, ap); + va_end (ap); +} +EOF + # we should really use a build-platform specific compiler + # here, but OTOH, the wrappers (shell script and this C one) + # are only useful if you want to execute the "real" binary. + # Since the "real" binary is built for $host, then this + # wrapper might as well be built for $host, too. + $run $LTCC -s -o $cwrapper $cwrappersource + ;; + esac + $rm $output + trap "$rm $output; exit 1" 1 2 15 + + $echo > $output "\ +#! $SHELL + +# $output - temporary wrapper script for $objdir/$outputname +# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP +# +# The $output program cannot be directly executed until all the libtool +# libraries that it depends on are installed. +# +# This wrapper script should never be moved out of the build directory. +# If it is, it will not operate correctly. + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='${SED} -e 1s/^X//' +sed_quote_subst='$sed_quote_subst' + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi + +relink_command=\"$relink_command\" + +# This environment variable determines our operation mode. +if test \"\$libtool_install_magic\" = \"$magic\"; then + # install mode needs the following variable: + notinst_deplibs='$notinst_deplibs' +else + # When we are sourced in execute mode, \$file and \$echo are already set. + if test \"\$libtool_execute_magic\" != \"$magic\"; then + echo=\"$qecho\" + file=\"\$0\" + # Make sure echo works. + if test \"X\$1\" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift + elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then + # Yippee, \$echo works! + : + else + # Restart under the correct shell, and then maybe \$echo will work. + exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} + fi + fi\ +" + $echo >> $output "\ + + # Find the directory that this script lives in. + thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` + test \"x\$thisdir\" = \"x\$file\" && thisdir=. + + # Follow symbolic links until we get to the real thisdir. + file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` + while test -n \"\$file\"; do + destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` + + # If there was a directory component, then change thisdir. + if test \"x\$destdir\" != \"x\$file\"; then + case \"\$destdir\" in + [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; + *) thisdir=\"\$thisdir/\$destdir\" ;; + esac + fi + + file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` + done + + # Try to get the absolute directory name. + absdir=\`cd \"\$thisdir\" && pwd\` + test -n \"\$absdir\" && thisdir=\"\$absdir\" +" + + if test "$fast_install" = yes; then + $echo >> $output "\ + program=lt-'$outputname'$exeext + progdir=\"\$thisdir/$objdir\" + + if test ! -f \"\$progdir/\$program\" || \\ + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ + test \"X\$file\" != \"X\$progdir/\$program\"; }; then + + file=\"\$\$-\$program\" + + if test ! -d \"\$progdir\"; then + $mkdir \"\$progdir\" + else + $rm \"\$progdir/\$file\" + fi" + + $echo >> $output "\ + + # relink executable if necessary + if test -n \"\$relink_command\"; then + if relink_command_output=\`eval \$relink_command 2>&1\`; then : + else + $echo \"\$relink_command_output\" >&2 + $rm \"\$progdir/\$file\" + exit 1 + fi + fi + + $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || + { $rm \"\$progdir/\$program\"; + $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } + $rm \"\$progdir/\$file\" + fi" + else + $echo >> $output "\ + program='$outputname' + progdir=\"\$thisdir/$objdir\" +" + fi + + $echo >> $output "\ + + if test -f \"\$progdir/\$program\"; then" + + # Export our shlibpath_var if we have one. + if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + $echo >> $output "\ + # Add our own library path to $shlibpath_var + $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" + + # Some systems cannot cope with colon-terminated $shlibpath_var + # The second colon is a workaround for a bug in BeOS R4 sed + $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` + + export $shlibpath_var +" + fi + + # fixup the dll searchpath if we need to. + if test -n "$dllsearchpath"; then + $echo >> $output "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + + $echo >> $output "\ + if test \"\$libtool_execute_magic\" != \"$magic\"; then + # Run the actual program with our arguments. +" + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2*) + $echo >> $output "\ + exec \$progdir\\\\\$program \${1+\"\$@\"} +" + ;; + + *) + $echo >> $output "\ + exec \$progdir/\$program \${1+\"\$@\"} +" + ;; + esac + $echo >> $output "\ + \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" + exit 1 + fi + else + # The program doesn't exist. + \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2 + \$echo \"This script is just a wrapper for \$program.\" 1>&2 + $echo \"See the $PACKAGE documentation for more information.\" 1>&2 + exit 1 + fi +fi\ +" + chmod +x $output + fi + exit 0 + ;; + esac + + # See if we need to build an old-fashioned archive. + for oldlib in $oldlibs; do + + if test "$build_libtool_libs" = convenience; then + oldobjs="$libobjs_save" + addlibs="$convenience" + build_libtool_libs=no + else + if test "$build_libtool_libs" = module; then + oldobjs="$libobjs_save" + build_libtool_libs=no + else + oldobjs="$old_deplibs $non_pic_objects" + fi + addlibs="$old_convenience" + fi + + if test -n "$addlibs"; then + gentop="$output_objdir/${outputname}x" + $show "${rm}r $gentop" + $run ${rm}r "$gentop" + $show "$mkdir $gentop" + $run $mkdir "$gentop" + status=$? + if test "$status" -ne 0 && test ! -d "$gentop"; then + exit $status + fi + generated="$generated $gentop" + + # Add in members from convenience archives. + for xlib in $addlibs; do + # Extract the objects. + case $xlib in + [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; + *) xabs=`pwd`"/$xlib" ;; + esac + xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` + xdir="$gentop/$xlib" + + $show "${rm}r $xdir" + $run ${rm}r "$xdir" + $show "$mkdir $xdir" + $run $mkdir "$xdir" + status=$? + if test "$status" -ne 0 && test ! -d "$xdir"; then + exit $status + fi + # We will extract separately just the conflicting names and we will no + # longer touch any unique names. It is faster to leave these extract + # automatically by $AR in one run. + $show "(cd $xdir && $AR x $xabs)" + $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? + if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then + : + else + $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 + $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 + $AR t "$xabs" | sort | uniq -cd | while read -r count name + do + i=1 + while test "$i" -le "$count" + do + # Put our $i before any first dot (extension) + # Never overwrite any file + name_to="$name" + while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" + do + name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` + done + $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" + $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? + i=`expr $i + 1` + done + done + fi + + oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP` + done + fi + + compiler_flags="$compiler_flags $add_flags" + + # Do each command in the archive commands. + if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then + eval cmds=\"$old_archive_from_new_cmds\" + else + eval cmds=\"$old_archive_cmds\" + + if len=`expr "X$cmds" : ".*"` && + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then + : + else + # the command line is too long to link in one step, link in parts + $echo "using piecewise archive linking..." + save_RANLIB=$RANLIB + RANLIB=: + objlist= + concat_cmds= + save_oldobjs=$oldobjs + # GNU ar 2.10+ was changed to match POSIX; thus no paths are + # encoded into archives. This makes 'ar r' malfunction in + # this piecewise linking case whenever conflicting object + # names appear in distinct ar calls; check, warn and compensate. + if (for obj in $save_oldobjs + do + $echo "X$obj" | $Xsed -e 's%^.*/%%' + done | sort | sort -uc >/dev/null 2>&1); then + : + else + $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2 + $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2 + AR_FLAGS=cq + fi + # Is there a better way of finding the last object in the list? + for obj in $save_oldobjs + do + last_oldobj=$obj + done + for obj in $save_oldobjs + do + oldobjs="$objlist $obj" + objlist="$objlist $obj" + eval test_cmds=\"$old_archive_cmds\" + if len=`expr "X$test_cmds" : ".*"` && + test "$len" -le "$max_cmd_len"; then + : + else + # the above command should be used before it gets too long + oldobjs=$objlist + if test "$obj" = "$last_oldobj" ; then + RANLIB=$save_RANLIB + fi + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" + objlist= + fi + done + RANLIB=$save_RANLIB + oldobjs=$objlist + if test "X$oldobjs" = "X" ; then + eval cmds=\"\$concat_cmds\" + else + eval cmds=\"\$concat_cmds~$old_archive_cmds\" + fi + fi + fi + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + done + + if test -n "$generated"; then + $show "${rm}r$generated" + $run ${rm}r$generated + fi + + # Now create the libtool archive. + case $output in + *.la) + old_library= + test "$build_old_libs" = yes && old_library="$libname.$libext" + $show "creating $output" + + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` + relink_command="$var=\"$var_value\"; export $var; $relink_command" + fi + done + # Quote the link command for shipping. + relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)" + relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` + if test "$hardcode_automatic" = yes ; then + relink_command= + fi + # Only create the output if not a dry run. + if test -z "$run"; then + for installed in no yes; do + if test "$installed" = yes; then + if test -z "$install_libdir"; then + break + fi + output="$output_objdir/$outputname"i + # Replace all uninstalled libtool libraries with the installed ones + newdependency_libs= + for deplib in $dependency_libs; do + case $deplib in + *.la) + name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + if test -z "$libdir"; then + $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 + exit 1 + fi + newdependency_libs="$newdependency_libs $libdir/$name" + ;; + *) newdependency_libs="$newdependency_libs $deplib" ;; + esac + done + dependency_libs="$newdependency_libs" + newdlfiles= + for lib in $dlfiles; do + name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + if test -z "$libdir"; then + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit 1 + fi + newdlfiles="$newdlfiles $libdir/$name" + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + if test -z "$libdir"; then + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + exit 1 + fi + newdlprefiles="$newdlprefiles $libdir/$name" + done + dlprefiles="$newdlprefiles" + fi + $rm $output + # place dlname in correct position for cygwin + tdlname=$dlname + case $host,$output,$installed,$module,$dlname in + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; + esac + $echo > $output "\ +# $outputname - a libtool library file +# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='$tdlname' + +# Names of this library. +library_names='$library_names' + +# The name of the static archive. +old_library='$old_library' + +# Libraries that this one depends upon. +dependency_libs='$dependency_libs' + +# Version information for $libname. +current=$current +age=$age +revision=$revision + +# Is this an already installed library? +installed=$installed + +# Should we warn about portability when linking against -modules? +shouldnotlink=$module + +# Files to dlopen/dlpreopen +dlopen='$dlfiles' +dlpreopen='$dlprefiles' + +# Directory that this library needs to be installed in: +libdir='$install_libdir'" + if test "$installed" = no && test "$need_relink" = yes && test "$fast_install" = no; then + $echo >> $output "\ +relink_command=\"$relink_command\"" + fi + done + fi + + # Do a symbolic link so that the libtool archive can be found in + # LD_LIBRARY_PATH before the program is installed. + $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" + $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? + ;; + esac + exit 0 + ;; + + # libtool install mode + install) + modename="$modename: install" + + # There may be an optional sh(1) argument at the beginning of + # install_prog (especially on Windows NT). + if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || + # Allow the use of GNU shtool's install command. + $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then + # Aesthetically quote it. + arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) + arg="\"$arg\"" + ;; + esac + install_prog="$arg " + arg="$1" + shift + else + install_prog= + arg="$nonopt" + fi + + # The real first argument should be the name of the installation program. + # Aesthetically quote it. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) + arg="\"$arg\"" + ;; + esac + install_prog="$install_prog$arg" + + # We need to accept at least all the BSD install flags. + dest= + files= + opts= + prev= + install_type= + isdir=no + stripme= + for arg + do + if test -n "$dest"; then + files="$files $dest" + dest="$arg" + continue + fi + + case $arg in + -d) isdir=yes ;; + -f) prev="-f" ;; + -g) prev="-g" ;; + -m) prev="-m" ;; + -o) prev="-o" ;; + -s) + stripme=" -s" + continue + ;; + -*) ;; + + *) + # If the previous option needed an argument, then skip it. + if test -n "$prev"; then + prev= + else + dest="$arg" + continue + fi + ;; + esac + + # Aesthetically quote the argument. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case $arg in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) + arg="\"$arg\"" + ;; + esac + install_prog="$install_prog $arg" + done + + if test -z "$install_prog"; then + $echo "$modename: you must specify an install program" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + if test -n "$prev"; then + $echo "$modename: the \`$prev' option requires an argument" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + if test -z "$files"; then + if test -z "$dest"; then + $echo "$modename: no file or destination specified" 1>&2 + else + $echo "$modename: you must specify a destination" 1>&2 + fi + $echo "$help" 1>&2 + exit 1 + fi + + # Strip any trailing slash from the destination. + dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` + + # Check to see that the destination is a directory. + test -d "$dest" && isdir=yes + if test "$isdir" = yes; then + destdir="$dest" + destname= + else + destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` + test "X$destdir" = "X$dest" && destdir=. + destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` + + # Not a directory, so check to see that there is only one file specified. + set dummy $files + if test "$#" -gt 2; then + $echo "$modename: \`$dest' is not a directory" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + fi + case $destdir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + for file in $files; do + case $file in + *.lo) ;; + *) + $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 + $echo "$help" 1>&2 + exit 1 + ;; + esac + done + ;; + esac + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + staticlibs= + future_libdirs= + current_libdirs= + for file in $files; do + + # Do each installation. + case $file in + *.$libext) + # Do the static libraries later. + staticlibs="$staticlibs $file" + ;; + + *.la) + # Check to see that this really is a libtool archive. + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + library_names= + old_library= + relink_command= + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + # Add the libdir to current_libdirs if it is the destination. + if test "X$destdir" = "X$libdir"; then + case "$current_libdirs " in + *" $libdir "*) ;; + *) current_libdirs="$current_libdirs $libdir" ;; + esac + else + # Note the libdir as a future libdir. + case "$future_libdirs " in + *" $libdir "*) ;; + *) future_libdirs="$future_libdirs $libdir" ;; + esac + fi + + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ + test "X$dir" = "X$file/" && dir= + dir="$dir$objdir" + + if test -n "$relink_command"; then + # Determine the prefix the user has applied to our future dir. + inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` + + # Don't allow the user to place us outside of our expected + # location b/c this prevents finding dependent libraries that + # are installed to the same prefix. + # At present, this check doesn't affect windows .dll's that + # are installed into $libdir/../bin (currently, that works fine) + # but it's something to keep an eye on. + if test "$inst_prefix_dir" = "$destdir"; then + $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 + exit 1 + fi + + if test -n "$inst_prefix_dir"; then + # Stick the inst_prefix_dir data into the link command. + relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` + else + relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"` + fi + + $echo "$modename: warning: relinking \`$file'" 1>&2 + $show "$relink_command" + if $run eval "$relink_command"; then : + else + $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 + exit 1 + fi + fi + + # See the names of the shared library. + set dummy $library_names + if test -n "$2"; then + realname="$2" + shift + shift + + srcname="$realname" + test -n "$relink_command" && srcname="$realname"T + + # Install the shared library and build the symlinks. + $show "$install_prog $dir/$srcname $destdir/$realname" + $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? + if test -n "$stripme" && test -n "$striplib"; then + $show "$striplib $destdir/$realname" + $run eval "$striplib $destdir/$realname" || exit $? + fi + + if test "$#" -gt 0; then + # Delete the old symlinks, and create new ones. + for linkname + do + if test "$linkname" != "$realname"; then + $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" + $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" + fi + done + fi + + # Do each command in the postinstall commands. + lib="$destdir/$realname" + eval cmds=\"$postinstall_cmds\" + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + fi + + # Install the pseudo-library for information purposes. + name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + instname="$dir/$name"i + $show "$install_prog $instname $destdir/$name" + $run eval "$install_prog $instname $destdir/$name" || exit $? + + # Maybe install the static library, too. + test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" + ;; + + *.lo) + # Install (i.e. copy) a libtool object. + + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + destfile="$destdir/$destfile" + fi + + # Deduce the name of the destination old-style object file. + case $destfile in + *.lo) + staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` + ;; + *.$objext) + staticdest="$destfile" + destfile= + ;; + *) + $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 + $echo "$help" 1>&2 + exit 1 + ;; + esac + + # Install the libtool object if requested. + if test -n "$destfile"; then + $show "$install_prog $file $destfile" + $run eval "$install_prog $file $destfile" || exit $? + fi + + # Install the old object if enabled. + if test "$build_old_libs" = yes; then + # Deduce the name of the old-style object file. + staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` + + $show "$install_prog $staticobj $staticdest" + $run eval "$install_prog \$staticobj \$staticdest" || exit $? + fi + exit 0 + ;; + + *) + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + destfile="$destdir/$destfile" + fi + + # If the file is missing, and there is a .exe on the end, strip it + # because it is most likely a libtool script we actually want to + # install + stripped_ext="" + case $file in + *.exe) + if test ! -f "$file"; then + file=`$echo $file|${SED} 's,.exe$,,'` + stripped_ext=".exe" + fi + ;; + esac + + # Do a test to see if this is really a libtool program. + case $host in + *cygwin*|*mingw*) + wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` + ;; + *) + wrapper=$file + ;; + esac + if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then + notinst_deplibs= + relink_command= + + # To insure that "foo" is sourced, and not "foo.exe", + # finese the cygwin/MSYS system by explicitly sourcing "foo." + # which disallows the automatic-append-.exe behavior. + case $build in + *cygwin* | *mingw*) wrapperdot=${wrapper}. ;; + *) wrapperdot=${wrapper} ;; + esac + # If there is no directory component, then add one. + case $file in + */* | *\\*) . ${wrapperdot} ;; + *) . ./${wrapperdot} ;; + esac + + # Check the variables that should have been set. + if test -z "$notinst_deplibs"; then + $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 + exit 1 + fi + + finalize=yes + for lib in $notinst_deplibs; do + # Check to see that each library is installed. + libdir= + if test -f "$lib"; then + # If there is no directory component, then add one. + case $lib in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + esac + fi + libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test + if test -n "$libdir" && test ! -f "$libfile"; then + $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 + finalize=no + fi + done + + relink_command= + # To insure that "foo" is sourced, and not "foo.exe", + # finese the cygwin/MSYS system by explicitly sourcing "foo." + # which disallows the automatic-append-.exe behavior. + case $build in + *cygwin* | *mingw*) wrapperdot=${wrapper}. ;; + *) wrapperdot=${wrapper} ;; + esac + # If there is no directory component, then add one. + case $file in + */* | *\\*) . ${wrapperdot} ;; + *) . ./${wrapperdot} ;; + esac + + outputname= + if test "$fast_install" = no && test -n "$relink_command"; then + if test "$finalize" = yes && test -z "$run"; then + tmpdir="/tmp" + test -n "$TMPDIR" && tmpdir="$TMPDIR" + tmpdir="$tmpdir/libtool-$$" + if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then : + else + $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 + continue + fi + file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` + outputname="$tmpdir/$file" + # Replace the output file specification. + relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` + + $show "$relink_command" + if $run eval "$relink_command"; then : + else + $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 + ${rm}r "$tmpdir" + continue + fi + file="$outputname" + else + $echo "$modename: warning: cannot relink \`$file'" 1>&2 + fi + else + # Install the binary that we compiled earlier. + file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` + fi + fi + + # remove .exe since cygwin /usr/bin/install will append another + # one anyways + case $install_prog,$host in + */usr/bin/install*,*cygwin*) + case $file:$destfile in + *.exe:*.exe) + # this is ok + ;; + *.exe:*) + destfile=$destfile.exe + ;; + *:*.exe) + destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` + ;; + esac + ;; + esac + $show "$install_prog$stripme $file $destfile" + $run eval "$install_prog\$stripme \$file \$destfile" || exit $? + test -n "$outputname" && ${rm}r "$tmpdir" + ;; + esac + done + + for file in $staticlibs; do + name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + + # Set up the ranlib parameters. + oldlib="$destdir/$name" + + $show "$install_prog $file $oldlib" + $run eval "$install_prog \$file \$oldlib" || exit $? + + if test -n "$stripme" && test -n "$striplib"; then + $show "$old_striplib $oldlib" + $run eval "$old_striplib $oldlib" || exit $? + fi + + # Do each command in the postinstall commands. + eval cmds=\"$old_postinstall_cmds\" + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + done + + if test -n "$future_libdirs"; then + $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 + fi + + if test -n "$current_libdirs"; then + # Maybe just do a dry run. + test -n "$run" && current_libdirs=" -n$current_libdirs" + exec_cmd='$SHELL $0 --finish$current_libdirs' + else + exit 0 + fi + ;; + + # libtool finish mode + finish) + modename="$modename: finish" + libdirs="$nonopt" + admincmds= + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + for dir + do + libdirs="$libdirs $dir" + done + + for libdir in $libdirs; do + if test -n "$finish_cmds"; then + # Do each command in the finish commands. + eval cmds=\"$finish_cmds\" + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || admincmds="$admincmds + $cmd" + done + IFS="$save_ifs" + fi + if test -n "$finish_eval"; then + # Do the single finish_eval. + eval cmds=\"$finish_eval\" + $run eval "$cmds" || admincmds="$admincmds + $cmds" + fi + done + fi + + # Exit here if they wanted silent mode. + exit 0 + + $echo "----------------------------------------------------------------------" + $echo "Libraries have been installed in:" + for libdir in $libdirs; do + $echo " $libdir" + done + $echo + $echo "If you ever happen to want to link against installed libraries" + $echo "in a given directory, LIBDIR, you must either use libtool, and" + $echo "specify the full pathname of the library, or use the \`-LLIBDIR'" + $echo "flag during linking and do at least one of the following:" + if test -n "$shlibpath_var"; then + $echo " - add LIBDIR to the \`$shlibpath_var' environment variable" + $echo " during execution" + fi + if test -n "$runpath_var"; then + $echo " - add LIBDIR to the \`$runpath_var' environment variable" + $echo " during linking" + fi + if test -n "$hardcode_libdir_flag_spec"; then + libdir=LIBDIR + eval flag=\"$hardcode_libdir_flag_spec\" + + $echo " - use the \`$flag' linker flag" + fi + if test -n "$admincmds"; then + $echo " - have your system administrator run these commands:$admincmds" + fi + if test -f /etc/ld.so.conf; then + $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" + fi + $echo + $echo "See any operating system documentation about shared libraries for" + $echo "more information, such as the ld(1) and ld.so(8) manual pages." + $echo "----------------------------------------------------------------------" + exit 0 + ;; + + # libtool execute mode + execute) + modename="$modename: execute" + + # The first argument is the command name. + cmd="$nonopt" + if test -z "$cmd"; then + $echo "$modename: you must specify a COMMAND" 1>&2 + $echo "$help" + exit 1 + fi + + # Handle -dlopen flags immediately. + for file in $execute_dlfiles; do + if test ! -f "$file"; then + $echo "$modename: \`$file' is not a file" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + dir= + case $file in + *.la) + # Check to see that this really is a libtool archive. + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + # Read the libtool library. + dlname= + library_names= + + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + # Skip this library if it cannot be dlopened. + if test -z "$dlname"; then + # Warn if it was a shared library. + test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" + continue + fi + + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + test "X$dir" = "X$file" && dir=. + + if test -f "$dir/$objdir/$dlname"; then + dir="$dir/$objdir" + else + $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 + exit 1 + fi + ;; + + *.lo) + # Just add the directory containing the .lo file. + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + test "X$dir" = "X$file" && dir=. + ;; + + *) + $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 + continue + ;; + esac + + # Get the absolute pathname. + absdir=`cd "$dir" && pwd` + test -n "$absdir" && dir="$absdir" + + # Now add the directory to shlibpath_var. + if eval "test -z \"\$$shlibpath_var\""; then + eval "$shlibpath_var=\"\$dir\"" + else + eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" + fi + done + + # This variable tells wrapper scripts just to set shlibpath_var + # rather than running their programs. + libtool_execute_magic="$magic" + + # Check if any of the arguments is a wrapper script. + args= + for file + do + case $file in + -*) ;; + *) + # Do a test to see if this is really a libtool program. + if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + # If there is no directory component, then add one. + case $file in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + # Transform arg to wrapped name. + file="$progdir/$program" + fi + ;; + esac + # Quote arguments (to preserve shell metacharacters). + file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` + args="$args \"$file\"" + done + + if test -z "$run"; then + if test -n "$shlibpath_var"; then + # Export the shlibpath_var. + eval "export $shlibpath_var" + fi + + # Restore saved environment variables + if test "${save_LC_ALL+set}" = set; then + LC_ALL="$save_LC_ALL"; export LC_ALL + fi + if test "${save_LANG+set}" = set; then + LANG="$save_LANG"; export LANG + fi + + # Now prepare to actually exec the command. + exec_cmd="\$cmd$args" + else + # Display what would be done. + if test -n "$shlibpath_var"; then + eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" + $echo "export $shlibpath_var" + fi + $echo "$cmd$args" + exit 0 + fi + ;; + + # libtool clean and uninstall mode + clean | uninstall) + modename="$modename: $mode" + rm="$nonopt" + files= + rmforce= + exit_status=0 + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + for arg + do + case $arg in + -f) rm="$rm $arg"; rmforce=yes ;; + -*) rm="$rm $arg" ;; + *) files="$files $arg" ;; + esac + done + + if test -z "$rm"; then + $echo "$modename: you must specify an RM program" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + rmdirs= + + origobjdir="$objdir" + for file in $files; do + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + if test "X$dir" = "X$file"; then + dir=. + objdir="$origobjdir" + else + objdir="$dir/$origobjdir" + fi + name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + test "$mode" = uninstall && objdir="$dir" + + # Remember objdir for removal later, being careful to avoid duplicates + if test "$mode" = clean; then + case " $rmdirs " in + *" $objdir "*) ;; + *) rmdirs="$rmdirs $objdir" ;; + esac + fi + + # Don't error if the file doesn't exist and rm -f was used. + if (test -L "$file") >/dev/null 2>&1 \ + || (test -h "$file") >/dev/null 2>&1 \ + || test -f "$file"; then + : + elif test -d "$file"; then + exit_status=1 + continue + elif test "$rmforce" = yes; then + continue + fi + + rmfiles="$file" + + case $name in + *.la) + # Possibly a libtool archive, so verify it. + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + . $dir/$name + + # Delete the libtool libraries and symlinks. + for n in $library_names; do + rmfiles="$rmfiles $objdir/$n" + done + test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" + test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" + + if test "$mode" = uninstall; then + if test -n "$library_names"; then + # Do each command in the postuninstall commands. + eval cmds=\"$postuninstall_cmds\" + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" + if test "$?" -ne 0 && test "$rmforce" != yes; then + exit_status=1 + fi + done + IFS="$save_ifs" + fi + + if test -n "$old_library"; then + # Do each command in the old_postuninstall commands. + eval cmds=\"$old_postuninstall_cmds\" + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" + if test "$?" -ne 0 && test "$rmforce" != yes; then + exit_status=1 + fi + done + IFS="$save_ifs" + fi + # FIXME: should reinstall the best remaining shared library. + fi + fi + ;; + + *.lo) + # Possibly a libtool object, so verify it. + if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + + # Read the .lo file + . $dir/$name + + # Add PIC object to the list of files to remove. + if test -n "$pic_object" \ + && test "$pic_object" != none; then + rmfiles="$rmfiles $dir/$pic_object" + fi + + # Add non-PIC object to the list of files to remove. + if test -n "$non_pic_object" \ + && test "$non_pic_object" != none; then + rmfiles="$rmfiles $dir/$non_pic_object" + fi + fi + ;; + + *) + if test "$mode" = clean ; then + noexename=$name + case $file in + *.exe) + file=`$echo $file|${SED} 's,.exe$,,'` + noexename=`$echo $name|${SED} 's,.exe$,,'` + # $file with .exe has already been added to rmfiles, + # add $file without .exe + rmfiles="$rmfiles $file" + ;; + esac + # Do a test to see if this is a libtool program. + if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + relink_command= + . $dir/$noexename + + # note $name still contains .exe if it was in $file originally + # as does the version of $file that was added into $rmfiles + rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" + if test "$fast_install" = yes && test -n "$relink_command"; then + rmfiles="$rmfiles $objdir/lt-$name" + fi + if test "X$noexename" != "X$name" ; then + rmfiles="$rmfiles $objdir/lt-${noexename}.c" + fi + fi + fi + ;; + esac + $show "$rm $rmfiles" + $run $rm $rmfiles || exit_status=1 + done + objdir="$origobjdir" + + # Try to remove the ${objdir}s in the directories where we deleted files + for dir in $rmdirs; do + if test -d "$dir"; then + $show "rmdir $dir" + $run rmdir $dir >/dev/null 2>&1 + fi + done + + exit $exit_status + ;; + + "") + $echo "$modename: you must specify a MODE" 1>&2 + $echo "$generic_help" 1>&2 + exit 1 + ;; + esac + + if test -z "$exec_cmd"; then + $echo "$modename: invalid operation mode \`$mode'" 1>&2 + $echo "$generic_help" 1>&2 + exit 1 + fi +fi # test -z "$show_help" + +if test -n "$exec_cmd"; then + eval exec $exec_cmd + exit 1 +fi + +# We need to display help for each of the modes. +case $mode in +"") $echo \ +"Usage: $modename [OPTION]... [MODE-ARG]... + +Provide generalized library-building support services. + + --config show all configuration variables + --debug enable verbose shell tracing +-n, --dry-run display commands without modifying any files + --features display basic configuration information and exit + --finish same as \`--mode=finish' + --help display this help message and exit + --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] + --quiet same as \`--silent' + --silent don't print informational messages + --tag=TAG use configuration variables from tag TAG + --version print version information + +MODE must be one of the following: + + clean remove files from the build directory + compile compile a source file into a libtool object + execute automatically set library path, then run a program + finish complete the installation of libtool libraries + install install libraries or executables + link create a library or an executable + uninstall remove libraries from an installed directory + +MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for +a more detailed description of MODE. + +Report bugs to ." + exit 0 + ;; + +clean) + $echo \ +"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... + +Remove files from the build directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, object or program, all the files associated +with it are deleted. Otherwise, only FILE itself is deleted using RM." + ;; + +compile) + $echo \ +"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE + +Compile a source file into a libtool library object. + +This mode accepts the following additional options: + + -o OUTPUT-FILE set the output file name to OUTPUT-FILE + -prefer-pic try to building PIC objects only + -prefer-non-pic try to building non-PIC objects only + -static always build a \`.o' file suitable for static linking + +COMPILE-COMMAND is a command to be used in creating a \`standard' object file +from the given SOURCEFILE. + +The output file name is determined by removing the directory component from +SOURCEFILE, then substituting the C source code suffix \`.c' with the +library object suffix, \`.lo'." + ;; + +execute) + $echo \ +"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... + +Automatically set library path, then run a program. + +This mode accepts the following additional options: + + -dlopen FILE add the directory containing FILE to the library path + +This mode sets the library path environment variable according to \`-dlopen' +flags. + +If any of the ARGS are libtool executable wrappers, then they are translated +into their corresponding uninstalled binary, and any of their required library +directories are added to the library path. + +Then, COMMAND is executed, with ARGS as arguments." + ;; + +finish) + $echo \ +"Usage: $modename [OPTION]... --mode=finish [LIBDIR]... + +Complete the installation of libtool libraries. + +Each LIBDIR is a directory that contains libtool libraries. + +The commands that this mode executes may require superuser privileges. Use +the \`--dry-run' option if you just want to see what would be executed." + ;; + +install) + $echo \ +"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... + +Install executables or libraries. + +INSTALL-COMMAND is the installation command. The first component should be +either the \`install' or \`cp' program. + +The rest of the components are interpreted as arguments to that command (only +BSD-compatible install options are recognized)." + ;; + +link) + $echo \ +"Usage: $modename [OPTION]... --mode=link LINK-COMMAND... + +Link object files or libraries together to form another library, or to +create an executable program. + +LINK-COMMAND is a command using the C compiler that you would use to create +a program from several object files. + +The following components of LINK-COMMAND are treated specially: + + -all-static do not do any dynamic linking at all + -avoid-version do not add a version suffix if possible + -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime + -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols + -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) + -export-symbols SYMFILE + try to export only the symbols listed in SYMFILE + -export-symbols-regex REGEX + try to export only the symbols matching REGEX + -LLIBDIR search LIBDIR for required installed libraries + -lNAME OUTPUT-FILE requires the installed library libNAME + -module build a library that can dlopened + -no-fast-install disable the fast-install mode + -no-install link a not-installable executable + -no-undefined declare that a library does not refer to external symbols + -o OUTPUT-FILE create OUTPUT-FILE from the specified objects + -objectlist FILE Use a list of object files found in FILE to specify objects + -release RELEASE specify package release information + -rpath LIBDIR the created library will eventually be installed in LIBDIR + -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries + -static do not do any dynamic linking of libtool libraries + -version-info CURRENT[:REVISION[:AGE]] + specify library version info [each variable defaults to 0] + +All other options (arguments beginning with \`-') are ignored. + +Every other argument is treated as a filename. Files ending in \`.la' are +treated as uninstalled libtool libraries, other files are standard or library +object files. + +If the OUTPUT-FILE ends in \`.la', then a libtool library is created, +only library objects (\`.lo' files) may be specified, and \`-rpath' is +required, except when creating a convenience library. + +If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created +using \`ar' and \`ranlib', or on Windows using \`lib'. + +If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file +is created, otherwise an executable program is created." + ;; + +uninstall) + $echo \ +"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... + +Remove libraries from an installation directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, all the files associated with it are deleted. +Otherwise, only FILE itself is deleted using RM." + ;; + +*) + $echo "$modename: invalid operation mode \`$mode'" 1>&2 + $echo "$help" 1>&2 + exit 1 + ;; +esac + +$echo +$echo "Try \`$modename --help' for more information about other modes." + +exit 0 + +# The TAGs below are defined such that we never get into a situation +# in which we disable both kinds of libraries. Given conflicting +# choices, we go for a static library, that is the most portable, +# since we can't tell whether shared libraries were disabled because +# the user asked for that or because the platform doesn't support +# them. This is particularly important on AIX, because we don't +# support having both static and shared libraries enabled at the same +# time on that platform, so we default to a shared-only configuration. +# If a disable-shared tag is given, we'll fallback to a static-only +# configuration. But we'll never go from static-only to shared-only. + +# ### BEGIN LIBTOOL TAG CONFIG: disable-shared +build_libtool_libs=no +build_old_libs=yes +# ### END LIBTOOL TAG CONFIG: disable-shared + +# ### BEGIN LIBTOOL TAG CONFIG: disable-static +build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac` +# ### END LIBTOOL TAG CONFIG: disable-static + +# Local Variables: +# mode:shell-script +# sh-indentation:2 +# End: diff --git a/man/Makefile.am b/man/Makefile.am new file mode 100644 index 0000000..55965ec --- /dev/null +++ b/man/Makefile.am @@ -0,0 +1,17 @@ +man1_MANS = sunifdef.1 + +.phony: all man clean distlean + +all: sunifdef.1 + +clean: + rm -f sunifdef.1 ./html/* *.tmp + +distclean: + rm -f Makefile + +man: sunifdef.1 + +sunifdef.1: man_pod.pl makeman.sh + ./makeman.sh + diff --git a/man/Makefile.in b/man/Makefile.in new file mode 100644 index 0000000..120566b --- /dev/null +++ b/man/Makefile.in @@ -0,0 +1,387 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 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@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = man +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +man1dir = $(mandir)/man1 +am__installdirs = "$(DESTDIR)$(man1dir)" +NROFF = nroff +MANS = $(man1_MANS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +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@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +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@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +man1_MANS = sunifdef.1 +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign man/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign man/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-man1: $(man1_MANS) $(man_MANS) + @$(NORMAL_INSTALL) + test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" + @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ + case "$$i" in \ + *.1*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ + else file=$$i; fi; \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 1*) ;; \ + *) ext='1' ;; \ + esac; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \ + done +uninstall-man1: + @$(NORMAL_UNINSTALL) + @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ + case "$$i" in \ + *.1*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 1*) ;; \ + *) ext='1' ;; \ + esac; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \ + rm -f "$(DESTDIR)$(man1dir)/$$inst"; \ + done +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(MANS) +installdirs: + for dir in "$(DESTDIR)$(man1dir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-man + +install-dvi: install-dvi-am + +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 + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-man + +uninstall-man: uninstall-man1 + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-man1 \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + uninstall uninstall-am uninstall-man uninstall-man1 + + +.phony: all man clean distlean + +all: sunifdef.1 + +clean: + rm -f sunifdef.1 ./html/* *.tmp + +distclean: + rm -f Makefile + +man: sunifdef.1 + +sunifdef.1: man_pod.pl makeman.sh + ./makeman.sh +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/man/html/sunifdef_man_1.html b/man/html/sunifdef_man_1.html new file mode 100644 index 0000000..97ded56 --- /dev/null +++ b/man/html/sunifdef_man_1.html @@ -0,0 +1,490 @@ + + + + +Sunifdef Man Page + + + + + + +

+ + + + +
SUNIFDEF(1)User CommandsSUNIFDEF(1)

+

+
+

NAME

+

sunifdef - simplify C preprocessor source files

+

+

+
+

SYNOPSIS

+

sunifdef [-v | --version]

+

sunifdef [-h | --help]

+

sunifdef [OPTION...] [files...]

+

+

+
+

DESCRIPTION

+

sunifdef is a more powerful successor of the FreeBSD unifdef tool. sunifdef is a preprocessor of C or C++ preprocessor source files (or more briefly a preprocessor of C/C++ source files).

+

From the commandline arguments it takes a set of assumptions about the symbols to be defined, or undefined, for the CPP. From the commandline it also takes one or more source files. It parses these source files to pick out conditional preprocessor directives (#if,#ifdef,#ifndef,#else,#elif,#endif). It applies the specified assumptions to these directives in attempt to evaluate them. Directives that cannot be fully evaluated on the basis of the assumptions are simplified as much as possible. Directives that can be fully evaluated are eliminated, and the source text that they control is either retained or deleted in accordance with the evaluation, mimicking the behaviour of the CPP.

+

sunifdef also detects #define and #undef directives and checks them for consistency with the specified assumptions. If a #define or #undef directive repeats one of the assumptions it is deleted on output; if it conflicts with any of the assumptions then it may be deleted or replaced with a diagnostic comment or a diagnostic #error, depending on commandline options.

+

For each source file, an output file is generated that reflects the simplifications arising from the specified assumptions. The command

+

sunifdef -DFOO bar.c

+

will write on the standard output a revision of the file bar.c that has been purged as far as possible of preprocessor constructions controlled by the truth-value of defined(FOO). This revision is equivalent to bar.c on the assumption that FOO is defined. With appropriate options and inputs, you can use a sunifdef command to perform wholesale removal of redundant preprocessor complexities from a C or C++ source tree. See the EXAMPLES section.

+

+

+
+

OPTIONS

+
+
-h,--help + +
+

Display a usage summary and exit.

+
+ +
-v,--version + +
+

Display version information and exit.

+
+ +
-s[f|a][l], --symbols [first | all][,locate] + +
+

Output a list of symbols that are determinative for the truth value of #if conditions.

+
+
+

f, first: List only the first occurrence of the symbol on input.

+
+
+

a, all: List all occurrences of the symbol on input.

+
+
+

l, locate: Report the file and line number of each listed occurrence.

+
+ +
fargfile, --file argfile + +
+

Read (more) arguments from file argfile. Arguments may be written free-form, separated by whitespace, in argfile. These arguments will be parsed exactly as if they were listed on the commandline at the position of -fargfile.

+
+ +
-Dmacro[=string], --define macro[=string] + +
+

Assume that #define macro[=string] is in force for processing the input file(s).

+
+ +
-Umacro, --undef macro + +
+

Assume that #undef macro is in force for processing the input file(s).

+
+ +
-r, --replace + +
+

Replace each input file with the corresponding output file. You must specify this option to process multiple input files.

+
+
+

The option changes the default behaviour of the command when no input files are specified. In this case, input is acquired from the standard input. If -r is not specified, then a single input file is read from the standard input. If -r is specified then the names of the input files are read from the standard input. Note that --recurse implies --replace.

+
+
+

If the names of the input files are read from stdin, the filenames are delimited by whitespace unless enclosed in double-quotes.

+
+ +
-R, --recurse + +
+

Recurse into directories to find input files. Implies --replace. The input files may include directories with this option: otherwise a directory provokes a non-fatal error.

+
+
+

All files within a directory (and within subdirectories) will be selected for input unless the --filter option is given: otherwise all files (including subdirectories) will be selected that match the --filter option.

+
+
+

When --recurse is in effect, sunifdef builds a graph of all unique input files once and for all as it parses the filenames that are explicitly supplied and before it processes any of them. New files that may later appear in input directories during execution will not be processed, and files that have disappeared from input directories when they are due to be processed will provoke fatal errors.

+
+ +
-Fext1[,ext2...], --filter ext1[,ext2...] + +
+

Process only input files that have one of the file extensions ext1,ext2... A file extension may be any terminal segment of a filename that follows a '.'.

+
+ +
-Bsuffix, --backup suffix + +
+

Backup each input file before replacing it, the backup file having the same name as the input file with suffix appended to it.

+
+ +
-x[d|c|e], --conflict [delete | comment | error] + +
+

Select the action to be taken when a #define or #undef directive is encountered in an input file that conflicts with one of the -D or -U assumptions:

+
+
+

d, delete: Delete the conflicting directive.

+
+
+

c, comment: Replace the conflicting directive with a diagnostic comment (default).

+
+
+

e, error: Replace the conflicting directive with a diagnostic #error directive.

+
+ +
-g[p|i|w|e|a], --gag [progress | info | warning | error | abend] + +
+

Suppress diagnostics no worse than [progress | info | warning | error | abend].

+
+ +
-gs, --gag summary. + +
+

Suppress summary diagnostics at end of input.

+
+ +
-V, --verbose + +
+

Output all diagnostics,

+
+
+

If neither -V nor -garg is specified defaults are -gp -gi -gs.

+
+ +
-n[u|e[d]], --constant [unk | eval[,del]] + +
+

Select the policy for processing constants in #if directives:

+
+
+

u, unk: Treat constants as unknowns, i.e. like macros that are not subject to any assumptions (default).

+
+
+

e[d], eval[,del]: Evaluate constants [and optionally eliminate them].

+
+ +
-c, --complement + +
+

Ouput the lines that ought to be dropped and vice versa.

+
+ +
-d, --debug + +
+

Write debugging information to stderr.

+
+ +
-k[d|b|c], --discard [drop | blank | comment] + +
+

Select the policy for discarding lines from output:

+
+
+

d, drop: Drop discarded lines.

+
+
+

b, blank: Blank discarded lines.

+
+
+

c, comment: Comment out discarded lines.

+
+ +
-K, --keepgoing + +
+

If a parse error is encountered in an input file, continue processing subsequent input files. An event of severity abend will terminate processing regardless of --keepgoing.

+
+ +
-P, --pod + +
+

Apart from CPP directives, input is to be treated as Plain Old Data. C/C++ comments and quotations will not be parsed.

+
+ +
-l, --line + +
+

Output #line directives in place of discarded lines to preserve the line numbers of retained lines.

+
+ +
+

+

+
+

EXAMPLES

+
+
sunifdef -DUNIX -UWIN32 foo.c + +
sunifdef --define UNIX --undef WIN32 foo.c + +
+

Simplify the file foo.c assuming that the symbol UNIX is defined and the symbol WIN32 is undefined. Write the simplified file to stdout. By default diagnostic messages whose severity is warning or higher will be output and no summary diagnostics will be output. All diagnostics are written to stderr.

+
+ +
sunifdef -DUNIX=1 -UWIN32 foo.c + +
sunifdef --define UNIX=1 --undef WIN32 foo.c + +
+

Like the previous example, but the symbol UNIX is defined as 1.

+
+ +
sunifdef -gw -DUNIX -UWIN32 foo.c + +
sunifdef --gag warn --define UNIX --undef WIN32 foo.c + +
+

Like the first example, but suppress all diagnostics (--gag) whose severity is warning or lower that would otherwise be written to stderr.

+
+ +
sunifdef -gw -DUNIX -UWIN32 foo.c + +
sunifdef --gag warn --define UNIX --undef WIN32 foo.c + +
+

Like the first example, but suppress all diagnostics (--gag) whose severity is warning or lower that would otherwise be written to stderr.

+
+ +
sunifdef -gw -gs -DUNIX -UWIN32 foo.c + +
sunifdef --gag warn -gag summary --define UNIX --undef WIN32 foo.c + +
+

Like the previous example, but also suppress all summary diagnostics that would otherwise be written to stderr after processing is finished (--gag summary).

+
+ +
sunifdef -V -DUNIX -UWIN32 foo.c + +
sunifdef --verbose --define UNIX --undef WIN32 foo.c + +
+

Like the previous example, but write all diagnostics at all severities to stderr, as well as summary diagnostics (--verbose).

+
+ +
sunifdef -DUNIX -UWIN32 < bar.c + +
sunifdef --define UNIX --undef WIN32 < bar.c + +
+

Like the previous example, but write only the default diagnostics to stderr and read the input file from stdin (in this case redirected from bar.c)

+
+ +
sunifdef -r -DUNIX -UWIN32 foo.c bar.c + +
sunifdef --replace --define UNIX --undef WIN32 foo.c bar.c + +
+

Like the previous example, but --replace causes each input file to be replaced with the corresponding simplified output file. With this option multiple input files - foo.c, bar.c - can be supplied.

+
+ +
sunifdef -r -DUNIX -UWIN32 < filelist.txt + +
sunifdef --replace --define UNIX --undef WIN32 < filelist.txt + +
+

Like the previous example, but read the list of input filenames from stdin (in this case redirected from filelist.txt)

+
+ +
sunifdef -r -B.bak -DUNIX -UWIN32 < filelist.txt + +
sunifdef --replace --backup ``.bak'' --define UNIX --undef WIN32 < filelist.txt + +
+

Like the previous example, but create a backup of each input file with the extension .bak (--backup ``.bak'').

+
+ +
sunifdef -R -DUNIX -UWIN32 foo.c somedir bar.h otherdir + +
sunifdef --recurse --define UNIX --undef WIN32 foo.c somedir bar.h otherdir + +
+

The --recurse option implies --replace and causes sunifdef to find additional input files by searching recursively within the directories somedir and otherdir

+
+ +
sunifdef -R -Fc,h -DUNIX -UWIN32 foo.c somedir bar.h otherdir + +
sunifdef --recurse --filter c,h --define UNIX --undef WIN32 foo.c somedir bar.h otherdir + +
+

Like the previous example, but select only input files that have one of the extensions .c or .h (--filter c,h).

+
+ +
sunifdef -R -Fc,h -K -DUNIX -UWIN32 foo.c somedir bar.h otherdir + +
sunifdef --recurse --filter c,h --keepgoing --define UNIX --undef WIN32 foo.c somedir bar.h otherdir + +
+

Like the previous example, but keep going through parse errors (--keepgoing). Processing of the input file in error will be abandoned but subsequent input files will be processed.

+
+ +
sunifdef -R -Fc,h -sf foo.c somedir bar.h otherdir + +
sunifdef --recurse --filter c,h --symbols first foo.c somedir bar.h otherdir + +
+

Recursively select all the .c and .h files from foo.c, somedir, bar.h, otherdir and write on stderr a list of all the symbols that influence the truth-values of #if, #else, #elif conditions. Report only the first occurrence of each symbol.

+
+ +
sunifdef -R -Fc,h -sfl foo.c somedir bar.h otherdir + +
sunifdef --recurse --filter c,h --symbols first,locate foo.c somedir bar.h otherdir + +
+

Like the previous example, but report the file and line number of each reported symbol (--symbols first,locate)

+
+ +
sunifdef -R -Fc,h -sal foo.c somedir bar.h otherdir + +
sunifdef --recurse --filter c,h --symbols all,locate foo.c somedir bar.h otherdir + +
+

Like the previous example, but report all occurrences of the symbols (--symbols first,locate)

+
+ +
sunifdef -P -DUNIX -UWIN32 data.txt + +
sunifdef --pod --define UNIX --undef WIN32 data.txt + +
+

Process the file data.txt with the assumptions --define UNIX and --undef WIN32 parsing the text (other than #-directives) as Plain Old Data, rather than C/C++ source. C/C++ comments and quotations will not be recognised.

+
+ +
sunifdef -R -fargs.txt foo.c somedir bar.h otherdir + +
sunifdef -R --file args.txt foo.c somedir bar.h otherdir + +
+

Interprolate the contents of the file args.txt into the commandline, replacing --file args.txt and then execute the resulting command.

+
+ +
sunifdef -fargs.txt + +
sunifdef --file args.txt + +
+

Substite the contents of the file args.txt for --file args.txt and then execute the resulting command.

+
+ +
+

+

+
+

DIAGNOSTICS

+
+
Diagnostics written to stderr are classified by severity. Each diagnostic includes a distinct hexadecimal code of the form 0xXXXXX that encodes its severity. The 5 severities are: + +
+
+

progress: Progress messages (0xXXXXX & 0x00800 is true)

+
+
+

info: Noteworthy information (0xXXXXX & 0x01000 is true)

+
+
+

warning: Indicating problematic input (0xXXXXX & 0x02000 is true)

+
+
+

error: Indicating invalid input (0xXXXXX & 0x04000 is true)

+
+
+

abend: Indicating a fatal environment or internal error (0xXXXXX & 0x08000 is true)

+
+ +
Unless --gag summary is in force, sunifdef can write summary diagnostics at the end of processing. A summary diagnostic has a hexadecimal code S that encodes one of the severities and in addition S & 0x10000 is true. Even if --gag summary is not in force, a summary will not be written if its severity is suppressed by one of the specified or default --gag options. Since all summaries have severity info or warning, this means that by default no summaries will appear and to obtain all summaries you must specify --verbose. The summaries include: + +
+
+

info: The number of input files that were reached and the number that were not reached (due to abend).

+
+
+

info: The number of input files reached that were abandoned (due to errors).

+
+ +
If there was no abend or error, then additional summaries are written (unless suppressed) indicating each of the following outcomes that has occurred: + +
+
+

info: Input lines were dropped on output.

+
+
+

info: Input lines were changed on output.

+
+
+

warning: Input lines were changed to #error directives.

+
+
+

warning: Unconditional #error directives were output.

+
+ +
sunifdef returns a system code SC of which the low order half of the low order byte is always meaningful: + +
+
+

SC & 1: Informational diagnostics accrued.

+
+
+

SC & 2: Warnings diagnostics accrued.

+
+
+

SC & 4: Error diagnostics accrued. (Input files provoking errors will be unchanged notwithstanding the --replace option.)

+
+
+

SC & 8: An abend occurred. Some input files may not have been reached.

+
+ +
If no error or abend is indicated, then the high order half of the low order byte is also meaningful: + +
+

SC & 16: Input lines were dropped on output. +SC & 32: Input lines were changed on output. +SC & 64: Input lines were changed to #error directives. +SC & 128: Unconditional #error directives were output.

+
+ +
The system code reflects diagnostics that were provoked even if they were not actually output due to --gag options. + +
+

+

+
+

BUGS

+

The conditional operator ?...:... is not parsed.

+

Trigraphs are not parsed.

+

#define and #undef directives that are found to be active are not factored into the evalation of subsequent #if directives.

+

Please report bugs to bugs dot sunifdef at strudl dot org

+

+

+
+

AUTHOR

+

Mike Kinghan imk at strudl dot org

+

+

+
+

SEE ALSO

+

FreeBSD unifdef(1)

+

strudl.orgJANUARY 2008SUNIFDEF(1)
+ + + diff --git a/man/makeman.sh b/man/makeman.sh new file mode 100755 index 0000000..afcf304 --- /dev/null +++ b/man/makeman.sh @@ -0,0 +1,5 @@ +rel_month='JANUARY 2008' +sed -e "s/{{REL_MONTH}}/$rel_month/" < man_pod.pl > man_pod_rel.tmp +pod2man man_pod_rel.tmp --section=1 --name=sunifdef --center="User Commmands" --date="strudl.org" --release="$rel_month" > sunifdef.1 +pod2html --noindex --title="Sunifdef Man Page" --infile=man_pod_rel.tmp --outfile=html/sunifdef_man_1.html +rm -f *.tmp diff --git a/man/man_pod.pl b/man/man_pod.pl new file mode 100644 index 0000000..bf5949c --- /dev/null +++ b/man/man_pod.pl @@ -0,0 +1,362 @@ +=pod + +=begin html + +
SUNIFDEF(1)User CommandsSUNIFDEF(1)
+ +=end html + +=head1 NAME + +sunifdef - simplify C preprocessor source files + +=head1 SYNOPSIS + +sunifdef [B<-v> | B<--version>] + +sunifdef [B<-h> | B<--help>] + +sunifdef [OPTION...] [I...] + +=head1 DESCRIPTION + +B is a more powerful successor of the FreeBSD B tool. B is a preprocessor of C or C++ preprocessor source files (or more briefly a preprocessor of C/C++ source files). + +From the commandline arguments it takes a set of assumptions about the symbols to be defined, or undefined, for the CPP. From the commandline it also takes one or more source files. It parses these source files to pick out conditional preprocessor directives (B<#if>,B<#ifdef>,B<#ifndef>,B<#else>,B<#elif>,B<#endif>). It applies the specified assumptions to these directives in attempt to evaluate them. Directives that cannot be fully evaluated on the basis of the assumptions are simplified as much as possible. Directives that can be fully evaluated are eliminated, and the source text that they control is either retained or deleted in accordance with the evaluation, mimicking the behaviour of the CPP. + +B also detects B<#define> and B<#undef> directives and checks them for consistency with the specified assumptions. If a B<#define> or B<#undef> directive repeats one of the assumptions it is deleted on output; if it conflicts with any of the assumptions then it may be deleted or replaced with a diagnostic comment or a diagnostic B<#error>, depending on commandline options. + +For each source file, an output file is generated that reflects the simplifications arising from the specified assumptions. The command + +B + +will write on the standard output a revision of the file B that has been purged as far as possible of preprocessor constructions controlled by the truth-value of B. This revision is equivalent to B on the assumption that B is defined. With appropriate options and inputs, you can use a B command to perform wholesale removal of redundant preprocessor complexities from a C or C++ source tree. See the B section. + +=head1 OPTIONS + +=over + +=item B<-h>,B<--help> + +Display a usage summary and exit. + +=item B<-v>,B<--version> + +Display version information and exit. + +=item B<-s>[B|B][B], B<--symbols> [B | B][B<,locate>] + +Output a list of symbols that are determinative for the truth value of B<#if> conditions. + +B, B: List only the first occurrence of the symbol on input. + +B, B: List all occurrences of the symbol on input. + +B, B: Report the file and line number of each listed occurrence. + +=item BI, B<--file> I + +Read (more) arguments from file I. Arguments may be written free-form, separated by whitespace, in I. These arguments will be parsed exactly as if they were listed on the commandline at the position of -BI. + +=item B<-D>I[B<=>I], B<--define> I[B<=>I] + +Assume that B<#define> I[B<=>I] is in force for processing the input file(s). + +=item B<-U>I, B<--undef> I + +Assume that B<#undef> I is in force for processing the input file(s). + +=item B<-r>, B<--replace> + +Replace each input file with the corresponding output file. I. + +The option changes the default behaviour of the command when no input files are specified. In this case, input is acquired from the standard input. If B<-r> is I specified, then a single input file is read from the standard input. If B<-r> is specified then the I of the input files are read from the standard input. Note that B<--recurse> implies B<--replace>. + +If the names of the input files are read from stdin, the filenames are delimited by whitespace unless enclosed in double-quotes. + +=item B<-R>, B<--recurse> + +Recurse into directories to find input files. Implies B<--replace>. The input files may include directories with this option: otherwise a directory provokes a non-fatal error. + +All files within a directory (and within subdirectories) will be selected for input unless the B<--filter> option is given: otherwise all files (including subdirectories) will be selected that match the B<--filter> option. + +When B<--recurse> is in effect, B builds a graph of all unique input files once and for all as it parses the filenames that are explicitly supplied and before it processes any of them. New files that may later appear in input directories during execution will not be processed, and files that have disappeared from input directories when they are due to be processed will provoke fatal errors. + +=item B<-F>I[B<,>I...], B<--filter> I[B<,>I...] + +Process only input files that have one of the file extensions I,I... A file extension may be any terminal segment of a filename that follows a '.'. + +=item B<-B>I, B<--backup> I + +Backup each input file before replacing it, the backup file having the same name as the input file with I appended to it. + +=item B<-x>[B|B|B], B<--conflict> [B | B | B] + +Select the action to be taken when a B<#define> or B<#undef> directive is encountered in an input file that conflicts with one of the B<-D> or B<-U> assumptions: + +B, B: Delete the conflicting directive. + +B, B: Replace the conflicting directive with a diagnostic comment (B). + +B, B: Replace the conflicting directive with a diagnostic B<#error> directive. + +=item B<-g>[B

|B|B|B|B], B<--gag> [B | B | B | B | B] + +Suppress diagnostics no worse than [B | B | B | B | B]. + +=item B<-gs>, B<--gag summary>. + +Suppress summary diagnostics at end of input. + +=item B<-V>, B<--verbose> + +Output all diagnostics, + +If neither B<-V> nor B<-g>I is specified defaults are B<-gp -gi -gs>. + +=item B<-n>[B|B[B]], B<--constant> [B | B[B<,del>]] + +Select the policy for processing constants in B<#if> directives: + +B, B: Treat constants as unknowns, i.e. like macros that are not subject to any assumptions (B). + +B[B], B[B<,del>]: Evaluate constants [and optionally eliminate them]. + +=item B<-c>, B<--complement> + +Ouput the lines that ought to be dropped and vice versa. + +=item B<-d>, B<--debug> + +Write debugging information to stderr. + +=item B<-k>[B|B|B], B<--discard> [B | B | B] + +Select the policy for discarding lines from output: + +B, B: Drop discarded lines. + +B, B: Blank discarded lines. + +B, B: Comment out discarded lines. + +=item B<-K>, B<--keepgoing> + +If a parse error is encountered in an input file, continue processing subsequent input files. An event of severity B will terminate processing regardless of B<--keepgoing>. + +=item B<-P>, B<--pod> + +Apart from CPP directives, input is to be treated as Plain Old Data. C/C++ comments and quotations will not be parsed. + +=item B<-l>, B<--line> + +Output #line directives in place of discarded lines to preserve the line numbers of retained lines. + +=back + +=head1 EXAMPLES + +=over + +=item B + +=item B + +Simplify the file B assuming that the symbol B is defined and the symbol B is undefined. Write the simplified file to stdout. By default diagnostic messages whose severity is I or higher will be output and no summary diagnostics will be output. All diagnostics are written to stderr. + +=item B + +=item B + +Like the previous example, but the symbol B is defined as 1. + +=item B + +=item B + +Like the first example, but suppress all diagnostics (--gag) whose severity is warning or lower that would otherwise be written to stderr. + +=item B + +=item B + +Like the first example, but suppress all diagnostics (B<--gag>) whose severity is I or lower that would otherwise be written to stderr. + +=item B + +=item B + +Like the previous example, but also suppress all summary diagnostics that would otherwise be written to stderr after processing is finished (B<--gag summary>). + +=item B + +=item B + +Like the previous example, but write all diagnostics at all severities to stderr, as well as summary diagnostics (B<--verbose>). + +=item B + +=item B + +Like the previous example, but write only the default diagnostics to stderr and read the input file from stdin (in this case redirected from F) + +=item B + +=item B + +Like the previous example, but B<--replace> causes each input file to be replaced with the corresponding simplified output file. With this option multiple input files - F, F - can be supplied. + +=item B + +=item B + +Like the previous example, but read the list of input filenames from stdin (in this case redirected from F) + +=item B + +=item B + +Like the previous example, but create a backup of each input file with the extension B<.bak> (B<--backup ".bak">). + +=item B + +=item B + +The B<--recurse> option implies B<--replace> and causes sunifdef to find additional input files by searching recursively within the directories F and F + +=item B + +=item B + +Like the previous example, but select only input files that have one of the extensions B<.c> or B<.h> (B<--filter c,h>). + +=item B + +=item B + +Like the previous example, but keep going through parse errors (B<--keepgoing>). Processing of the input file in error will be abandoned but subsequent input files will be processed. + +=item B + +=item B + +Recursively select all the F<.c> and F<.h> files from F, F, F, F and write on stderr a list of all the symbols that influence the truth-values of B<#if>, B<#else>, B<#elif> conditions. Report only the first occurrence of each symbol. + +=item B + +=item B + +Like the previous example, but report the file and line number of each reported symbol (B<--symbols first,locate>) + +=item B + +=item B + +Like the previous example, but report all occurrences of the symbols (B<--symbols first,locate>) + +=item B + +=item B + +Process the file F with the assumptions B<--define UNIX> and B<--undef WIN32> parsing the text (other than B<#>-directives) as Plain Old Data, rather than C/C++ source. C/C++ comments and quotations will not be recognised. + +=item B + +=item B + +Interprolate the contents of the file F into the commandline, replacing B<--file args.txt> and then execute the resulting command. + +=item B + +=item B + +Substite the contents of the file F for B<--file args.txt> and then execute the resulting command. + +=back + +=head1 DIAGNOSTICS + +=over + +=item Diagnostics written to stderr are classified by severity. Each diagnostic includes a distinct hexadecimal code of the form C<0xXXXXX> that encodes its severity. The 5 severities are: + +=item Z<> + +B: Progress messages (C<0xXXXXX & 0x00800> is true) + +B: Noteworthy information (C<0xXXXXX & 0x01000> is true) + +B: Indicating problematic input (C<0xXXXXX & 0x02000> is true) + +B: Indicating invalid input (C<0xXXXXX & 0x04000> is true) + +B: Indicating a fatal environment or internal error (C<0xXXXXX & 0x08000> is true) + +=item Unless B<--gag summary> is in force, B can write summary diagnostics at the end of processing. A summary diagnostic has a hexadecimal code B that encodes one of the severities and in addition B C<& 0x10000> is true. Even if B<--gag summary> is not in force, a summary will not be written if its severity is suppressed by one of the specified or default B<--gag options>. Since all summaries have severity I or I, this means that by default no summaries will appear and to obtain all summaries you must specify B<--verbose>. The summaries include: + +=item Z<> + +B: The number of input files that were reached and the number that were not reached (due to abend). + +B: The number of input files reached that were abandoned (due to errors). + +=item If there was no abend or error, then additional summaries are written (unless suppressed) indicating each of the following outcomes that has occurred: + +=item Z<> + +B: Input lines were dropped on output. + +B: Input lines were changed on output. + +B: Input lines were changed to B<#error> directives. + +B: Unconditional #error directives were output. + +=item sunifdef returns a system code B of which the low order half of the low order byte is always meaningful: + +=item Z<> + +B C<& 1>: Informational diagnostics accrued. + +B C<& 2>: Warnings diagnostics accrued. + +B C<& 4>: Error diagnostics accrued. (Input files provoking errors will be unchanged notwithstanding the B<--replace> option.) + +B C<& 8>: An abend occurred. Some input files may not have been reached. + +=item If no error or abend is indicated, then the high order half of the low order byte is also meaningful: + +B C<& 16>: Input lines were dropped on output. +B C<& 32>: Input lines were changed on output. +B C<& 64>: Input lines were changed to #error directives. +B C<& 128>: Unconditional #error directives were output. + +=item The system code reflects diagnostics that were provoked even if they were not actually output due to B<--gag> options. + +=back + +=head1 BUGS + +The conditional operator B is not parsed. + +Trigraphs are not parsed. + +B<#define> and B<#undef> directives that are found to be active are not factored into the evalation of subsequent B<#if> directives. + +Please report bugs to bugs dot sunifdef at strudl dot org + +=head1 AUTHOR + +Mike Kinghan imk at strudl dot org + +=head1 SEE ALSO + +FreeBSD B + +=begin html + +

strudl.org{{REL_MONTH}}SUNIFDEF(1)
+ +=end html + +=cut diff --git a/man/sunifdef.1 b/man/sunifdef.1 new file mode 100644 index 0000000..8383866 --- /dev/null +++ b/man/sunifdef.1 @@ -0,0 +1,460 @@ +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sh \" Subsection heading +.br +.if t .Sp +.ne 5 +.PP +\fB\\$1\fR +.PP +.. +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. | will give a +.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to +.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' +.\" expand to `' in nroff, nothing in troff, for use with C<>. +.tr \(*W-|\(bv\*(Tr +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.if \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.\" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.hy 0 +.if n .na +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "sunifdef 1" +.TH sunifdef 1 "strudl.org" "JANUARY 2008" "User Commmands" +.SH "NAME" +sunifdef \- simplify C preprocessor source files +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +sunifdef [\fB\-v\fR | \fB\-\-version\fR] +.PP +sunifdef [\fB\-h\fR | \fB\-\-help\fR] +.PP +sunifdef [\s-1OPTION\s0...] [\fIfiles\fR...] +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +\&\fBsunifdef\fR is a more powerful successor of the FreeBSD \fBunifdef\fR tool. \fBsunifdef\fR is a preprocessor of C or \*(C+ preprocessor source files (or more briefly a preprocessor of C/\*(C+ source files). +.PP +From the commandline arguments it takes a set of assumptions about the symbols to be defined, or undefined, for the \s-1CPP\s0. From the commandline it also takes one or more source files. It parses these source files to pick out conditional preprocessor directives (\fB#if\fR,\fB#ifdef\fR,\fB#ifndef\fR,\fB#else\fR,\fB#elif\fR,\fB#endif\fR). It applies the specified assumptions to these directives in attempt to evaluate them. Directives that cannot be fully evaluated on the basis of the assumptions are simplified as much as possible. Directives that can be fully evaluated are eliminated, and the source text that they control is either retained or deleted in accordance with the evaluation, mimicking the behaviour of the \s-1CPP\s0. +.PP +\&\fBsunifdef\fR also detects \fB#define\fR and \fB#undef\fR directives and checks them for consistency with the specified assumptions. If a \fB#define\fR or \fB#undef\fR directive repeats one of the assumptions it is deleted on output; if it conflicts with any of the assumptions then it may be deleted or replaced with a diagnostic comment or a diagnostic \fB#error\fR, depending on commandline options. +.PP +For each source file, an output file is generated that reflects the simplifications arising from the specified assumptions. The command +.PP +\&\fBsunifdef \-DFOO bar.c\fR +.PP +will write on the standard output a revision of the file \fBbar.c\fR that has been purged as far as possible of preprocessor constructions controlled by the truth-value of \fBdefined(\s-1FOO\s0)\fR. This revision is equivalent to \fBbar.c\fR on the assumption that \fB\s-1FOO\s0\fR is defined. With appropriate options and inputs, you can use a \fBsunifdef\fR command to perform wholesale removal of redundant preprocessor complexities from a C or \*(C+ source tree. See the \fB\s-1EXAMPLES\s0\fR section. +.SH "OPTIONS" +.IX Header "OPTIONS" +.IP "\fB\-h\fR,\fB\-\-help\fR" 4 +.IX Item "-h,--help" +Display a usage summary and exit. +.IP "\fB\-v\fR,\fB\-\-version\fR" 4 +.IX Item "-v,--version" +Display version information and exit. +.IP "\fB\-s\fR[\fBf\fR|\fBa\fR][\fBl\fR], \fB\-\-symbols\fR [\fBfirst\fR | \fBall\fR][\fB,locate\fR]" 4 +.IX Item "-s[f|a][l], --symbols [first | all][,locate]" +Output a list of symbols that are determinative for the truth value of \fB#if\fR conditions. +.Sp +\&\fBf\fR, \fBfirst\fR: List only the first occurrence of the symbol on input. +.Sp +\&\fBa\fR, \fBall\fR: List all occurrences of the symbol on input. +.Sp +\&\fBl\fR, \fBlocate\fR: Report the file and line number of each listed occurrence. +.IP "\fBf\fR\fIargfile\fR, \fB\-\-file\fR \fIargfile\fR" 4 +.IX Item "fargfile, --file argfile" +Read (more) arguments from file \fIargfile\fR. Arguments may be written free\-form, separated by whitespace, in \fIargfile\fR. These arguments will be parsed exactly as if they were listed on the commandline at the position of \-\fBf\fR\fIargfile\fR. +.IP "\fB\-D\fR\fImacro\fR[\fB=\fR\fIstring\fR], \fB\-\-define\fR \fImacro\fR[\fB=\fR\fIstring\fR]" 4 +.IX Item "-Dmacro[=string], --define macro[=string]" +Assume that \fB#define\fR \fImacro\fR[\fB=\fR\fIstring\fR] is in force for processing the input file(s). +.IP "\fB\-U\fR\fImacro\fR, \fB\-\-undef\fR \fImacro\fR" 4 +.IX Item "-Umacro, --undef macro" +Assume that \fB#undef\fR \fImacro\fR is in force for processing the input file(s). +.IP "\fB\-r\fR, \fB\-\-replace\fR" 4 +.IX Item "-r, --replace" +Replace each input file with the corresponding output file. \fIYou must specify this option to process multiple input files\fR. +.Sp +The option changes the default behaviour of the command when no input files are specified. In this case, input is acquired from the standard input. If \fB\-r\fR is \fInot\fR specified, then a single input file is read from the standard input. If \fB\-r\fR is specified then the \fInames\fR of the input files are read from the standard input. Note that \fB\-\-recurse\fR implies \fB\-\-replace\fR. +.Sp +If the names of the input files are read from stdin, the filenames are delimited by whitespace unless enclosed in double\-quotes. +.IP "\fB\-R\fR, \fB\-\-recurse\fR" 4 +.IX Item "-R, --recurse" +Recurse into directories to find input files. Implies \fB\-\-replace\fR. The input files may include directories with this option: otherwise a directory provokes a non-fatal error. +.Sp +All files within a directory (and within subdirectories) will be selected for input unless the \fB\-\-filter\fR option is given: otherwise all files (including subdirectories) will be selected that match the \fB\-\-filter\fR option. +.Sp +When \fB\-\-recurse\fR is in effect, \fBsunifdef\fR builds a graph of all unique input files once and for all as it parses the filenames that are explicitly supplied and before it processes any of them. New files that may later appear in input directories during execution will not be processed, and files that have disappeared from input directories when they are due to be processed will provoke fatal errors. +.IP "\fB\-F\fR\fIext1\fR[\fB,\fR\fIext2\fR...], \fB\-\-filter\fR \fIext1\fR[\fB,\fR\fIext2\fR...]" 4 +.IX Item "-Fext1[,ext2...], --filter ext1[,ext2...]" +Process only input files that have one of the file extensions \fIext1\fR,\fIext2\fR... A file extension may be any terminal segment of a filename that follows a '.'. +.IP "\fB\-B\fR\fIsuffix\fR, \fB\-\-backup\fR \fIsuffix\fR" 4 +.IX Item "-Bsuffix, --backup suffix" +Backup each input file before replacing it, the backup file having the same name as the input file with \fIsuffix\fR appended to it. +.IP "\fB\-x\fR[\fBd\fR|\fBc\fR|\fBe\fR], \fB\-\-conflict\fR [\fBdelete\fR | \fBcomment\fR | \fBerror\fR]" 4 +.IX Item "-x[d|c|e], --conflict [delete | comment | error]" +Select the action to be taken when a \fB#define\fR or \fB#undef\fR directive is encountered in an input file that conflicts with one of the \fB\-D\fR or \fB\-U\fR assumptions: +.Sp +\&\fBd\fR, \fBdelete\fR: Delete the conflicting directive. +.Sp +\&\fBc\fR, \fBcomment\fR: Replace the conflicting directive with a diagnostic comment (\fBdefault\fR). +.Sp +\&\fBe\fR, \fBerror\fR: Replace the conflicting directive with a diagnostic \fB#error\fR directive. +.IP "\fB\-g\fR[\fBp\fR|\fBi\fR|\fBw\fR|\fBe\fR|\fBa\fR], \fB\-\-gag\fR [\fBprogress\fR | \fBinfo\fR | \fBwarning\fR | \fBerror\fR | \fBabend\fR]" 4 +.IX Item "-g[p|i|w|e|a], --gag [progress | info | warning | error | abend]" +Suppress diagnostics no worse than [\fBprogress\fR | \fBinfo\fR | \fBwarning\fR | \fBerror\fR | \fBabend\fR]. +.IP "\fB\-gs\fR, \fB\-\-gag summary\fR." 4 +.IX Item "-gs, --gag summary." +Suppress summary diagnostics at end of input. +.IP "\fB\-V\fR, \fB\-\-verbose\fR" 4 +.IX Item "-V, --verbose" +Output all diagnostics, +.Sp +If neither \fB\-V\fR nor \fB\-g\fR\fIarg\fR is specified defaults are \fB\-gp \-gi \-gs\fR. +.IP "\fB\-n\fR[\fBu\fR|\fBe\fR[\fBd\fR]], \fB\-\-constant\fR [\fBunk\fR | \fBeval\fR[\fB,del\fR]]" 4 +.IX Item "-n[u|e[d]], --constant [unk | eval[,del]]" +Select the policy for processing constants in \fB#if\fR directives: +.Sp +\&\fBu\fR, \fBunk\fR: Treat constants as unknowns, i.e. like macros that are not subject to any assumptions (\fBdefault\fR). +.Sp +\&\fBe\fR[\fBd\fR], \fBeval\fR[\fB,del\fR]: Evaluate constants [and optionally eliminate them]. +.IP "\fB\-c\fR, \fB\-\-complement\fR" 4 +.IX Item "-c, --complement" +Ouput the lines that ought to be dropped and vice versa. +.IP "\fB\-d\fR, \fB\-\-debug\fR" 4 +.IX Item "-d, --debug" +Write debugging information to stderr. +.IP "\fB\-k\fR[\fBd\fR|\fBb\fR|\fBc\fR], \fB\-\-discard\fR [\fBdrop\fR | \fBblank\fR | \fBcomment\fR]" 4 +.IX Item "-k[d|b|c], --discard [drop | blank | comment]" +Select the policy for discarding lines from output: +.Sp +\&\fBd\fR, \fBdrop\fR: Drop discarded lines. +.Sp +\&\fBb\fR, \fBblank\fR: Blank discarded lines. +.Sp +\&\fBc\fR, \fBcomment\fR: Comment out discarded lines. +.IP "\fB\-K\fR, \fB\-\-keepgoing\fR" 4 +.IX Item "-K, --keepgoing" +If a parse error is encountered in an input file, continue processing subsequent input files. An event of severity \fBabend\fR will terminate processing regardless of \fB\-\-keepgoing\fR. +.IP "\fB\-P\fR, \fB\-\-pod\fR" 4 +.IX Item "-P, --pod" +Apart from \s-1CPP\s0 directives, input is to be treated as Plain Old Data. C/\*(C+ comments and quotations will not be parsed. +.IP "\fB\-l\fR, \fB\-\-line\fR" 4 +.IX Item "-l, --line" +Output #line directives in place of discarded lines to preserve the line numbers of retained lines. +.SH "EXAMPLES" +.IX Header "EXAMPLES" +.IP "\fBsunifdef \-DUNIX \-UWIN32 foo.c\fR" 4 +.IX Item "sunifdef -DUNIX -UWIN32 foo.c" +.PD 0 +.IP "\fBsunifdef \-\-define \s-1UNIX\s0 \-\-undef \s-1WIN32\s0 foo.c\fR" 4 +.IX Item "sunifdef --define UNIX --undef WIN32 foo.c" +.PD +Simplify the file \fBfoo.c\fR assuming that the symbol \fB\s-1UNIX\s0\fR is defined and the symbol \fB\s-1WIN32\s0\fR is undefined. Write the simplified file to stdout. By default diagnostic messages whose severity is \fIwarning\fR or higher will be output and no summary diagnostics will be output. All diagnostics are written to stderr. +.IP "\fBsunifdef \-DUNIX=1 \-UWIN32 foo.c\fR" 4 +.IX Item "sunifdef -DUNIX=1 -UWIN32 foo.c" +.PD 0 +.IP "\fBsunifdef \-\-define UNIX=1 \-\-undef \s-1WIN32\s0 foo.c\fR" 4 +.IX Item "sunifdef --define UNIX=1 --undef WIN32 foo.c" +.PD +Like the previous example, but the symbol \fB\s-1UNIX\s0\fR is defined as 1. +.IP "\fBsunifdef \-gw \-DUNIX \-UWIN32 foo.c\fR" 4 +.IX Item "sunifdef -gw -DUNIX -UWIN32 foo.c" +.PD 0 +.IP "\fBsunifdef \-\-gag warn \-\-define \s-1UNIX\s0 \-\-undef \s-1WIN32\s0 foo.c\fR" 4 +.IX Item "sunifdef --gag warn --define UNIX --undef WIN32 foo.c" +.PD +Like the first example, but suppress all diagnostics (\-\-gag) whose severity is warning or lower that would otherwise be written to stderr. +.IP "\fBsunifdef \-gw \-DUNIX \-UWIN32 foo.c\fR" 4 +.IX Item "sunifdef -gw -DUNIX -UWIN32 foo.c" +.PD 0 +.IP "\fBsunifdef \-\-gag warn \-\-define \s-1UNIX\s0 \-\-undef \s-1WIN32\s0 foo.c\fR" 4 +.IX Item "sunifdef --gag warn --define UNIX --undef WIN32 foo.c" +.PD +Like the first example, but suppress all diagnostics (\fB\-\-gag\fR) whose severity is \fIwarning\fR or lower that would otherwise be written to stderr. +.IP "\fBsunifdef \-gw \-gs \-DUNIX \-UWIN32 foo.c\fR" 4 +.IX Item "sunifdef -gw -gs -DUNIX -UWIN32 foo.c" +.PD 0 +.IP "\fBsunifdef \-\-gag warn \-gag summary \-\-define \s-1UNIX\s0 \-\-undef \s-1WIN32\s0 foo.c\fR" 4 +.IX Item "sunifdef --gag warn -gag summary --define UNIX --undef WIN32 foo.c" +.PD +Like the previous example, but also suppress all summary diagnostics that would otherwise be written to stderr after processing is finished (\fB\-\-gag summary\fR). +.IP "\fBsunifdef \-V \-DUNIX \-UWIN32 foo.c\fR" 4 +.IX Item "sunifdef -V -DUNIX -UWIN32 foo.c" +.PD 0 +.IP "\fBsunifdef \-\-verbose \-\-define \s-1UNIX\s0 \-\-undef \s-1WIN32\s0 foo.c\fR" 4 +.IX Item "sunifdef --verbose --define UNIX --undef WIN32 foo.c" +.PD +Like the previous example, but write all diagnostics at all severities to stderr, as well as summary diagnostics (\fB\-\-verbose\fR). +.IP "\fBsunifdef \-DUNIX \-UWIN32 < bar.c\fR" 4 +.IX Item "sunifdef -DUNIX -UWIN32 < bar.c" +.PD 0 +.IP "\fBsunifdef \-\-define \s-1UNIX\s0 \-\-undef \s-1WIN32\s0 < bar.c\fR" 4 +.IX Item "sunifdef --define UNIX --undef WIN32 < bar.c" +.PD +Like the previous example, but write only the default diagnostics to stderr and read the input file from stdin (in this case redirected from \fIbar.c\fR) +.IP "\fBsunifdef \-r \-DUNIX \-UWIN32 foo.c bar.c\fR" 4 +.IX Item "sunifdef -r -DUNIX -UWIN32 foo.c bar.c" +.PD 0 +.IP "\fBsunifdef \-\-replace \-\-define \s-1UNIX\s0 \-\-undef \s-1WIN32\s0 foo.c bar.c\fR" 4 +.IX Item "sunifdef --replace --define UNIX --undef WIN32 foo.c bar.c" +.PD +Like the previous example, but \fB\-\-replace\fR causes each input file to be replaced with the corresponding simplified output file. With this option multiple input files \- \fIfoo.c\fR, \fIbar.c\fR \- can be supplied. +.IP "\fBsunifdef \-r \-DUNIX \-UWIN32 < filelist.txt\fR" 4 +.IX Item "sunifdef -r -DUNIX -UWIN32 < filelist.txt" +.PD 0 +.IP "\fBsunifdef \-\-replace \-\-define \s-1UNIX\s0 \-\-undef \s-1WIN32\s0 < filelist.txt\fR" 4 +.IX Item "sunifdef --replace --define UNIX --undef WIN32 < filelist.txt" +.PD +Like the previous example, but read the list of input filenames from stdin (in this case redirected from \fIfilelist.txt\fR) +.IP "\fBsunifdef \-r \-B.bak \-DUNIX \-UWIN32 < filelist.txt\fR" 4 +.IX Item "sunifdef -r -B.bak -DUNIX -UWIN32 < filelist.txt" +.PD 0 +.ie n .IP "\fBsunifdef \-\-replace \-\-backup "".bak"" \-\-define \s-1UNIX\s0 \-\-undef \s-1WIN32\s0 < filelist.txt\fR" 4 +.el .IP "\fBsunifdef \-\-replace \-\-backup ``.bak'' \-\-define \s-1UNIX\s0 \-\-undef \s-1WIN32\s0 < filelist.txt\fR" 4 +.IX Item "sunifdef --replace --backup .bak --define UNIX --undef WIN32 < filelist.txt" +.PD +Like the previous example, but create a backup of each input file with the extension \fB.bak\fR (\fB\-\-backup \*(L".bak\*(R"\fR). +.IP "\fBsunifdef \-R \-DUNIX \-UWIN32 foo.c somedir bar.h otherdir\fR" 4 +.IX Item "sunifdef -R -DUNIX -UWIN32 foo.c somedir bar.h otherdir" +.PD 0 +.IP "\fBsunifdef \-\-recurse \-\-define \s-1UNIX\s0 \-\-undef \s-1WIN32\s0 foo.c somedir bar.h otherdir\fR" 4 +.IX Item "sunifdef --recurse --define UNIX --undef WIN32 foo.c somedir bar.h otherdir" +.PD +The \fB\-\-recurse\fR option implies \fB\-\-replace\fR and causes sunifdef to find additional input files by searching recursively within the directories \fIsomedir\fR and \fIotherdir\fR +.IP "\fBsunifdef \-R \-Fc,h \-DUNIX \-UWIN32 foo.c somedir bar.h otherdir\fR" 4 +.IX Item "sunifdef -R -Fc,h -DUNIX -UWIN32 foo.c somedir bar.h otherdir" +.PD 0 +.IP "\fBsunifdef \-\-recurse \-\-filter c,h \-\-define \s-1UNIX\s0 \-\-undef \s-1WIN32\s0 foo.c somedir bar.h otherdir\fR" 4 +.IX Item "sunifdef --recurse --filter c,h --define UNIX --undef WIN32 foo.c somedir bar.h otherdir" +.PD +Like the previous example, but select only input files that have one of the extensions \fB.c\fR or \fB.h\fR (\fB\-\-filter c,h\fR). +.IP "\fBsunifdef \-R \-Fc,h \-K \-DUNIX \-UWIN32 foo.c somedir bar.h otherdir\fR" 4 +.IX Item "sunifdef -R -Fc,h -K -DUNIX -UWIN32 foo.c somedir bar.h otherdir" +.PD 0 +.IP "\fBsunifdef \-\-recurse \-\-filter c,h \-\-keepgoing \-\-define \s-1UNIX\s0 \-\-undef \s-1WIN32\s0 foo.c somedir bar.h otherdir\fR" 4 +.IX Item "sunifdef --recurse --filter c,h --keepgoing --define UNIX --undef WIN32 foo.c somedir bar.h otherdir" +.PD +Like the previous example, but keep going through parse errors (\fB\-\-keepgoing\fR). Processing of the input file in error will be abandoned but subsequent input files will be processed. +.IP "\fBsunifdef \-R \-Fc,h \-sf foo.c somedir bar.h otherdir\fR" 4 +.IX Item "sunifdef -R -Fc,h -sf foo.c somedir bar.h otherdir" +.PD 0 +.IP "\fBsunifdef \-\-recurse \-\-filter c,h \-\-symbols first foo.c somedir bar.h otherdir\fR" 4 +.IX Item "sunifdef --recurse --filter c,h --symbols first foo.c somedir bar.h otherdir" +.PD +Recursively select all the \fI.c\fR and \fI.h\fR files from \fIfoo.c\fR, \fIsomedir\fR, \fIbar.h\fR, \fIotherdir\fR and write on stderr a list of all the symbols that influence the truth-values of \fB#if\fR, \fB#else\fR, \fB#elif\fR conditions. Report only the first occurrence of each symbol. +.IP "\fBsunifdef \-R \-Fc,h \-sfl foo.c somedir bar.h otherdir\fR" 4 +.IX Item "sunifdef -R -Fc,h -sfl foo.c somedir bar.h otherdir" +.PD 0 +.IP "\fBsunifdef \-\-recurse \-\-filter c,h \-\-symbols first,locate foo.c somedir bar.h otherdir\fR" 4 +.IX Item "sunifdef --recurse --filter c,h --symbols first,locate foo.c somedir bar.h otherdir" +.PD +Like the previous example, but report the file and line number of each reported symbol (\fB\-\-symbols first,locate\fR) +.IP "\fBsunifdef \-R \-Fc,h \-sal foo.c somedir bar.h otherdir\fR" 4 +.IX Item "sunifdef -R -Fc,h -sal foo.c somedir bar.h otherdir" +.PD 0 +.IP "\fBsunifdef \-\-recurse \-\-filter c,h \-\-symbols all,locate foo.c somedir bar.h otherdir\fR" 4 +.IX Item "sunifdef --recurse --filter c,h --symbols all,locate foo.c somedir bar.h otherdir" +.PD +Like the previous example, but report all occurrences of the symbols (\fB\-\-symbols first,locate\fR) +.IP "\fBsunifdef \-P \-DUNIX \-UWIN32 data.txt\fR" 4 +.IX Item "sunifdef -P -DUNIX -UWIN32 data.txt" +.PD 0 +.IP "\fBsunifdef \-\-pod \-\-define \s-1UNIX\s0 \-\-undef \s-1WIN32\s0 data.txt\fR" 4 +.IX Item "sunifdef --pod --define UNIX --undef WIN32 data.txt" +.PD +Process the file \fIdata.txt\fR with the assumptions \fB\-\-define \s-1UNIX\s0\fR and \fB\-\-undef \s-1WIN32\s0\fR parsing the text (other than \fB#\fR\-directives) as Plain Old Data, rather than C/\*(C+ source. C/\*(C+ comments and quotations will not be recognised. +.IP "\fBsunifdef \-R \-fargs.txt foo.c somedir bar.h otherdir\fR" 4 +.IX Item "sunifdef -R -fargs.txt foo.c somedir bar.h otherdir" +.PD 0 +.IP "\fBsunifdef \-R \-\-file args.txt foo.c somedir bar.h otherdir\fR" 4 +.IX Item "sunifdef -R --file args.txt foo.c somedir bar.h otherdir" +.PD +Interprolate the contents of the file \fIargs.txt\fR into the commandline, replacing \fB\-\-file args.txt\fR and then execute the resulting command. +.IP "\fBsunifdef \-fargs.txt\fR" 4 +.IX Item "sunifdef -fargs.txt" +.PD 0 +.IP "\fBsunifdef \-\-file args.txt\fR" 4 +.IX Item "sunifdef --file args.txt" +.PD +Substite the contents of the file \fIargs.txt\fR for \fB\-\-file args.txt\fR and then execute the resulting command. +.SH "DIAGNOSTICS" +.IX Header "DIAGNOSTICS" +.ie n .IP "Diagnostics written to stderr are classified by severity. Each diagnostic includes a distinct hexadecimal code of the form ""0xXXXXX"" that encodes its severity. The 5 severities are:" 4 +.el .IP "Diagnostics written to stderr are classified by severity. Each diagnostic includes a distinct hexadecimal code of the form \f(CW0xXXXXX\fR that encodes its severity. The 5 severities are:" 4 +.IX Item "Diagnostics written to stderr are classified by severity. Each diagnostic includes a distinct hexadecimal code of the form 0xXXXXX that encodes its severity. The 5 severities are:" +.PD 0 +.IP "\&" 4 +.PD +\&\fBprogress\fR: Progress messages (\f(CW\*(C`0xXXXXX & 0x00800\*(C'\fR is true) +.Sp +\&\fBinfo\fR: Noteworthy information (\f(CW\*(C`0xXXXXX & 0x01000\*(C'\fR is true) +.Sp +\&\fBwarning\fR: Indicating problematic input (\f(CW\*(C`0xXXXXX & 0x02000\*(C'\fR is true) +.Sp +\&\fBerror\fR: Indicating invalid input (\f(CW\*(C`0xXXXXX & 0x04000\*(C'\fR is true) +.Sp +\&\fBabend\fR: Indicating a fatal environment or internal error (\f(CW\*(C`0xXXXXX & 0x08000\*(C'\fR is true) +.ie n .IP "Unless \fB\-\-gag summary\fR is in force, \fBsunifdef\fR can write summary diagnostics at the end of processing. A summary diagnostic has a hexadecimal code \fBS\fR that encodes one of the severities and in addition \fBS\fR ""& 0x10000""\fR is true. Even if \fB\-\-gag summary\fR is not in force, a summary will not be written if its severity is suppressed by one of the specified or default \fB\-\-gag options\fR. Since all summaries have severity \fIinfo\fR or \fIwarning\fR, this means that by default no summaries will appear and to obtain all summaries you must specify \fB\-\-verbose. The summaries include:" 4 +.el .IP "Unless \fB\-\-gag summary\fR is in force, \fBsunifdef\fR can write summary diagnostics at the end of processing. A summary diagnostic has a hexadecimal code \fBS\fR that encodes one of the severities and in addition \fBS\fR \f(CW& 0x10000\fR is true. Even if \fB\-\-gag summary\fR is not in force, a summary will not be written if its severity is suppressed by one of the specified or default \fB\-\-gag options\fR. Since all summaries have severity \fIinfo\fR or \fIwarning\fR, this means that by default no summaries will appear and to obtain all summaries you must specify \fB\-\-verbose\fR. The summaries include:" 4 +.IX Item "Unless --gag summary is in force, sunifdef can write summary diagnostics at the end of processing. A summary diagnostic has a hexadecimal code S that encodes one of the severities and in addition S & 0x10000 is true. Even if --gag summary is not in force, a summary will not be written if its severity is suppressed by one of the specified or default --gag options. Since all summaries have severity info or warning, this means that by default no summaries will appear and to obtain all summaries you must specify --verbose. The summaries include:" +.PD 0 +.IP "\&" 4 +.PD +\&\fBinfo\fR: The number of input files that were reached and the number that were not reached (due to abend). +.Sp +\&\fBinfo\fR: The number of input files reached that were abandoned (due to errors). +.IP "If there was no abend or error, then additional summaries are written (unless suppressed) indicating each of the following outcomes that has occurred:" 4 +.IX Item "If there was no abend or error, then additional summaries are written (unless suppressed) indicating each of the following outcomes that has occurred:" +.PD 0 +.IP "\&" 4 +.PD +\&\fBinfo\fR: Input lines were dropped on output. +.Sp +\&\fBinfo\fR: Input lines were changed on output. +.Sp +\&\fBwarning\fR: Input lines were changed to \fB#error\fR directives. +.Sp +\&\fBwarning\fR: Unconditional #error directives were output. +.IP "sunifdef returns a system code \fB\s-1SC\s0\fR of which the low order half of the low order byte is always meaningful:" 4 +.IX Item "sunifdef returns a system code SC of which the low order half of the low order byte is always meaningful:" +.PD 0 +.IP "\&" 4 +.PD +\&\fB\s-1SC\s0\fR \f(CW\*(C`& 1\*(C'\fR: Informational diagnostics accrued. +.Sp +\&\fB\s-1SC\s0\fR \f(CW\*(C`& 2\*(C'\fR: Warnings diagnostics accrued. +.Sp +\&\fB\s-1SC\s0\fR \f(CW\*(C`& 4\*(C'\fR: Error diagnostics accrued. (Input files provoking errors will be unchanged notwithstanding the \fB\-\-replace\fR option.) +.Sp +\&\fB\s-1SC\s0\fR \f(CW\*(C`& 8\*(C'\fR: An abend occurred. Some input files may not have been reached. +.IP "If no error or abend is indicated, then the high order half of the low order byte is also meaningful:" 4 +.IX Item "If no error or abend is indicated, then the high order half of the low order byte is also meaningful:" +\&\fB\s-1SC\s0\fR \f(CW\*(C`& 16\*(C'\fR: Input lines were dropped on output. +\&\fB\s-1SC\s0\fR \f(CW\*(C`& 32\*(C'\fR: Input lines were changed on output. +\&\fB\s-1SC\s0\fR \f(CW\*(C`& 64\*(C'\fR: Input lines were changed to #error directives. +\&\fB\s-1SC\s0\fR \f(CW\*(C`& 128\*(C'\fR: Unconditional #error directives were output. +.IP "The system code reflects diagnostics that were provoked even if they were not actually output due to \fB\-\-gag\fR options." 4 +.IX Item "The system code reflects diagnostics that were provoked even if they were not actually output due to --gag options." +.SH "BUGS" +.IX Header "BUGS" +The conditional operator \fB?...:...\fR is not parsed. +.PP +Trigraphs are not parsed. +.PP +\&\fB#define\fR and \fB#undef\fR directives that are found to be active are not factored into the evalation of subsequent \fB#if\fR directives. +.PP +Please report bugs to bugs dot sunifdef at strudl dot org +.SH "AUTHOR" +.IX Header "AUTHOR" +Mike Kinghan imk at strudl dot org +.SH "SEE ALSO" +.IX Header "SEE ALSO" +FreeBSD \fB\f(BIunifdef\fB\|(1)\fR diff --git a/missing b/missing new file mode 100755 index 0000000..6a37006 --- /dev/null +++ b/missing @@ -0,0 +1,336 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. +# Copyright (C) 1996, 1997, 1999, 2000, 2002 Free Software Foundation, Inc. +# Originally by Fran,cois Pinard , 1996. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 +fi + +run=: + +# In the cases where this matters, `missing' is being run in the +# srcdir already. +if test -f configure.ac; then + configure_ac=configure.ac +else + configure_ac=configure.in +fi + +case "$1" in +--run) + # Try to run requested program, and just exit if it succeeds. + run= + shift + "$@" && exit 0 + ;; +esac + +# If it does not exist, or fails to run (possibly an outdated version), +# try to emulate it. +case "$1" in + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +error status if there is no known handling for PROGRAM. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + --run try to run the given command, and emulate it if it fails + +Supported PROGRAM values: + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + help2man touch the output file + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + tar try tar, gnutar, gtar, then tar without non-portable flags + yacc create \`y.tab.[ch]', if possible, from existing .[ch]" + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing 0.4 - GNU automake" + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + + aclocal*) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + fi + + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`acinclude.m4' or \`${configure_ac}'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + fi + + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`${configure_ac}'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + fi + + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`acconfig.h' or \`${configure_ac}'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case "$f" in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files + ;; + + automake*) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + fi + + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. + You might want to install the \`Automake' and \`Perl' packages. + Grab them from any GNU archive site." + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done + ;; + + autom4te) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + fi + + echo 1>&2 "\ +WARNING: \`$1' is needed, and you do not seem to have it handy on your + system. You might have modified some files without having the + proper tools for further handling them. + You can get \`$1Help2man' as part of \`Autoconf' from any GNU + archive site." + + file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` + test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo "#! /bin/sh" + echo "# Created by GNU Automake missing as a replacement of" + echo "# $ $@" + echo "exit 0" + chmod +x $file + exit 1 + fi + ;; + + bison|yacc) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package + in order for those modifications to take effect. You can get + \`Bison' from any GNU archive site." + rm -f y.tab.c y.tab.h + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if [ ! -f y.tab.h ]; then + echo >y.tab.h + fi + if [ ! -f y.tab.c ]; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex|flex) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if [ ! -f lex.yy.c ]; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + help2man) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + fi + + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a dependency of a manual page. You may need the + \`Help2man' package in order for those modifications to take + effect. You can get \`Help2man' from any GNU archive site." + + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + if test -z "$file"; then + file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` + fi + if [ -f "$file" ]; then + touch $file + else + test -z "$file" || exec >$file + echo ".ab help2man is required to generate this page" + exit 1 + fi + ;; + + makeinfo) + if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then + # We have makeinfo, but it failed. + exit 1 + fi + + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file + indirectly affecting the aspect of the manual. The spurious + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + if test -z "$file"; then + file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` + fi + touch $file + ;; + + tar) + shift + if test -n "$run"; then + echo 1>&2 "ERROR: \`tar' requires --run" + exit 1 + fi + + # We have already tried tar in the generic part. + # Look for gnutar/gtar before invocation to avoid ugly error + # messages. + if (gnutar --version > /dev/null 2>&1); then + gnutar "$@" && exit 0 + fi + if (gtar --version > /dev/null 2>&1); then + gtar "$@" && exit 0 + fi + firstarg="$1" + if shift; then + case "$firstarg" in + *o*) + firstarg=`echo "$firstarg" | sed s/o//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + case "$firstarg" in + *h*) + firstarg=`echo "$firstarg" | sed s/h//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + fi + + echo 1>&2 "\ +WARNING: I can't seem to be able to run \`tar' with the given arguments. + You may want to install GNU tar or Free paxutils, or check the + command line arguments." + exit 1 + ;; + + *) + echo 1>&2 "\ +WARNING: \`$1' is needed, and you do not seem to have it handy on your + system. You might have modified some files without having the + proper tools for further handling them. Check the \`README' file, + it often tells you about the needed prerequirements for installing + this package. You may also peek at any GNU archive site, in case + some other package would contain this missing \`$1' program." + exit 1 + ;; +esac + +exit 0 diff --git a/mkinstalldirs b/mkinstalldirs new file mode 100755 index 0000000..ba0325b --- /dev/null +++ b/mkinstalldirs @@ -0,0 +1,111 @@ +#! /bin/sh +# mkinstalldirs --- make directory hierarchy +# Author: Noah Friedman +# Created: 1993-05-16 +# Public domain + +errstatus=0 +dirmode="" + +usage="\ +Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..." + +# process command line arguments +while test $# -gt 0 ; do + case $1 in + -h | --help | --h*) # -h for help + echo "$usage" 1>&2 + exit 0 + ;; + -m) # -m PERM arg + shift + test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } + dirmode=$1 + shift + ;; + --) # stop option processing + shift + break + ;; + -*) # unknown option + echo "$usage" 1>&2 + exit 1 + ;; + *) # first non-opt arg + break + ;; + esac +done + +for file +do + if test -d "$file"; then + shift + else + break + fi +done + +case $# in + 0) exit 0 ;; +esac + +case $dirmode in + '') + if mkdir -p -- . 2>/dev/null; then + echo "mkdir -p -- $*" + exec mkdir -p -- "$@" + fi + ;; + *) + if mkdir -m "$dirmode" -p -- . 2>/dev/null; then + echo "mkdir -m $dirmode -p -- $*" + exec mkdir -m "$dirmode" -p -- "$@" + fi + ;; +esac + +for file +do + set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` + shift + + pathcomp= + for d + do + pathcomp="$pathcomp$d" + case $pathcomp in + -*) pathcomp=./$pathcomp ;; + esac + + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + else + if test ! -z "$dirmode"; then + echo "chmod $dirmode $pathcomp" + lasterr="" + chmod "$dirmode" "$pathcomp" || lasterr=$? + + if test ! -z "$lasterr"; then + errstatus=$lasterr + fi + fi + fi + fi + + pathcomp="$pathcomp/" + done +done + +exit $errstatus + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# End: +# mkinstalldirs ends here diff --git a/perl/SunifdefLib.pm b/perl/SunifdefLib.pm new file mode 100755 index 0000000..e2a10d5 --- /dev/null +++ b/perl/SunifdefLib.pm @@ -0,0 +1,154 @@ +#!/usr/bin/perl + +use strict; +package SunifdefLib; +use Exporter; + +our @ISA=qw(Exporter); +our @EXPORT=qw(set_prog set_usage get_usage set_verbosity help usage_error progress info warn error fatal bail cyg2win cygwin windows); + +use constant PROGRESS => 0; +use constant INFO => 1,; +use constant WARNING => 2; +use constant ERROR => 3; +use constant FATAL => 4; + +my $OS = "$^O"; +my $prog = ""; +my $usage = "No usage help available"; +my $verbose_level = PROGRESS; +my %severities_by_word = ( + 'progress' => PROGRESS, + 'info' => INFO, + 'warning' => WARNING, + 'error' => ERROR, + 'fatal' => FATAL +); + +my %severities_by_num = ( + '0' => 'progress', + '1' => 'info', + '2' => 'warning', + '3' => 'error', + '4' => 'fatal' +); + +sub set_prog($); +sub set_usage($); +sub set_verbosity($); +sub help(); +sub usage_error(@); +sub progress(@); +sub info(@); +sub warn(@); +sub error(@); +sub fatal(@); +sub bail(@); +sub report(@); +sub cyg2win($); +sub cygwin(); +sub windows(); + +sub set_prog($) +{ + $prog = $_[0]; +} + +sub set_usage($) +{ + $usage = $_[0]; +} + +sub set_verbosity($) +{ + my $verbosity = $_[0]; + $verbose_level = $severities_by_word{$verbosity} if defined($severities_by_word{$verbosity}); +} + +sub report(@) { + my $severity = shift; + my $msg = shift; + if ($severity >= $verbose_level) { + my $severity_word = $severities_by_num{"$severity"}; + if ($severity < WARNING) { + printf STDOUT "$prog: $severity_word: $msg\n",@_ + } + else { + printf STDERR "$prog: $severity_word: $msg\n",@_; + } + } +} + +sub progress(@) +{ + my $msg = shift; + report(PROGRESS,$msg,@_); +} + +sub info(@) +{ + my $msg = shift; + report(INFO,$msg,@_); +} + +sub warn(@) +{ + my $msg = shift; + report(WARNING,$msg,@_); +} + +sub error(@) +{ + my $msg = shift; + report(ERROR,$msg,@_); +} + +sub fatal(@) +{ + my $msg = shift; + report(FATAL,$msg,@_); +} + +sub bail(@) +{ + my $exitcode = shift; + fatal(@_); + exit($exitcode); +} + +sub usage_error(@) +{ + my ($msg) = @_; + if (defined($msg)) { + print STDERR "$prog: usage error: $msg\n"; + } + else { + print STDERR "$prog: usage error: \n$usage\n"; + } + exit(1); +} + +sub help() +{ + print STDOUT $usage; +} + +sub cyg2win($) +{ + my $filename = $_[0]; + $filename =~ s#/cygdrive/(\w)/#$1:/#g; + return $filename; +} + +sub cygwin() +{ + return "$OS" eq "cygwin"; +} + +sub windows() +{ + return "$OS" =~ m/"MSWin"/; +} + + +1; diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100755 index 0000000..13c64ff --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,19 @@ +bin_PROGRAMS = sunifdef + + +# set the include path found by configure +INCLUDES = $(all_includes) + +# the library search path. +sunifdef_LDFLAGS = $(all_libraries) +sunifdef_SOURCES = args.c args.h bool.h categorical.c categorical.h chew.c \ + chew.h dataset.c dataset.h doxygen.h evaluator.c evaluator.h exception.c \ + exception.h file_tree.c file_tree.h filesys.c filesys.h fs_nix.c fs_win.c \ + if_control.c if_control.h io.c io.h line_despatch.c line_despatch.h line_edit.c \ + line_edit.h main.c memory.c memory.h opts.h platform.h ptr_vector.c ptr_vector.h \ + report.c report.h state_utils.c state_utils.h symbol_table.c symbol_table.h +noinst_HEADERS = args.h bool.h categorical.h chew.h doxygen.h evaluator.h \ + if_control.h io.h line_despatch.h line_edit.h memory.h platform.h ptr_vector.h \ + state_utils.h symbol_table.h opts.h file_tree.h filesys.h exception.h dataset.h \ + report.h + diff --git a/src/Makefile.in b/src/Makefile.in new file mode 100755 index 0000000..0a90d76 --- /dev/null +++ b/src/Makefile.in @@ -0,0 +1,504 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 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@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@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 = sunifdef$(EXEEXT) +subdir = src +DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(bin_PROGRAMS) +am_sunifdef_OBJECTS = args.$(OBJEXT) categorical.$(OBJEXT) \ + chew.$(OBJEXT) dataset.$(OBJEXT) evaluator.$(OBJEXT) \ + exception.$(OBJEXT) file_tree.$(OBJEXT) filesys.$(OBJEXT) \ + fs_nix.$(OBJEXT) fs_win.$(OBJEXT) if_control.$(OBJEXT) \ + io.$(OBJEXT) line_despatch.$(OBJEXT) line_edit.$(OBJEXT) \ + main.$(OBJEXT) memory.$(OBJEXT) ptr_vector.$(OBJEXT) \ + report.$(OBJEXT) state_utils.$(OBJEXT) symbol_table.$(OBJEXT) +sunifdef_OBJECTS = $(am_sunifdef_OBJECTS) +sunifdef_LDADD = $(LDADD) +sunifdef_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(sunifdef_LDFLAGS) \ + $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(sunifdef_SOURCES) +DIST_SOURCES = $(sunifdef_SOURCES) +HEADERS = $(noinst_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +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@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +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@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ + +# set the include path found by configure +INCLUDES = $(all_includes) + +# the library search path. +sunifdef_LDFLAGS = $(all_libraries) +sunifdef_SOURCES = args.c args.h bool.h categorical.c categorical.h chew.c \ + chew.h dataset.c dataset.h doxygen.h evaluator.c evaluator.h exception.c \ + exception.h file_tree.c file_tree.h filesys.c filesys.h fs_nix.c fs_win.c \ + if_control.c if_control.h io.c io.h line_despatch.c line_despatch.h line_edit.c \ + line_edit.h main.c memory.c memory.h opts.h platform.h ptr_vector.c ptr_vector.h \ + report.c report.h state_utils.c state_utils.h symbol_table.c symbol_table.h + +noinst_HEADERS = args.h bool.h categorical.h chew.h doxygen.h evaluator.h \ + if_control.h io.h line_despatch.h line_edit.h memory.h platform.h ptr_vector.h \ + state_utils.h symbol_table.h opts.h file_tree.h filesys.h exception.h dataset.h \ + report.h + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign src/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + || test -f $$p1 \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ + else :; fi; \ + done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ + rm -f "$(DESTDIR)$(bindir)/$$f"; \ + done + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +sunifdef$(EXEEXT): $(sunifdef_OBJECTS) $(sunifdef_DEPENDENCIES) + @rm -f sunifdef$(EXEEXT) + $(sunifdef_LINK) $(sunifdef_OBJECTS) $(sunifdef_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/args.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/categorical.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chew.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dataset.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evaluator.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exception.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file_tree.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filesys.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fs_nix.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fs_win.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/if_control.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/io.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/line_despatch.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/line_edit.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memory.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ptr_vector.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/report.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/state_utils.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/symbol_table.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-exec-am: install-binPROGRAMS + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ + clean-generic clean-libtool ctags distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-binPROGRAMS install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am \ + uninstall-binPROGRAMS + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/args.c b/src/args.c new file mode 100755 index 0000000..2ad461a --- /dev/null +++ b/src/args.c @@ -0,0 +1,1136 @@ +/*************************************************************************** + * Copyright (C) 2004, 2006 Symbian Software Ltd. * + * All rights reserved. * + * Copyright (C) 2007, 2008 Mike Kinghan, imk@strudl.org * + * All rights reserved. * + * * + * Contributed originally by Mike Kinghan, imk@strudl.org * + * * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * Redistributions of source code must retain the above copyright * + * notice, this list of conditions and the following disclaimer. * + * * + * Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * * + * Neither the name of Symbian Software Ltd. nor the names of its * + * contributors may be used to endorse or promote products derived from * + * this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,* + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * + * DAMAGE. * + * * + ***************************************************************************/ + +#include "platform.h" +#include "args.h" +#include "report.h" +#include "categorical.h" +#include "io.h" +#include "line_despatch.h" +#include "symbol_table.h" +#include "filesys.h" +#include "dataset.h" +#include +#include +#include + + +/*!\ingroup args_module args_interface args_internals + *\file args.c + * This file implements the Args module + */ + +/*! \ingroup args_internals_state_utils */ +/*@{*/ + +/*! The global state of the Args module */ +STATE_DEF(args) { + /*! The public state of the Args module */ + INCLUDE_PUBLIC(args); + ptr_vector_h argfile_argv; + /*!< Array of args read from \c --file \c ARGFILE */ + char *memfile; + /*!< Read whole \c ARGFILE into heap here */ + int arg_dirs_ignored; + /*!< Count of commandline arguments that + specify input directories ignored because + --recurse is not specified */ +} STATE_T(args); +/*@}*/ + +/*! \addtogroup args_internals_state_utils */ +/*@{*/ + +IMPLEMENT(args,USER_INITABLE) + +/*! \fn void args_init(args_state_t * args_st) + * Define initialisation function for the Args module. + * \param args_st Pointer to module state + */ +DEFINE_USER_INIT(args)(STATE_T(args) * args_st) +{ + args_st->argfile_argv = ptr_vector_new(); +} + +/*! \fn void args_finis(args_state_t * args_st) + * Define finalisation function for the Args module. + * \param args_st Pointer to module state + */ +DEFINE_USER_FINIS(args)(STATE_T(args) * args_st) +{ + ptr_vector_dispose(&(SET_STATE(args,argfile_argv))); +} +/*@}*/ + +/*! \addtogroup args_internals */ +/*@{*/ + +/*! Say whether we are suppressing progress messages */ +#define PROGRESS_GAGGED() \ +((GET_PUBLIC(args,diagnostic_filter) & MSGCLASS_PROGRESS) != 0) + +static int optind; + /*!< Index of option parsed by getopt_long() */ +static int optopt; + /*!< Unrecogised short option parsed by getopt_long() */ +static char *optarg; + /*!< Argument to an option parsed by getopt_long() */ + +/*! Info structure for a commandline option for getopt_long() */ +struct option { + /*! The name of the option */ + const char *name; + /*! Can the option take an argument? One of: + - \c no_argument + - \c required_argument + - \c optional argument + */ + int has_arg; + /*! \c NULL here makes getopt_long() return the field \c val if + * this option is matched. Non-null makes getopt_long() return + * 0 if any option is matched, and set the \c int addressed by + * flag == val/ if this option is matched, otherwise + * leaving it unchanged. + */ + int *flag; + /*! Value to be returned or stored by getopt_long() if this + * option is matched (depending on \c flag). + */ + int val; +}; + +/*! Possible values of the \c has_arg field in an \c option structure */ +enum { + no_argument, /*!< The option cannot have an argument */ + required_argument, /*!< The option must have an argument */ + optional_argument /*!< The option mat or may not have an argument */ +}; + + +/*! New Enumeraton of codes for the commandline options */ +enum { + OPT_FILE = 'f', /*!< The \c --file option */ + OPT_BACKUP = 'B', /*!< The \c --backup option */ + OPT_REPLACE = 'r', /*!< The \c --replace option */ + OPT_DEF = 'D', /*!< The \c --define option */ + OPT_UNDEF = 'U', /*!< The \c --undefine option */ + OPT_CONFLICT = 'x', /*!< The \c --conflict option */ + OPT_GAG = 'g', /*!< The \c --gag option */ + OPT_VERBOSE = 'V', /*!< The \c --verbose option */ + OPT_COMPLEMENT = 'c', /*!< The \c --complement option */ + OPT_DEBUG = 'd', /*!< The \c --debug option */ + OPT_CONSTANT = 'n', /*!< The \c --constant option */ + OPT_DISCARD = 'k', /*!< The \c --discard option */ + OPT_LINE = 'l', /*!< The \c --line option */ + OPT_SYMBOLS = 's', /*!< The \c --symbols option */ + OPT_POD = 'P', /*!< The \c --pod option */ + OPT_HELP = 'h', /*!< The \c --help option */ + OPT_VERSION = 'v', /*!< The \c --version option */ + OPT_RECURSE = 'R', /*!< The \c --recurse option */ + OPT_FILTER = 'F', /*!< The \c --filter option */ + OPT_KEEPGOING = 'K' /*!< The \c --keepgoing option */ +}; + + +/*! Array of structures specifying the commandline options */ +static struct option long_options [] = { + { "file", required_argument, NULL, OPT_FILE }, + { "backup", required_argument, NULL, OPT_BACKUP }, + { "replace",no_argument, NULL, OPT_REPLACE }, + { "define", required_argument, NULL, OPT_DEF }, + { "undef", required_argument, NULL, OPT_UNDEF }, + { "conflict", required_argument, NULL, OPT_CONFLICT }, + { "gag", required_argument, NULL, OPT_GAG }, + { "verbose", no_argument, NULL, OPT_VERBOSE }, + { "complement", no_argument, NULL, OPT_COMPLEMENT }, + { "debug", no_argument, NULL, OPT_DEBUG }, + { "constant", required_argument, NULL, OPT_CONSTANT }, + { "discard", required_argument, NULL, OPT_DISCARD }, + { "line", no_argument, NULL, OPT_LINE }, + { "symbols", required_argument, NULL, OPT_SYMBOLS }, + { "pod", no_argument, NULL, OPT_POD }, + { "help", no_argument, NULL, OPT_HELP }, + { "version", no_argument, NULL, OPT_VERSION }, + { "recurse", no_argument, NULL, OPT_RECURSE }, + { "filter", required_argument, NULL, OPT_FILTER }, + { "keepgoing", no_argument, NULL, OPT_KEEPGOING }, + { 0, 0, 0, 0 } +}; + +/*! We need the standard getopt_long() function, but the host implementation + * cannot be relied on to be re-entrant. Therefore we roll out own + * re-entrant version. The interface is like that of its standard namesake. + */ +static int +getopt_long(int argc, char * argv[], const char *optstr, + const struct option *longopts, int *longind) +{ + char *opt; + optarg = NULL; + if (longind) { + *longind = -1; + } + if (optind < 0) { + return -1; + } + if (optind == 0) { /* Initial or re-initialising call */ + ++optind; /* Skip argv[0] */ + } + if (optind >= argc) { + return -1; + } + opt = argv[optind]; + if (*opt == '-') { /* argv[optind] is an option */ + ++optind; + if (*++opt == ':') { + optopt = ':'; + return '?'; + } + if (*opt != '-') { /* Short option */ + char *where = strchr(optstr,*opt); + if (!where) { + optopt = *opt; + return '?'; + } + if (where[1] != ':') { /* No argument */ + if (opt[1]) { + optopt = *opt; + return '?'; + } + optarg = NULL; + return *opt; + } + else if (where[2] != ':') { /* Optional argument */ + if (opt[1] != 0) { /* arg abuts opt */ + optarg = opt + 1; + return *opt; + } + else if (optind >= argc || *argv[optind] == '-') { + /* No arg */ + optarg = NULL; + return *opt; + } + else { /* Arg is next argv */ + optarg = argv[optind++]; + return *opt; + } + } + else { /* Required argument */ + if (opt[1] != 0) { /* arg abuts opt */ + optarg = opt + 1; + return *opt; + } + else if (optind >= argc || *argv[optind] == '-') { + /* Required arg missing */ + optopt = *opt; + return '?'; + } + else { /* arg is next argv */ + optarg = argv[optind++]; + return *opt; + } + } + } + else { /* Long option */ + int i, match = -1; + size_t optlen; + /* Test for `opt=arg' and get length of opt */ + char *eq = strchr(++opt,'='); + if (eq) { + optarg = eq + 1; + optlen = eq - opt; + } + else { + optlen = strlen(opt); + } + /* Test for exactly one match of the option */ + for (i = 0; longopts[i].name != NULL; ++i) { + if (!strncmp(opt,longopts[i].name,optlen)) { + if (match != -1) { + match = -1; + break; + } + match = i; + } + } + if (longind != NULL) { + *longind = match; + } + if (match == -1) { /* Not found */ + return '?'; + } + switch(longopts[match].has_arg) { + case no_argument: + if (optarg) { /* Illegal arg */ + return '?'; + } + break; + case required_argument: + if (optarg) { /* Arg after `=' */ + break; + } + if (optind >= argc || *argv[optind] == '-') { + /* Required arg missing */ + return '?'; + } + /* Arg is next argv */ + optarg = argv[optind++]; + break; + case optional_argument: + if (optarg) { /* Arg after `=' */ + break; + } + if (optarg || optind >= argc || *argv[optind] == '-') { + /* No argument */ + break; + } + optarg = argv[optind++]; + break; + default: + assert(false); + } + /* Store or return value as required */ + if (longopts[match].flag != NULL) { + *(longopts[match].flag) = longopts[i].val; + return 0; + } + else { + return longopts[match].val; + } + } + } + else { /* argv[optind] is a non-option. + We want to shuffle it to the end */ + bool done = true; /* Posit no more options to the right */ + int i; + for (i = optind; done && i < argc; ++i) { + /* Now see if this is true */ + done = *argv[i] != '-'; + } + if (done) { /* There are no more options to the right */ + optarg = argv[optind]; /* optind at start of non-options */ + return -1; /* All done */ + } + else { /* There are more options to the right */ + /* Swap the current non-opt to the end of argv */ + char *temp = argv[optind]; + memmove(argv + optind,argv + optind + 1, + (argc - optind - 1) * sizeof(char *)); + argv[argc - 1] = temp; + /* Try for another option */ + return getopt_long(argc,argv,optstr,longopts,longind); + } + } +} + +/*! Write brief command usage information to a file + * \param fp Stream to which the info will be written. + */ +static void +usage(FILE * fp) +{ + const char *prog_name = GET_PUBLIC(args,prog_name); + + fprintf(fp,"usage:\n" + "1)\t%s [OPTIONS] [FILE...]\n" + "\t\tProcess FILEs using OPTIONS. By default read stdin.\n" + "OPTIONS:\n" + "-fARGFILE | --file ARGFILE\n" + "\t\tRead other arguments from ARGFILE.\n" + "-r, --replace\n" + "\t\tOverwrite input file with output file.\n" + "\t\tWith -r, stdin supplies the input filenames.\n" + "\t\tOtherwise stdin supplies an input file; " + "the output file is stdout.\n" + "-R, --recurse\n" + "\t\tRecurse into directories to find input files.\n" + "\t\tImplies --replace.\n" + "-FEXT1[,EXT2...]\n" + "--filter EXT1[,EXT2...]\n" + "\t\tProcess only input files that have one of the file extensions " + "EXT1,EXT2...\n" + "-BSUFFIX, --backup SUFFIX\n" + "\t\tBackup each input file by appending SUFFIX to the name.\n" + "\t\tApplies only with -r.\n" + "-DSYM, --define SYM\n" + "\t\tAssume symbol SYM to be defined.\n" + "-USYM, --undef SYM\n" + "\t\tAssume symbol SYM to be undefined\n" + "-xd, --conflict delete\n" + "\t\tDelete #defines and #undefs that contradict -D or -U args.\n" + "-xc, --conflict comment\n" + "\t\tInsert diagnostic comments on contradictions as per -xd. " + "(Default)\n" + "-xe, --conflict error\n" + "\t\tInsert diagnostic #errors on contradictions as per -xd.\n" + "-g[p|i|w|e|a],\n" + "--gag [progress| info | warning | error | abend]\n" + "\t\tSuppress diagnostics no worse than " + "{progress | info | warning | error | abend}\n" + "-gs, --gag summary\n" + "\t\tSuppress summary diagnostics at exit\n" + "\t\tDefault is -gp -gi -gs\n" + "-V, --verbose\n" + "\t\tOutput all diagnostics\n" + "-c, --complement\n" + "\t\tComplement. Retain lines that should be dropped and vice versa.\n" + "\t\t(Retained #-directives will still be simplified where possible.)\n" + "-D, --debug\n" + "\t\tDisplay debugging info.\n" + "-ne[d], --constant eval[,del]\n" + "\t\tEvaluate constants as truth-functional operands in #ifs, " + "\and optionally eliminate them.\n" + "\t\t(Constant arithmetic operands are always evaluated.)\n" + "-nu, --constant unknown\n" + "\t\tTreat constants as unknowns for truth functional-simplification of #ifs\n" + "-kd, --discard drop\n" + "\t\tDrop discarded lines from output\n" + "-kb, --discard blank\n" + "\t\tBlank discarded lines on output\n" + "-kc, --discard comment\n" + "\t\tComment out discarded lines on output\n" + "-K, --keepgoing\n" + "\t\tIf a parse error is encountered in an input file, continue " + "processing subsequent input files\n" + "-P, --pod\n" + "\t\tApart from #-directives, input is Plain Old Data.\n" + "-l, --line\n" + "\t\tOutput #line directives to preserve the line numbers of retained lines\n" + "\t\tComments and quotations will not be parsed.\n\n" + "2)\t%s -h, --help\n" + "\t\tDisplay this help and exit.\n\n" + "3)\t%s -v, --version\n" + "\t\tDisplay version info and exit.\n\n" + "4)\t%s -s{a|f}[l] [OTHER_OPTS] [FILE...]\n" + "\t%s --symbols { all | first }[,locate] [OTHER_OPTS] [FILE...]\n" + "\t\tOnly output a list of symbols that control #ifs in FILEs.\n" + "\t\t\ta, all: list all occurrences of symbols.\n" + "\t\t\tf, first: list only first occurrence of each symbol.\n" + "\t\t\tl, locate: list file and line location.\n" + "\t\tOTHER_OPTS may be -R, --recurse or -F, --filter as per form 1)\n\n", + prog_name,prog_name,prog_name,prog_name,prog_name); +} + +/*! Wrapper for \c usage(stderr) call, used for \c atexit() + * registration + */ +static void +usage_error_summary(void) +{ + usage(stderr); +} + +/*! Write a usage error diagnostic on \c stderr followed by a usage + * summary, then terminate the program. + * + * \param reason Reason code the for usage error + * \param format Format for composing error disgnostic with subsequent args + * + * If \c format is \c NULL then the diagnostic is assumed to be + * "Invalid usage" and the reason is defaulted to GRIPE_USAGE_ERROR + */ +static void +usage_error(int reason, const char *format,...) +{ + if (format) { + va_list argp; + atexit(usage_error_summary); + va_start(argp,format); + vbail(reason,format,argp); + va_end(argp); + } + else { + usage_error(GRIPE_USAGE_ERROR,"Invalid usage"); + } +} + +/*! Write brief command usage information to \c stdout + * for the \c --help option, then terminate the program + * wihtout error. + */ +static void +usage_help(void) +{ + usage(stdout); + exit(MSGCLASS_NONE); +} + +#ifndef VERSION +#ifdef UNIX +#error VERSION not defined. +#endif +#define VERSION "3.1.3" +#endif +/*! Write version information about the program on \c stdout + */ +static void +version(void) +{ + printf("%s, version %s for %s (built %s, %s)\n", + GET_PUBLIC(args,prog_name),VERSION,OS_TYPE,__DATE__,__TIME__); + exit(MSGCLASS_NONE); +} + +/*! Configure diagnostic output in response to a \c --gag or \c --verbose + * option. + * \param arg Either "verbose" or an argument to the \c --gag option + */ +static void +config_diagnostics(const char * arg) +{ + int mask = MSGCLASS_NONE; + if (GET_PUBLIC(args,diagnostic_filter) < 0 && strcmp(arg,"verbose")) { + report(GRIPE_VERBOSE_ONLY,NULL, + "Can't mix --verbose with --gag.'--gag %s' ignored",arg); + return; + } + if (!strcmp(arg,"progress")) { + mask = MSGCLASS_PROGRESS; + } + else if (!strcmp(arg,"info")) { + mask = MSGCLASS_INFO; + } + else if (!strcmp(arg,"warning")) { + mask = MSGCLASS_WARNING; + } + else if (!strcmp(arg,"error")) { + mask = MSGCLASS_ERROR; + } + else if (!strcmp(arg,"abort")) { + mask = MSGCLASS_ABEND; + } + else if (!strcmp(arg,"summary")) { + mask = MSGCLASS_SUMMARY; + } + else if (!strcmp(arg,"verbose")) { + int diagnostic_filter = GET_PUBLIC(args,diagnostic_filter); + if (diagnostic_filter > 0) { + report(GRIPE_VERBOSE_ONLY,NULL, + "Can't mix --verbose with --gag. '--verbose' ignored"); + return; + } + else if (diagnostic_filter < 0) { + report(GRIPE_DUPLICATE_MASK,NULL,"'--verbose' already seen"); + return; + } + SET_PUBLIC(args,diagnostic_filter) = -1; + return; + } + else { + usage_error(GRIPE_USAGE_ERROR,"Invalid argument for --gag: \"%s\"",arg); + } + if (mask & GET_PUBLIC(args,diagnostic_filter)) { + report(GRIPE_DUPLICATE_MASK,NULL, + "'--gag %s' already seen",arg); + } + SET_PUBLIC(args,diagnostic_filter) |= mask; + if (mask == MSGCLASS_INFO) { + config_diagnostics("progress"); + } + else if (mask == MSGCLASS_WARNING) { + config_diagnostics("info"); + } + else if (mask == MSGCLASS_ERROR) { + config_diagnostics("warning"); + } + else if (mask == MSGCLASS_ABEND) { + config_diagnostics("error"); + } +} + +/*! Configure the final state of diagnostic output filtering. + + If no \c --gag or \c --verbose option has been seen, + default to --gag info --gag summary. +*/ + +static void +finalise_diagnostics(void) +{ + int mask = GET_PUBLIC(args,diagnostic_filter); + if (!mask) { + /* Default diagnostic masking to no progress + messages, no infos, no summaries */ + config_diagnostics("info"); + config_diagnostics("summary"); + } + else if (mask == -1) { + /* --verbose was temporarily set as -1 to block later + --gag options. Can now reset as 0 */ + SET_PUBLIC(args,diagnostic_filter) = 0; + } +} + +/*! Parse commandline options from a file specified with the \c --file + * option. + * \param argsfile Name of the file from which to read options + * Options are separated by whitespace in the file. The parsed options + * are stored in an \c argv array held in the module's private state. + * This array can then be parsed by parse_args() as if passed to main(). + */ +static void +parse_args_file(const char *argsfile) +{ + char *arg, * delims=" \t\n\r"; + char **argv; + int argc; + size_t filesz,read; + FILE *in; + if (GET_STATE(args,memfile)) { + bail(GRIPE_MULTIPLE_ARGFILES,"--file can only be used once"); + } + in = open_file(argsfile,"r"); + fseek(in,0,SEEK_END); + filesz = ftell(in); + fseek(in,0,SEEK_SET); /* Back to start of file */ + SET_STATE(args,memfile) = allocate(filesz + 1); + ptr_vector_append(GET_STATE(args,argfile_argv),GET_PUBLIC(args,prog_name)); + /* Remember program name comes first */ + read = fread(GET_STATE(args,memfile),1,filesz,in); + if (!read) { /* Read args file into heap */ + bail(GRIPE_CANT_READ_INPUT,"Read error on file %s",argsfile); + /* Not bullet-proof to assume that only 0 bytes read is + a read error, but cannot portably test `read' == `filesz' + because if there are newlines in the file then on Windows, fewer + bytes will be read than there are in the file due to newline + conversion */ + + } + fclose(in); + GET_STATE(args,memfile)[read] = '\0'; /* 0-terminate commandline */ + for(arg = strtok(GET_STATE(args,memfile),delims); + arg != NULL; arg = strtok(NULL,delims)) { + ptr_vector_append(GET_STATE(args,argfile_argv),arg); + } + argc = (int)ptr_vector_count(GET_STATE(args,argfile_argv)); + argv = (char **)ptr_vector_start(GET_STATE(args,argfile_argv)); + parse_args(argc,argv); +} + +/*! Parse the policy for handling constants in #ifs from the + * argument to the \c --constant option. + */ +static void +parse_constants_policy(const char *optarg) +{ + bool eval_consts = false; + bool delete_consts = false; + + int optlen = (int)strlen(optarg); + if (optlen < 3) { + /* Short form */ + eval_consts = optarg[0] == 'e'; + if (!eval_consts && optarg[0] != 'u') { + usage_error(GRIPE_USAGE_ERROR, + "Invalid argument for -n: \"%s\"",optarg); + } + delete_consts = optlen == 2 && optarg[1] == 'd'; + if (!delete_consts && optlen == 2) { + usage_error(GRIPE_USAGE_ERROR, + "Invalid argument for -n: \"%s\"",optarg); + } + } + else { + /* Long form */ + char *comma = strchr(optarg,','); + if (comma) { + size_t len = comma - optarg; + if (!strncmp("eval",optarg,len)) { + eval_consts = true; + } + else { + usage_error(GRIPE_USAGE_ERROR, + "Invalid argument for --constant: \"%s\"",optarg); + } + if (!strcmp(comma + 1,"del")) { + delete_consts = true; + } + else { + usage_error(GRIPE_USAGE_ERROR, + "Invalid argument for --constant: \"%s\"",optarg); + } + } + else if (!strcmp("eval",optarg)) { + eval_consts = true; + } + else if (strcmp("unk",optarg)) { + usage_error(GRIPE_USAGE_ERROR, + "Invalid argument for --constant: \"%s\"",optarg); + } + } + SET_PUBLIC(args,eval_consts) = eval_consts; + SET_PUBLIC(args,del_consts) = delete_consts; +} + +/*! Parse the policy for listing symbols that control #ifs + from the argument to the \c --symbols option. + */ +static void +parse_symbols_policy(const char *optarg) +{ + bool bad_arg = false; + SET_PUBLIC(args,symbols_policy) = SYMBOLS_LIST; + if (optarg) { + if (strlen(optarg) <= 2) { + switch(optarg[0]) { + case 'a': + break; + case 'f': + SET_PUBLIC(args,symbols_policy) |= SYMBOLS_LIST_FIRST; + break; + case 'l': + SET_PUBLIC(args,symbols_policy) |= SYMBOLS_LOCATE; + break; + default: + bad_arg = true; + } + switch(optarg[1]) { + case 0: + break; + case 'a': + if (optarg[0] == 'a') { + bad_arg = true; + } + break; + case 'f': + if (optarg[0] == 'f') { + bad_arg = true; + } + SET_PUBLIC(args,symbols_policy) |= SYMBOLS_LIST_FIRST; + break; + case 'l': + if (optarg[0] == 'l') { + bad_arg = true; + } + SET_PUBLIC(args,symbols_policy) |= SYMBOLS_LOCATE; + break; + default: + bad_arg = true; + } + } + else if (!strcmp(optarg,"all")) {} + else if (!strcmp(optarg,"first")) { + SET_PUBLIC(args,symbols_policy) |= SYMBOLS_LIST_FIRST; + } + else if (!strcmp(optarg,"locate")) { + SET_PUBLIC(args,symbols_policy) |= SYMBOLS_LOCATE; + } + else { + char const *comma = strchr(optarg,','); + if (comma) { + if (!strncmp(optarg,"all",comma - optarg)) {} + else if (!strncmp(optarg,"first",comma - optarg)) { + SET_PUBLIC(args,symbols_policy) |= SYMBOLS_LIST_FIRST; + } + else if (!strncmp(optarg,"locate",comma - optarg)) { + SET_PUBLIC(args,symbols_policy) |= SYMBOLS_LOCATE; + } + else { + bad_arg = true; + } + if (!strcmp(comma + 1,"all")) { + if (!strncmp(optarg,"all",comma - optarg)) { + bad_arg = true; + } + } + else if (!strcmp(comma + 1,"first")) { + if (GET_PUBLIC(args,symbols_policy) & SYMBOLS_LIST_FIRST) { + bad_arg = true; + } + else { + SET_PUBLIC(args,symbols_policy) |= SYMBOLS_LIST_FIRST; + } + } + else if (!strcmp(comma + 1,"locate")) { + if (GET_PUBLIC(args,symbols_policy) & SYMBOLS_LOCATE) { + bad_arg = true; + } + else { + SET_PUBLIC(args,symbols_policy) |= SYMBOLS_LOCATE; + } + } + else { + bad_arg = true; + } + } + else { + bad_arg = true; + } + } + if (bad_arg) { + usage_error(GRIPE_USAGE_ERROR, + "Invalid argument for --symbols: \"%s\"",optarg); + } + } +} + +/*! + Check the consistency of the commandline options + and rectify innocuous mistakes. +*/ +static void +sanity_checks(void) +{ + bool list_symbols_only = GET_PUBLIC(args,symbols_policy) != SYMBOLS_NO; + bool replace = GET_PUBLIC(args,replace); + bool recurse = GET_PUBLIC(args,recurse); + char *backup_suffix = GET_PUBLIC(args,backup_suffix); + size_t symbols = ptr_vector_count(GET_PUBLIC(symbol_table,sym_tab)); + + if (list_symbols_only && symbols > 0) { + usage_error(GRIPE_INVALID_ARGS, + "--symbols does not mix with --define,--undefine"); + } + if (symbols == 0 && !list_symbols_only) { + usage_error(GRIPE_NOTHING_TO_DO, + "Nothing to do. Must --define or --undefine at least one symbol"); + } + if (list_symbols_only) { + if (recurse) { + replace = SET_PUBLIC(args,replace) = false; + } + if (replace) { + report(GRIPE_REDUNDANT_OPTION,NULL, + "--replace is redundant with --symbols"); + SET_PUBLIC(args,replace) = false; + } + if (backup_suffix != NULL) { + report(GRIPE_REDUNDANT_OPTION,NULL, + "--backup is redundant with --symbols"); + backup_suffix = SET_PUBLIC(args,backup_suffix) = NULL; + } + line_despatch_no_op(); + } + if (backup_suffix != NULL && !replace) { + usage_error(GRIPE_INVALID_ARGS, + "--backup needs --replace"); + } +} + +/*! + Add files to the input dataset. + + \param path File or directory to be included in the + input dataset. + + \return True if \c path is added to the input dataset, + else false. + + If \e path is a file that satisfies any \c --filter option + it is added to the input dataset. + + If \e path is a directory and \c --recurse is in force then + files recursively beneath it that satisfy any \c --filter + option are added to the input dataset. + + If \e path is a directory and \c --recurse is not in force + then the directory is ignored. + +*/ +static bool +add_files(char const *path) +{ + fs_obj_type_t obj_type = fs_file_or_dir(path); + if (FS_IS_FILE(obj_type) || GET_PUBLIC(args,recurse)) { + dataset_add(path); + return true; + } + report(GRIPE_DIR_IGNORED,NULL, + "--recurse not specified. Ignoring directory \"%s\"",path); + return false; +} + + +/*@}*/ + +/* API *********************************************************************/ + +void +parse_executable(char **argv) +{ + char *last_slash; + SET_PUBLIC(args,exec_path) = *argv; + last_slash = strrchr(*argv,PATH_DELIM); + if (!last_slash) { + SET_PUBLIC(args,prog_name) = *argv; + } + else { + SET_PUBLIC(args,prog_name) = last_slash + 1; + } +} + +void +parse_args(int argc, char *argv[]) +{ + static const char * const opts = "x:g:p:f:D:U:B:F:n:k:s:PRrcdlhvVK"; + static bool parsing_file; + int args = argc; + int opt, save_ind, long_index; + + for (optind = 0; + (opt = getopt_long(argc,argv,opts,long_options,&long_index)) != -1; ) { + switch (opt) { + case OPT_FILE: /* Read further args from file */ + save_ind = optind; + /* Remember where we have parsed up to */ + parsing_file = true; + parse_args_file(optarg); /* Parse file */ + parsing_file = false; + optind = save_ind; /* Restore position */ + break; + case OPT_CONFLICT: /* Policy for contradictions */ + { + int conflict_policy = CONTRADICTION_COMMENT; + if (strlen(optarg) > 1) { + if (!strcmp(optarg,"delete")) { + conflict_policy = CONTRADICTION_DELETE; + } + else if (!strcmp(optarg,"comment")) { + conflict_policy = CONTRADICTION_COMMENT; + } + else if (!strcmp(optarg,"error")) { + conflict_policy = CONTRADICTION_ERROR; + } + else { + usage_error(GRIPE_USAGE_ERROR, + "Invalid argument for --conflict: \"%s\"",optarg); + } + } + else { + switch(*optarg) { + case 'd': + conflict_policy = CONTRADICTION_DELETE; + break; + case 'c': + conflict_policy = CONTRADICTION_COMMENT; + break; + case 'e': + conflict_policy = CONTRADICTION_ERROR; + break; + default: + usage_error(GRIPE_USAGE_ERROR, + "Invalid argument for -x: \"%c\"",*optarg); + } + } + contradiction_policy(conflict_policy); + } + break; + case OPT_GAG: + { + char const *gag_arg = optarg; + if (strlen(optarg) == 1) { + switch(*optarg) { + case 'p': + gag_arg = "progress"; + break; + case 'i': + gag_arg = "info"; + break; + case 'w': + gag_arg = "warning"; + break; + case 'e': + gag_arg = "error"; + break; + case 'a': + gag_arg = "abend"; + break; + case 's': + gag_arg = "summary"; + break; + default: + assert(false); + } + } + config_diagnostics(gag_arg); + } + break; + case OPT_VERBOSE: + config_diagnostics("verbose"); + break; + case OPT_DEF: /* define a symbol */ + add_specified_symbol(true,optarg); + break; + case OPT_UNDEF: /* undef a symbol */ + add_specified_symbol(false, optarg); + break; + case OPT_COMPLEMENT: /* treat -D as -U and vice versa */ + SET_PUBLIC(args,complement) = true; + break; + case OPT_REPLACE: + SET_PUBLIC(args,replace) = true; + break; + case OPT_DEBUG: + debugging(true); + break; + case OPT_BACKUP: + SET_PUBLIC(args,backup_suffix) = optarg; + break; + case OPT_CONSTANT: /* policy for constants in #ifs */ + parse_constants_policy(optarg); + break; + case OPT_DISCARD: /* policy for discarding lines on output */ + if (strlen(optarg) > 1) { + if (!strcmp("drop",optarg)) { + SET_PUBLIC(args,discard_policy) = DISCARD_DROP; + } + else if (!strcmp("blank",optarg)) { + SET_PUBLIC(args,discard_policy) = DISCARD_BLANK; + } + else if (!strcmp("comment",optarg)) { + SET_PUBLIC(args,discard_policy) = DISCARD_COMMENT; + } + else { + usage_error(GRIPE_USAGE_ERROR, + "Invalid argument for --discard: \"%s\"",optarg); + } + } + else { + switch(*optarg) { + case 'd': + SET_PUBLIC(args,discard_policy) = DISCARD_DROP; + break; + case 'b': + SET_PUBLIC(args,discard_policy) = DISCARD_BLANK; + break; + case 'c': + SET_PUBLIC(args,discard_policy) = DISCARD_COMMENT; + break; + default: + usage_error(GRIPE_USAGE_ERROR, + "Invalid argument for -k: \"%c\"",*optarg); + } + } + break; + case OPT_LINE: + SET_PUBLIC(args,line_directives) = true; + break; + case OPT_SYMBOLS: /* just list symbols that control #ifs */ + parse_symbols_policy(optarg); + break; + case OPT_POD: /* don't parse quotes or comments */ + SET_PUBLIC(args,plaintext) = true; + break; + case OPT_HELP: /* help */ + usage_help(); + break; + case OPT_VERSION: /* version */ + version(); + break; + case OPT_RECURSE: /* recurse into directories */ + SET_PUBLIC(args,recurse) = true; + SET_PUBLIC(args,replace) = true; + break; + case OPT_FILTER: /* Filter input by file extensions */ + dataset_filter_filetypes(optarg); + break; + case OPT_KEEPGOING: /* Continue to process subsequent in + put files after errors */ + SET_PUBLIC(args,keepgoing) = true; + break; + default: + usage_error(GRIPE_USAGE_ERROR, + "Invalid option: \"%s\"",argv[optind - 1]); + } + } + if (!parsing_file) { + SET_PUBLIC(args,got_opts) = true; + finalise_diagnostics(); + if (!PROGRESS_GAGGED()) { + heap_str argstr = concatenate(args,argv,' '); + report(PROGRESS_GOT_OPTIONS,NULL,"Args: %s",argstr); + free(argstr); + } + sanity_checks(); + if (argc) { + report(PROGRESS_BUILDING_TREE,NULL,"Building input tree"); + } + } + argc -= optind; + argv += optind; + for ( ;argc; --argc,++argv) { + if (!add_files(*argv)) { + ++SET_STATE(args,arg_dirs_ignored); + } + } + +} + + +void +finish_args(void) +{ + bool list_symbols_only = GET_PUBLIC(args,symbols_policy) != SYMBOLS_NO; + bool replace = GET_PUBLIC(args,replace); + bool input_is_stdin = false; + + if (file_tree_is_empty(GET_PUBLIC(dataset,file_tree)) && + GET_STATE(args,arg_dirs_ignored) == 0) { + /* No input files on command line */ + if (!GET_PUBLIC(args,replace)) { + /* Without --replace, stdin is the input file */ + input_is_stdin = true; + } + else { + /* With --replace, stdin supplies input filenames */ + char * infile; + while ((infile = read_filename()) != NULL) { + (void)add_files(infile); + } + } + } + if (file_tree_is_empty(GET_PUBLIC(dataset,file_tree)) && !input_is_stdin) { + bail(GRIPE_NOTHING_TO_DO, + "Nothing to do. No input files."); + } + if (!list_symbols_only && !input_is_stdin && + file_tree_count(GET_PUBLIC(dataset,file_tree),FT_COUNT_FILES,NULL) > 1 && + !replace) { + bail(GRIPE_ONE_FILE_ONLY, + "Need --replace to process multiple files"); + } + report(PROGRESS_FILE_TALLY,NULL,"%d files to process", + file_tree_count(GET_PUBLIC(dataset,file_tree),FT_COUNT_FILES,NULL)); +#ifdef DEBUG_FILE_TREE + file_tree_dump(GET_PUBLIC(dataset,file_tree)); + exit(0); +#endif + +} + +/* EOF */ diff --git a/src/args.h b/src/args.h new file mode 100755 index 0000000..876ec90 --- /dev/null +++ b/src/args.h @@ -0,0 +1,147 @@ +#ifndef ARGS_H +#define ARGS_H +/*************************************************************************** + * Copyright (C) 2004, 2006 Symbian Software Ltd. * + * All rights reserved. * + * Copyright (C) 2007, 2008 Mike Kinghan, imk@strudl.org * + * All rights reserved. * + * * + * Contributed originally by Mike Kinghan, imk@strudl.org * + * * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * Redistributions of source code must retain the above copyright * + * notice, this list of conditions and the following disclaimer. * + * * + * Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * * + * Neither the name of Symbian Software Ltd. nor the names of its * + * contributors may be used to endorse or promote products derived from * + * this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,* + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * + * DAMAGE. * + * * + ***************************************************************************/ + +#include "opts.h" +#include "file_tree.h" +#include "ptr_vector.h" + + +/*!\ingroup args_module args_module_interface + *\file args.h + * This file provides the Args module interface + */ + +/*!\addtogroup args_interface */ +/*@{*/ +/*! The maximum supported number of diagnostic filters. + */ +#define MAXMASKS 64 + +/*! Enumeration of policies for discarding lines */ +typedef enum { + DISCARD_DROP, /*!< Drop discarded lines */ + DISCARD_BLANK, /*!< Blank discarded lines */ + DISCARD_COMMENT /*!< Comment discarded lines */ +} discard_policy_t; + +/*! Enumeration of policies for discarding lines */ +typedef enum { + SYMBOLS_NO, /*!< Not listing symbols */ + SYMBOLS_LIST = 1, /*!< Listing symbols */ + SYMBOLS_LIST_FIRST = 3, /*!< List symbol only once */ + SYMBOLS_LOCATE = 4 /*!< List symbol file and line location */ +} symbols_policy_t; + + +/*! \fn void parse_executable(char **argv); + * Parse the full and short names of the executable. + * \param argv The array of commandline arguments. + * + * Element 0 of \em argv is parsed to find the complete + * pathname and filename of our executable and the addresses + * of these strings are stored respectively at \c exec_path and + * \c prog_name in the module's state. + */ +extern void +parse_executable(char **argv); + +/*! Parse the commandline. + * \param argc The number of commandline arguments. + * \param argv Array of commandline arguments. + * + * Populate the module's state by parsing the commandline arguments. + */ +extern void +parse_args(int argc, char *argv[]); + +/*! Analyse the module's state after parsing the commandline, + * diasgnose any errors and draw final conclusions. + */ +extern void +finish_args(void); + +/*@}*/ + +/*!\ingroup args_interface_state_utils */ +/*@{*/ + +/*! The public state of the Args module + */ +PUBLIC_STATE_DEF(args) { + char *exec_path; + /*!< argv[0] */ + char *prog_name; + /*!< Filename element of \c exec_path */ + char *backup_suffix; + /*!< Suffix for backup files */ + bool got_opts; + /*!< Are we finished parsing the commandline? */ + bool replace; + /*!< Do we replace input files with output files? */ + symbols_policy_t symbols_policy; + /*!< Are we just to list #if-controlling symbols? + If so, how? + */ + bool complement; + /*!< Are to output lines instead of dropping tem and vice versa? */ + bool eval_consts; + /*!< Do we evaluate constants in #ifs or treat them as + unknowns? */ + bool del_consts; + /*!< Do we delete evaluated contants? */ + discard_policy_t discard_policy; + /*!< Policy for discarding lines */ + bool line_directives; + /*!< Do we output #line directives? */ + bool plaintext; + /*!< Are we to omit parsing for comments? */ + bool recurse; + /*!< Recurse into directories? */ + bool keepgoing; + /*!< Continue to process input files after errors */ + int diagnostic_filter; + /*!< Bitmask of diagnostic filters */ +} PUBLIC_STATE_T(args); + +IMPORT(args); +/*@}*/ + + +#endif /* EOF */ diff --git a/src/bool.h b/src/bool.h new file mode 100755 index 0000000..b5d3c2d --- /dev/null +++ b/src/bool.h @@ -0,0 +1,60 @@ +#ifndef BOOL_H +#define BOOL_H + +/*************************************************************************** + * Copyright (C) 2004, 2006 Symbian Software Ltd. * + * All rights reserved. * + * Copyright (C) 2007, 2008 Mike Kinghan, imk@strudl.org * + * All rights reserved. * + * * + * Contributed originally by Mike Kinghan, imk@strudl.org * + * * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * Redistributions of source code must retain the above copyright * + * notice, this list of conditions and the following disclaimer. * + * * + * Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * * + * Neither the name of Symbian Software Ltd. nor the names of its * + * contributors may be used to endorse or promote products derived from * + * this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,* + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * + * DAMAGE. * + * * + ***************************************************************************/ + +#include "opts.h" + +/*! \file bool.h + * This file provides boolean constants if not supported by the language + * implementation. + */ + +#if HAVE_STDBOOL_H + +#include + +#else + +typedef enum { false, true } bool; + +#endif + +#endif +/* EOF */ diff --git a/src/categorical.c b/src/categorical.c new file mode 100755 index 0000000..a9b86e3 --- /dev/null +++ b/src/categorical.c @@ -0,0 +1,351 @@ +/*************************************************************************** + * Copyright (C) 2004, 2006 Symbian Software Ltd. * + * All rights reserved. * + * Copyright (C) 2007, 2008 Mike Kinghan, imk@strudl.org * + * All rights reserved. * + * * + * Contributed originally by Mike Kinghan, imk@strudl.org * + * * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * Redistributions of source code must retain the above copyright * + * notice, this list of conditions and the following disclaimer. * + * * + * Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * * + * Neither the name of Symbian Software Ltd. nor the names of its * + * contributors may be used to endorse or promote products derived from * + * this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,* + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * + * DAMAGE. * + * * + ***************************************************************************/ + +#include "categorical.h" +#include "report.h" +#include "evaluator.h" +#include "line_despatch.h" +#include "memory.h" +#include "io.h" +#include "if_control.h" +#include +#include + +/*!\ingroup categorical_internals categorical_interface + * \file categorical.c + * This file implements the Categorical module + */ + +/*! \ingroup categorical_internals_state_utils */ +/*@{*/ + +/*! The global state of the Categorical module */ +STATE_DEF(categorical) { + /*! The public state of the Categorical module */ + INCLUDE_PUBLIC(categorical); + /*! This is the prefix for diagnostics inserted into the output: + * - "//" when --conflict comment is in force. + * - "#" when --conflict error is in force. + */ + char * contradiction_insert_prefix; + /*! This is the reason code issued when a contradiction is diagnosed: + * - GRIPE_COMMENTED_CONTRADICTION when --conflict comment is + * in force. + * - GRIPE_ERRORED_CONTRADICTION when --conflict error is + * in force. + * - GRIPE_DELETED_CONTRADICTION when --conflict delete is + * in force. + */ + int contradiction_insert_reason; + /*! In the preamble of \c save_contradiction() we record here if any + * warnings had already accrued in the exit status, because we will + * provisionally register warnings in the exit status. If we later + * discover there is no contradiction then we need to clear warnings + * from the exit status if this was the first. + */ + bool had_warnings; + /*! Pointers for a pair of heap buffers in which to compose + * diagnositic messages for \c stdout and \c stderr + */ + heap_str err_msg_buf[2]; +} STATE_T(categorical); +/*@}*/ + +/*! \addtogroup categorical_internals_state_utils */ +/*@{*/ + +IMPLEMENT(categorical,STATIC_INITABLE) + +USE_STATIC_INITIALISER(categorical) = { + { -1 }, + "//", + GRIPE_COMMENTED_CONTRADICTION +}; + +/*@}*/ + +/*!\addtogroup categorical_internals */ +/*@{*/ + +/*! Is there an undischarged conflict between an input \c #undef + * and a \c --define option? The macro tests whether any memory + * is allocated for our \c stderr buffer. + */ +#define CONTRADICTION_PENDING\ + (GET_STATE(categorical,err_msg_buf)[ERR_MSG_BUF] != 0) + +/*! Labels for output buffers associated with standard streams. */ +enum { + ERR_MSG_BUF, /*!< Buffer for \c stderr */ + OUT_MSG_BUF /*!< Buffer for \c stdout */ +}; + + +/* Helpers *****************************************************************/ + +/*! Compose a standard \c printf format for inserting error + diagnostics on output. + + \param buf Address of a pointer at which storage shall + be allocated to hold the composed format. + \param sub_format A \c printf format that is to be + embedded in within the one we are constructing. + + The function partially completes a format for diagnostics + that may be inserted in output in place of an \c #undef or + \c #define directive that contradicts a \c --define option. + It resolves the prefix of the diagnostic, depending on the + specified or default \c --conflict policy. + + \em sub_format varies depending on whether we want to + complain of an \c #undef that contradicts a \c --define + option, or of a \c #define that conflicts with a \c --define + option by differently redfining a symbol. + + The constructed format is stored in storage allocated + at a pointer that is stored at \em buf on return. It is + the caller's responsibility to free this storage. + */ +static void +compose_contradiction_insert_format(heap_str *buf, const char *sub_format) +{ + int buflen = 0; + int startoff = 0; + format_output(buf,&buflen,&startoff, + "%serror : inserted by sunifdef: %s at %s(%d)\n", + GET_STATE(categorical,contradiction_insert_prefix), + sub_format, + GET_PUBLIC(io,filename), + GET_PUBLIC(io,line_num)); +} + +/*! Erase the stored information that represents a pending diagnostic for + * a contradiction. + * + * We will call this function either when it turns out that there is + * no real contradiction to complain of, or when there is a contradiction + * and the diagnostic is discharged. + * + * There will be a diagnostic message at least for \c stderr, and also for + * \c stdout unless --conflict delete is in force. The diagnostics + * are allocated in heap blocks, and we will have stored the line number + * of the conflicting \c #undef directive to which the diagnostics refer. + * These data are deleted. + * + */ +void +forget_pending_contradiction(void) +{ + release((void **)(&GET_STATE(categorical,err_msg_buf)[OUT_MSG_BUF])); + release((void **)(&GET_STATE(categorical,err_msg_buf)[ERR_MSG_BUF])); + SET_PUBLIC(categorical,last_contradictory_undef) = -1; +} + +/*! Insert a stored error diagnostic into the output as an \c #error + * directive or a comment (depending on the \c --conflict policy) + * to replace an \c #undef or \c #define directive that conflicts with a + * \c --define option. Reiterate the diagnostic on stderr. + * + * If the --conflict delete is in force, there will be + * no diagnostic to insert in output, but the diagnostic is still + * written to \c stderr. + * + */ +static void +insert_pending_contradiction(void) +{ + assert(GET_STATE(categorical,err_msg_buf)[ERR_MSG_BUF]); + report(GET_STATE(categorical,contradiction_insert_reason), + &GET_STATE(categorical,err_msg_buf)[ERR_MSG_BUF],NULL); + if (GET_STATE(categorical,contradiction_insert_prefix)) { + substitute(GET_STATE(categorical,err_msg_buf)[OUT_MSG_BUF]); + if (GET_STATE(categorical,contradiction_insert_reason) == + GRIPE_ERRORED_CONTRADICTION) { + set_exit_flags(EVENT_SUMMARY_ERRORED_LINES,true); + if (is_unconditional_line()) { + set_exit_flags(EVENT_SUMMARY_ERROR_OUTPUT,true); + report(GRIPE_UNCONDITIONAL_ERROR_INPUT,NULL, + "An unconditional #error directive was output"); + } + } + } + else { + ++SET_PUBLIC(line_despatch,lines_dropped); + } + forget_pending_contradiction(); +} + +/*! Insert an error diagnostic into the output as an \c #error + * directive or a comment (depending on the \c --conflict policy) + * to replace an \c #undef directive that conflicts with a \c --define + * option. Reiterate the diagnostic on stderr. + * + * \param sub_format A \c printf format with which to compose the + * appropriate diagnostic. Varies depending on whether + * we want to complain of an \c #undef that contradicts + * a \c --define option, or of a \c #define that conflicts + * with a \c --define option by differently redfining a + * symbol. + */ + +static void +insert_contradiction(char const *sub_format) +{ + save_contradiction(sub_format); + insert_pending_contradiction(); +} +/*@}*/ + + +/* API ***************************************************************/ + +bool +weed_categorical_directive(int lineval) +{ + bool handled = false; + if (lineval > LT_EOF) { + handled = true; + switch(lineval) { + case LT_CONSISTENT_DEFINE_DROP: + drop(); + break; + case LT_CONSISTENT_UNDEF_KEEP: + case LT_CONSISTENT_DEFINE_KEEP: + print(); + break; + case LT_CONSISTENT_UNDEF_DROP: + drop(); + break; + case LT_CONTRADICTORY_DEFINE: + insert_contradiction("\"%.*s\" contradicts -U"); + break; + case LT_DIFFERING_DEFINE: + insert_contradiction("\"%.*s\" differently redefines -D " + "symbol"); + break; + case LT_CONTRADICTORY_UNDEF: + drop(); + /* N.B.! We return here so that our saved error is not + inserted immediately */ + return handled; + default:; + } + } + return handled; +} + +void +contradiction_policy(contradiction_policy_t p) +{ + switch(p){ + case CONTRADICTION_DELETE: + SET_STATE(categorical,contradiction_insert_prefix) = NULL; + SET_STATE(categorical,contradiction_insert_reason) = + GRIPE_DELETED_CONTRADICTION; + break; + case CONTRADICTION_COMMENT: + SET_STATE(categorical,contradiction_insert_prefix) = "//"; + SET_STATE(categorical,contradiction_insert_reason) = + GRIPE_COMMENTED_CONTRADICTION; + break; + case CONTRADICTION_ERROR: + SET_STATE(categorical,contradiction_insert_prefix) = "#"; + SET_STATE(categorical,contradiction_insert_reason) = + GRIPE_ERRORED_CONTRADICTION; + break; + default: + assert(false); + } +} + +void +flush_contradiction(void) +{ + if (GET_STATE(categorical,err_msg_buf)[ERR_MSG_BUF]) + { + --SET_PUBLIC(line_despatch,lines_dropped); + insert_pending_contradiction(); + } +} + +void +forget_contradiction(void) +{ + if (GET_STATE(categorical,err_msg_buf)[OUT_MSG_BUF]) { + if (!GET_STATE(categorical,had_warnings)) { + set_exit_flags(MSGCLASS_WARNING,false); + } + forget_pending_contradiction(); + } +} + +void +save_contradiction(char const *sub_format) +{ + size_t linelen = line_len(GET_PUBLIC(io,line_start)); + size_t extension_lines = GET_PUBLIC(io,extension_lines); + assert(GET_STATE(categorical,err_msg_buf)[ERR_MSG_BUF] == 0); + if (extension_lines) { + /* There may be embedded newlines or tabs in the error message buffer */ + flatten_line(GET_PUBLIC(io,line_start)); + } + SET_STATE(categorical,had_warnings) = get_exit_flags(MSGCLASS_WARNING) != 0; + report(GET_STATE(categorical,contradiction_insert_reason), + &GET_STATE(categorical,err_msg_buf)[ERR_MSG_BUF], + sub_format, + linelen, + GET_PUBLIC(io,line_start)); + if (GET_STATE(categorical,contradiction_insert_prefix)) { + heap_str contradiction_insert_format = NULL; + int buflen = 0; + int startoff; + compose_contradiction_insert_format(&contradiction_insert_format, + sub_format); + assert(GET_STATE(categorical,err_msg_buf)[OUT_MSG_BUF] == 0); + format_output(&GET_STATE(categorical,err_msg_buf)[OUT_MSG_BUF], + &buflen,&startoff, + contradiction_insert_format, + linelen, + GET_PUBLIC(io,line_start), + GET_PUBLIC(io,filename), + GET_PUBLIC(io,line_num)); + free(contradiction_insert_format); + } +} + +/* EOF */ diff --git a/src/categorical.h b/src/categorical.h new file mode 100755 index 0000000..b75c841 --- /dev/null +++ b/src/categorical.h @@ -0,0 +1,179 @@ +#ifndef CATEGORICAL_H +#define CATEGORICAL_H +/*************************************************************************** + * Copyright (C) 2004, 2006 Symbian Software Ltd. * + * All rights reserved. * + * Copyright (C) 2007, 2008 Mike Kinghan, imk@strudl.org * + * All rights reserved. * + * * + * Contributed originally by Mike Kinghan, imk@strudl.org * + * * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * Redistributions of source code must retain the above copyright * + * notice, this list of conditions and the following disclaimer. * + * * + * Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * * + * Neither the name of Symbian Software Ltd. nor the names of its * + * contributors may be used to endorse or promote products derived from * + * this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,* + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * + * DAMAGE. * + * * + ***************************************************************************/ + +#include "opts.h" + + /*!\ingroup categorical_module categorical_interface + * \file categorical.h + * This file provides the Categorical module interface + */ + +/*! \addtogroup categorical_interface */ +/*@{*/ + +/*! Enumeration of policies for handling \c #define or \c #undef + * directives that conflict with \c --define or \c --undefine + * options. + */ +typedef enum contradiction_policy { + /*! Delete conflicting directives */ + CONTRADICTION_DELETE, + /*! Replace conflicting directives with diagnostic comments */ + CONTRADICTION_COMMENT, + /*! Replace conflicting directives with \c #error directives */ + CONTRADICTION_ERROR +} contradiction_policy_t; + + +/*! Select the policy for handling \c #define or \c #undef directives. + * \param pol An enumerated constant that represents the selected + * policy. + * + * The policy is set in accordance with the \c --conflict option. + */ +extern void +contradiction_policy(contradiction_policy_t pol); + +/*! Deal with \c #define and #undef directives in input in accordance + * with the \c --conflict policy. + * + * \param lineval The evaluated line type of the current + * input line. + * + * If the evaluated line type is checked against the following set: + * - LT_CONSISTENT_DEFINE_DROP: + * - LT_CONSISTENT_UNDEF_KEEP: + * - LT_CONSISTENT_DEFINE_KEEP: + * - LT_CONSISTENT_UNDEF_DROP: + * - LT_CONTRADICTORY_DEFINE: + * - LT_DIFFERING_DEFINE: + * - LT_CONTRADICTORY_UNDEF: + * + * then the line is a \c #define or \c #undef directive for which + * a course of action has been determined that is encoded by the + * the line type. The function takes this action and returns true. If + * the line type is not one of this set then no action is taken and + * the function returns false. + * + * If true is returned then the line is not passed to the if-control + * state machine. + * + * \return \em true iff the line type is handled by this function. + */ +extern bool +weed_categorical_directive(int lineval); + +/*! Forget about an apparent conflict that would be governed by the + * \c --conflict policy when later input shows it to be innocuous. + * + * This function copes with the complication created by the common + * precautionary idioms: + * + * \c #undef FOO
+ * \c #define FOO + * + * and: + * + * \c #undef FOO
+ * \c #define FOO XYZ + * + * This input may be encountered when \c FOO is the subject of a \c --define + * option. In this case the precautionary \c #undef FOO will at first + * appear to conflict with that \c --define, but the ensuing \c #define + * will show that the conflict is only apparent. + * + * To cope with these cases, we defer diagnostic action on the + * \c #undef until we see what follows. If a \c #define follows that + * agrees with the \c --define options, with only whitespace and + * comments intervening, then we forget about the pending contradiction. + * This function clears the pending diagnostic action. + * + * \note An \c #undef that is prima facie conflicting will \em always be + * be dropped, whether or not it is anulled by a following \c #define. + * If is not anulled by a following \c #define, then it will dropped + * because any of the 3 possible \c --conflict policies will require + * it either to be simply dropped, or else dropped and replaced with a + * diagnostic insertion. If the \c #undef is anulled by a following + * \c #define, then both will be dropped because the \c #define in + * isolation would be dropped. + */ +extern void +forget_contradiction(void); + +/*! When we have dropped an \c #undef directive that conflicts with a + * \c --define option, and the conflict is not annulled by a following + * \c #define, we have a pending diagnostic action to discharge. It + * will consist of writing a warning to stderr, unless warnings are + * suppressed, and inserting a diagnostic comment or \c #error in the + * output, unless the \c --conflict policy is \c delete. + * + * This function discharges the pending action. + */ +extern void +flush_contradiction(void); + +/*! When an \c #undef directive is read that conflicts with a \c --define + * option, we will diagnose a conflict if the \c #undef is not followed + * by a \c #define that agrees with the conflicting \c --define. + * + * \param sub_format A printf format with which to compose the + * appropriate diaqnostic diagnostic. + * + * This function saves the diagnostic information pending our decision + * whether to use it or forget it. + */ +extern void +save_contradiction(char const *sub_format); + +/*@}*/ + +/*! \ingroup categorical_interface_state_utils */ +/*@{*/ + +/*! The public state of the Categorical module */ +PUBLIC_STATE_DEF(categorical) { + /*! Line number of the last \c #undef that contradicts a \c --define */ + int last_contradictory_undef; +} PUBLIC_STATE_T(categorical); + +IMPORT(categorical); +/*@}*/ + +#endif /* EOF */ diff --git a/src/chew.c b/src/chew.c new file mode 100755 index 0000000..a785d8a --- /dev/null +++ b/src/chew.c @@ -0,0 +1,327 @@ +/*************************************************************************** + * Copyright (C) 2004, 2006 Symbian Software Ltd. * + * All rights reserved. + * Copyright (C) 2002, 2003 Tony Finch . * + * All rights reserved. * + * Copyright (C) 1985, 1993 The Regents of the University of California. * + * All rights reserved. * + * Copyright (C) 2007, 2008 Mike Kinghan, imk@strudl.org * + * All rights reserved. * + * * + * Contributed by Mike Kinghan, imk@strudl.org, derived from the code * + * of Tony Finch * + * * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * Redistributions of source code must retain the above copyright * + * notice, this list of conditions and the following disclaimer. * + * * + * Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * * + * Neither the name of Symbian Software Ltd. nor the names of its * + * contributors may be used to endorse or promote products derived from * + * this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,* + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * + * DAMAGE. * + * * + ***************************************************************************/ + +#include "chew.h" +#include "args.h" +#include "io.h" +#include "if_control.h" +#include "report.h" +#include "symbol_table.h" + +/*!\ingroup chew_module, chew_interface, chew_internals + *\file chew.c + * This file implements the Chew module + */ + +/*! \ingroup chew_internals_state_utils */ +/*@{*/ + +/*! The global state of the Chew module */ +STATE_DEF(chew) { + /*! The public state of the module */ + INCLUDE_PUBLIC(chew); + bool escape; /*!< Last char read was escape? */ + bool in_double_quote; /*!< Are we reading within double quotes? */ + bool in_single_quote; /*!< Are we reading within single quotes? */ +} STATE_T(chew); + +/*@}*/ + +/*! \addtogroup chew_internals_state_utils */ +/*@{*/ +IMPLEMENT(chew,ZERO_INITABLE) +/*@}*/ + +/*! \ingroup chew_internals */ + +/*! Consume line-continuations at the input text pointer. + + \param cp The current text pointer + \return The next character of input following any sequence of 1 or more + line-continuations, i.e. "\\n". If there is no such sequence \e cp + is returned unchanged. + + If any line-continuations are found they are discarded from the + line-buffer and the line is extended with each continuation. + + */ +static char * +chew_continuation(char *cp) +{ + if (cp[0] == '\\' && EOL(cp + 1)) { + size_t gap; + size_t after_gap; + char *gap_start = cp; + do { + cp = read_more(cp); + ++cp; + if (*cp == '\r') { + ++cp; + } + if (*cp == '\n') { + ++cp; + } + } + while (cp[0] == '\\' && EOL(cp + 1)); + gap = cp - gap_start; + after_gap = strlen(cp); + memmove(gap_start,cp,after_gap); + gap_start[after_gap] = '\0'; + cp -= gap; + } + return cp; +} + + +/* API ***************************************************************/ + +bool +in_quotation(void) +{ + return GET_STATE(chew,in_single_quote) || GET_STATE(chew,in_double_quote); +} + +char * +chew_sym(char *cp) +{ + if (isalpha(*cp) || *cp == '_') { + for ( ;symchar(*cp); ++cp, cp = chew_continuation(cp)){} + } + return (cp); +} + +char * +chew_str(char *cp) +{ + for ( ;isgraph(*cp); ++cp, cp = chew_continuation(cp)){} + return (cp); +} + + +char * +chew_on(char *cp) +{ + if (GET_PUBLIC(args,plaintext)) { + for (; isspace((unsigned char)*cp); ++cp) { + if (EOL(cp)) { + SET_PUBLIC(chew,line_state) = LS_NEUTER; + } + } + return (cp); + } + while (*cp != '\0') { + if (cp[0] == '\\') { /* Toggle escape state */ + SET_STATE(chew,escape) = !GET_STATE(chew,escape); + ++cp; + continue; + } + if (cp[0] == '"') { + if (!GET_STATE(chew,escape) && !GET_STATE(chew,in_single_quote)) { + /* Can enter a double-quote state if we are not escaped and + not already in a single quote */ + if ((SET_STATE(chew,in_double_quote) = + !GET_STATE(chew,in_double_quote)) == true) { + SET_PUBLIC(chew,last_quote_start_line) = + GET_PUBLIC(io,line_num); + } + } + ++cp; + } + else if (cp[0] == '\'') { + /* Can enter a single-quote state if we are not escaped and + not already in a double quote */ + if (!GET_STATE(chew,escape) && !GET_STATE(chew,in_double_quote)) { + if ((SET_STATE(chew,in_single_quote) = + !GET_STATE(chew,in_single_quote)) == true) { + SET_PUBLIC(chew,last_quote_start_line) = + GET_PUBLIC(io,line_num); + } + } + ++cp; + } + else if (EOL(cp)) { /* Newline */ + if (GET_STATE(chew,escape)) { + /* Extend line buffer following line-continuation */ + cp = read_more(cp); + /* don't reset to LS_NEUTER after a line continuation */ + } + else { /* Plain newline */ + SET_PUBLIC(chew,line_state) = LS_NEUTER; + if (GET_PUBLIC(chew,comment_state) == CXX_COMMENT || + GET_PUBLIC(chew,comment_state) == PSEUDO_COMMENT) { + /* Newline terminates C++ comment */ + SET_PUBLIC(chew,comment_state) = NO_COMMENT; + SET_STATE(chew,in_double_quote) = + SET_STATE(chew,in_single_quote) = false; + } + else if (GET_PUBLIC(chew,comment_state) == C_COMMENT) { + SET_STATE(chew,in_double_quote) = + SET_STATE(chew,in_single_quote) = false; + ++SET_PUBLIC(io,extension_lines); + cp = read_more(cp); + } + else if (GET_STATE(chew,in_double_quote) || + GET_STATE(chew,in_single_quote)) { + /* Dangling quotation is not in comment. Error */ + parse_error(GRIPE_NEWLINE_IN_QUOTE, + "Newline within quotation"); + } + } + if (*cp == '\r') { + /* Detected Windows line-end in Unix environment */ + ++cp; + } + ++cp; + } + else if (cp[0] == ' ' || cp[0] == '\t') { /* Some whitespace */ + ++cp; + } + /* Could be at the start or end of a comment */ + else if (GET_PUBLIC(chew,comment_state) == NO_COMMENT || + GET_PUBLIC(chew,comment_state) == PSEUDO_COMMENT) { + /* Not in C or C++ comment */ + /* Check for start of comment */ + if (!GET_STATE(chew,in_double_quote) && + !GET_STATE(chew,in_single_quote)) { + /* Don't let comments start within quotation */ + if (!strncmp(cp, "/\\\n",3)) { + SET_PUBLIC(chew,comment_state) = STARTING_COMMENT; + SET_PUBLIC(chew,last_comment_start_line) = + GET_PUBLIC(io,line_num); + cp += 3; + } + if (!strncmp(cp, "/\\\r\n",4)) { + SET_PUBLIC(chew,comment_state) = STARTING_COMMENT; + SET_PUBLIC(chew,last_comment_start_line) = + GET_PUBLIC(io,line_num); + cp += 4; + } + else if (cp[0] == '/' && cp[1] == '*') { + SET_PUBLIC(chew,comment_state) = C_COMMENT; + SET_PUBLIC(chew,last_comment_start_line) = + GET_PUBLIC(io,line_num); + cp += 2; + } + else if (cp[0] == '/' && cp[1] == cp[0]) { + SET_PUBLIC(chew,comment_state) = CXX_COMMENT; + SET_PUBLIC(chew,last_comment_start_line) = + GET_PUBLIC(io,line_num); + cp += 2; + } + else if (GET_PUBLIC(chew,comment_state) == PSEUDO_COMMENT) { + /* Inside #error text. Truck on */ + ++cp; + } + else { /* No comment starting. We're done */ + SET_STATE(chew,escape) = false; + break; + } + } + else { /* We're inside quotation. Truck on */ + ++cp; + } + } + /* We are in a comment state. Check for end of comment */ + /* No need to test for end of C++ comment 'cos newline case + covers it */ + else if (GET_PUBLIC(chew,comment_state) == C_COMMENT) { + if (!strncmp(cp, "*\\\n",3)) { + SET_PUBLIC(chew,comment_state) = FINISHING_COMMENT; + cp += 3; + } + if (!strncmp(cp, "*\\\r\n",4)) { + SET_PUBLIC(chew,comment_state) = FINISHING_COMMENT; + cp += 4; + } + else if (cp[0] == '*' && cp[1] == '/') { + SET_PUBLIC(chew,comment_state) = NO_COMMENT; + SET_STATE(chew,in_double_quote) = + SET_STATE(chew,in_single_quote) = false; + cp += 2; + } + else { + ++cp; + } + } + else if (GET_PUBLIC(chew,comment_state) == STARTING_COMMENT) { + if (*cp == '*') { + SET_PUBLIC(chew,comment_state) = C_COMMENT; + ++cp; + } + else if (*cp == '/') { + SET_PUBLIC(chew,comment_state) = CXX_COMMENT; + ++cp; + } + else { + SET_PUBLIC(chew,comment_state) = NO_COMMENT; + SET_PUBLIC(chew,line_state) = LS_CODE; + } + } + else if (GET_PUBLIC(chew,comment_state) == FINISHING_COMMENT) { + if (*cp == '/') { + SET_PUBLIC(chew,comment_state) = NO_COMMENT; + ++cp; + } + else { + SET_PUBLIC(chew,comment_state) = C_COMMENT; + } + } + else { + ++cp; + } + SET_STATE(chew,escape) = false; + } + return cp; +} + +void +chew_toplevel(void) +{ + SET_PUBLIC(chew,line_state) = LS_NEUTER; + SET_PUBLIC(chew,comment_state) = NO_COMMENT; + SET_STATE(chew,in_double_quote) = false; + SET_STATE(chew,in_double_quote) = false; +} + +/* EOF */ + diff --git a/src/chew.h b/src/chew.h new file mode 100755 index 0000000..72d4f7c --- /dev/null +++ b/src/chew.h @@ -0,0 +1,151 @@ +#ifndef CHEW_H +#define CHEW_H + +/*************************************************************************** + * Copyright (C) 2004, 2006 Symbian Software Ltd. * + * All rights reserved. * + * Copyright (C) 2002, 2003 Tony Finch . * + * All rights reserved. * + * Copyright (C) 1985, 1993 The Regents of the University of California. * + * All rights reserved. * + * Copyright (C) 2007, 2008 Mike Kinghan, imk@strudl.org * + * All rights reserved. * + * * + * Contributed by Mike Kinghan, imk@strudl.org, derived from the code * + * of Tony Finch * + * * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * Redistributions of source code must retain the above copyright * + * notice, this list of conditions and the following disclaimer. * + * * + * Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * * + * Neither the name of Symbian Software Ltd. nor the names of its * + * contributors may be used to endorse or promote products derived from * + * this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,* + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * + * DAMAGE. * + * * + ***************************************************************************/ + +#include "opts.h" + +/*!\ingroup chew_module, chew_interface + *\file chew.h + * This file provides the Chew module interface + */ + +/*! \addtogroup chew_interface */ +/*@{*/ + +/*! Enumeration of comment states */ +typedef enum comment_state { + /*! Outside a comment */ + NO_COMMENT = false, + /*! In a C-style comment*/ + C_COMMENT, + /*! In a C++-style comment, i.e. // and end of line */ + CXX_COMMENT, + /*! Just after forward-slash + back-slash + newline */ + STARTING_COMMENT, + /*! Just after star + back-slash + newline in a C comment */ + FINISHING_COMMENT, + /*! In the text of an #error directive or the definiens of #define */ + PSEUDO_COMMENT +} comment_state_t; + +/*! Enumeration of states of a source line */ +typedef enum { + /*! Only whitespace and comments so far on the line */ + LS_NEUTER, + /*! Only whitespace, comments, and a \c # so far on the line */ + LS_DIRECTIVE, + /*! Source code found on the line (text other than whitespace, + comments, or a #-directive) */ + LS_CODE +} line_state_t; + +/*! Say whether a char * address a line end, + either Unix type or Windows type. +*/ +#define EOL(cp) ((cp)[0] == '\n' || ((cp)[0] == '\r' && (cp)[1] == '\n')) + +/*! Consume whitespace, comments, quotation or the text of an #error directive + * in the source text and stop at the first character beyond all these. + * + * \param cp The current text pointer + * \return A pointer to the next input character that is not to be chewed. + * + * The function replenishs the line buffer and copes with line-continuations. + * It maintains state with respect to all syntactically significant categories + * of context. + */ +extern char * +chew_on(char *cp); + +/*! Consume an identifier in the source text and stop at the next character. + * + * \param cp The current text pointer + * \return A pointer to The next input character that cannot be part of + * an identifier. + */ +extern char * +chew_sym(char *cp); + +/*! Consume a string until whitespace is found. + * + * \param cp The current text pointer + * \return A pointer to The next whitespace input character. + */ +extern char * +chew_str(char *cp); + +/*! Is the text pointer within quotation? */ +extern bool +in_quotation(void); + +/*! Reinitialise the line state and comment state */ +extern void +chew_toplevel(void); + + +/*@}*/ + +/*! \ingroup chew_interface_state_utils */ +/*@{*/ + +/*! The public state of the Chew module */ +PUBLIC_STATE_DEF(chew) { + enum comment_state comment_state; + /*!< The current comment state */ + line_state_t line_state; + /*!< The current line state */ + size_t last_quote_start_line; + /*!< Line number of the most recent open-quote */ + size_t last_comment_start_line; + /*!< Line number of most recent open-comment */ +} PUBLIC_STATE_T(chew); +/*@}*/ + +/*! \addtogroup chew_interface_state_utils */ +/*@{*/ +IMPORT(chew); +/*@}*/ + +#endif /* EOF */ diff --git a/src/dataset.c b/src/dataset.c new file mode 100755 index 0000000..dc5e9ad --- /dev/null +++ b/src/dataset.c @@ -0,0 +1,156 @@ +/*************************************************************************** + * Copyright (C) 2004, 2006 Symbian Software Ltd. * + * All rights reserved. * + * Copyright (C) 2007, 2008 Mike Kinghan, imk@strudl.org * + * All rights reserved. * + * * + * Contributed originally by Mike Kinghan, imk@strudl.org * + * * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * Redistributions of source code must retain the above copyright * + * notice, this list of conditions and the following disclaimer. * + * * + * Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * * + * Neither the name of Symbian Software Ltd. nor the names of its * + * contributors may be used to endorse or promote products derived from * + * this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,* + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * + * DAMAGE. * + * * + ***************************************************************************/ + +#include "dataset.h" +#include "platform.h" +#include "report.h" + +/*!\ingroup dataset_module dataset_interface dataset_internals + *\file dataset.c + * This file implements the Dataset module + */ + +/*! \addtogroup dataset_internals_state_utils */ +/*@{*/ +/*! The global state of the Dataset module */ +STATE_DEF(dataset) { + /*! The public state of the Dataset module */ + INCLUDE_PUBLIC(dataset); + heap_str filter_types; + /*!< List of filter file types. Stored as + continguous nul-punctuated strings with a + terminatied by a double nul*/ +} STATE_T(dataset); + + +IMPLEMENT(dataset,USER_INITABLE); + +DEFINE_USER_INIT(dataset)(STATE_T(dataset) * dataset_st) +{ + dataset_st->dataset_public_state.file_tree = file_tree_new(); +} + +DEFINE_USER_FINIS(dataset)(STATE_T(dataset) * dataset_st) +{ + file_tree_dispose(&(SET_PUBLIC(dataset,file_tree))); + free(SET_STATE(dataset,filter_types)); +} +/*@}*/ + +/*! \addtogroup dataset_internals */ +/*@{*/ + +/*! Say whether a file is eligible for processing + by matching one of the file extensions given by + the \c --filter option. +*/ +static bool +filter_filename(const char *filename) +{ + char const * filter_filetypes = GET_STATE(dataset,filter_types); + char const *leafname = strrchr(filename,PATH_DELIM); + if (!leafname) { + leafname = filename; + } + if (filter_filetypes) { + char const *extension = filter_filetypes; + size_t ext_len = 0; + for ( ;*extension; extension += ext_len + 1) { + char *posn = strrchr(leafname,'.'); + ext_len = strlen(extension); + if (posn && posn[1]) { + if (!strcmp(++posn,extension)) { + return true; + } + } + } + } + return false; +} + +static void +build_proc( file_tree_h tree, + char const *name, + file_tree_traverse_state_t context) +{ + switch(context) { + case FT_ENTERING_DIR: + report(PROGRESS_SEARCHING_DIR,NULL,"Searching dir \"%s\"",name); + break; + case FT_AT_FILE: + report(PROGRESS_ADDED_FILE,NULL,"Added file \"%s\"",name); + break; + case FT_LEAVING_DIR: + report( PROGRESS_ADDED_DIR, + NULL, + "Added %d files from dir \"%s\"", + file_tree_count(tree,FT_COUNT_FILES,NULL), + name); + break; + default: + assert(false); + } +} + +/*@}*/ + +/* API */ + +void +dataset_filter_filetypes(const char *optarg) +{ + size_t len = strlen(optarg); + heap_str list = SET_STATE(dataset,filter_types) = allocate(len + 2); + strcpy(list,optarg); + list[len + 1] = '\0'; + while(--len) { + if (list[len] == ',') { + list[len] = '\0'; + } + } + file_tree_set_filter(GET_PUBLIC(dataset,file_tree),filter_filename); +} + +void +dataset_add(char const *path) +{ + file_tree_add(GET_PUBLIC(dataset,file_tree),path,build_proc); +} + + +/* EOF */ diff --git a/src/dataset.h b/src/dataset.h new file mode 100755 index 0000000..a3e3f13 --- /dev/null +++ b/src/dataset.h @@ -0,0 +1,95 @@ +#ifndef DATASET_H +#define DATASET_H +/*************************************************************************** + * Copyright (C) 2004, 2006 Symbian Software Ltd. * + * All rights reserved. * + * Copyright (C) 2007, 2008 Mike Kinghan, imk@strudl.org * + * All rights reserved. * + * * + * Contributed originally by Mike Kinghan, imk@strudl.org * + * * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * Redistributions of source code must retain the above copyright * + * notice, this list of conditions and the following disclaimer. * + * * + * Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * * + * Neither the name of Symbian Software Ltd. nor the names of its * + * contributors may be used to endorse or promote products derived from * + * this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,* + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * + * DAMAGE. * + * * + ***************************************************************************/ +#include "opts.h" +#include "file_tree.h" + +/*!\ingroup dataset_module dataset_interface + *\file dataset.h + * This file provides the Dataset module interface. + */ + +/*! \addtogroup dataset_interface */ +/*@{*/ + + +/*! Parse the argument to the \c --filter option - a comma + separated list of file extensions - and store these + extensions internally for filtering files added to + the input dataset. + */ +void +dataset_filter_filetypes(const char *list); + +/*! + Add files to the input dataset. + + \param path Name of file or directory to + be included in the input dataset. + + If \e path is a file that satisfies any \c --filter option + it is added to the input dataset. + + If \e path is a directory then files recursively beneath it + that satisfy any \c --filter option are added to the input + dataset. +*/ +void +dataset_add(char const *path); + +/*@}*/ + +/*!\addtogroup dataset_interface_state_utils */ +/*@{*/ + +/*! * The public state of the Dataset module.*/ +PUBLIC_STATE_DEF(dataset) { + file_tree_h file_tree; + /*!< File tree of input files */ + unsigned int donefiles; + /*!< Number of files processed, including those + abandoned due to parse errors */ + unsigned int errorfiles; + /*!< Number of files abandoned due to parse errors */ +} PUBLIC_STATE_T(dataset); + +IMPORT(dataset); +/*@}*/ + +#endif /* EOF */ diff --git a/src/doxygen.h b/src/doxygen.h new file mode 100755 index 0000000..be30a15 --- /dev/null +++ b/src/doxygen.h @@ -0,0 +1,545 @@ +#ifndef DOXYGEN_H +#define DOXYGEN_H +/*************************************************************************** + * Copyright (C) 2004, 2006 Symbian Software Ltd. * + * All rights reserved. * + * Copyright (C) 2007, 2008 Mike Kinghan, imk@strudl.org * + * All rights reserved. * + * * + * Contributed originally by Mike Kinghan, imk@strudl.org * + * * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * Redistributions of source code must retain the above copyright * + * notice, this list of conditions and the following disclaimer. * + * * + * Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * * + * Neither the name of Symbian Software Ltd. nor the names of its * + * contributors may be used to endorse or promote products derived from * + * this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,* + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * + * DAMAGE. * + * * + ***************************************************************************/ + +/*! \mainpage Sunifdef Maintainer's Documentation + */ + +/*! \file doxygen.h + This file contains only Doxygen special comments blocks + */ + +/*! \defgroup io_module The I/O module. + This module controls the pairing of an input file or stream + with an output file or stream and the line buffer through + which they are connected. +*/ + +/*!\ingroup io_module + \defgroup io_interface The I/O module interface + */ + +/*!\ingroup io_interface + \defgroup io_interface_state_utils Macro-generated code + This code is generated by the macros in \c state_utils.h + */ + +/*!\ingroup io_module + \defgroup io_internals The I/O module internals + */ + +/*!\ingroup io_internals + \defgroup io_internals_state_utils Macro-generated code + This code is generated by the macros in \c state_utils.h + */ + + +/*! \defgroup report_module The Report module + This module provides services for composing diagnostic + messages and codes. +*/ + +/*!\ingroup report_module + \defgroup report_interface The Report module interface + interface + */ + +/*!\ingroup report_module + \defgroup report_internals The Report module internals + internals + */ + +/*!\ingroup report_interface + \defgroup report_interface_state_utils Macro-generated + code. + + This code is generated by the macros in \c state_utils.h + */ + +/*!\ingroup report_internals + \defgroup report_internals_state_utils Macro-generated + code. + + This code is generated by the macros in \c state_utils.h + */ + +/*! \defgroup utils Utility modules + This module provides utility services. +*/ + +/*! \ingroup utils + \defgroup ptr_vector_module The Pointer-Vector module. + + This module provides an elementary extensible array type to + store pointers to heap objects. + + The type supports append and insert operations, but not + delete. + \note Extension of the vector causes reallocation of internal + storage and invalidates pointers that are held to elements of + the vector. +*/ + +/*! \ingroup ptr_vector_module + \defgroup ptr_vector_interface The Pointer-Vector module + interface. + */ + +/*! \ingroup ptr_vector_module + \defgroup ptr_vector_internals The Pointer-Vector module + internals. + */ + +/*! \ingroup utils + \defgroup state_utils The State Utilities module. + This module provides apparatus mainly implemented in macros + for defining a global state structure for a module \em M, + and a public state structure within the global state that + can be imported through the header file for \em M. + + It provides apparatus for querying and manipulating the + global or public state of \em M, and for initialising and + finalising the global state of \em M. + +*/ + +/*! \ingroup state_utils + \defgroup state_utils_interface The State Utilities + interface. + + Because the State Utils are largely macro-based, + state_utils.h imports a large number of scaffolding + definitions as well as those that are expected to be useful. + The scaffolding is documented for completeness in \ref + state_utils_infrastructure. The useful macros are documented + in \ref state_utils_user_macros. +*/ + +/*! \ingroup state_utils_interface + \defgroup state_utils_user_macros State Utilities user + macros. + */ + +/*! \ingroup state_utils_user_macros + \defgroup state_utils_hdr_macros Macros for the module header + file. + */ + +/*! \ingroup state_utils_user_macros + \defgroup state_utils_impl_macros Macros for the module + implementation file. + */ + +/*! \ingroup state_utils_interface + \defgroup state_utils_infrastructure State Utilities + infrastructure. + */ + + +/*! \ingroup utils + \defgroup memory_module The Memory module. + This module provides provides wrappers for \c malloc(), + \c realloc() and \c calloc() that bail out on allocation + failure. +*/ + +/*!\ingroup memory_module + \defgroup memory_interface The Memory module interface. + */ + +/*! \ingroup memory_module + \defgroup memory_internals The Memory module internals. + */ + +/*! \defgroup symbol_table_module The Symbol Table module. + This module controls the lookup table in which symbols given + as arguments to the \c --define, \c --undefine + options are stored +*/ + +/*!\ingroup symbol_table_module + \defgroup symbol_table_interface The Symbol Table module + interface. + + The interface provides indexed access to elements in the + symbol table and operations to find and add symbols. + */ + +/*!\ingroup symbol_table_interface + \defgroup symbol_table_interface_state_utils Macro-generated + code. + + This code is generated by the macros in \c state_utils.h +*/ + +/*!\ingroup symbol_table_module + \defgroup symbol_table_internals The Symbol Table module + internals. +*/ + +/*!\ingroup symbol_table_internals + \defgroup symbol_table_internals_state_utils Macro-generated + code. + + This code is generated by the macros in \c state_utils.h +*/ + +/*! \defgroup args_module The Args module. + This module controls the commandline options. +*/ + +/*!\ingroup args_module + \defgroup args_interface The Args module interface. + + The interface provides acccess to the commandline arguments + and operations to parse and analyse them. +*/ + +/*! \ingroup args_interface + \defgroup args_interface_state_utils Macro-generated code. + + This code is generated by the macros in \c state_utils.h +*/ + +/*!\ingroup args_module + \defgroup args_internals The Args module internals. +*/ + +/*! \ingroup args_internals + \defgroup args_internals_state_utils Macro-generated code. + + This code is generated by the macros in \c state_utils.h +*/ + + /*! \defgroup chew_module The Chew module. + This module manages advancing of the text pointer over + comments, whitespace and identifiers and the maintenance of + state information about the text-pointer's context. +*/ + +/*!\ingroup chew_module + \defgroup chew_interface The Chew module interface. +*/ + +/*!\ingroup chew_interface + \defgroup chew_interface_state_utils Macro-generated code. + + This code is generated by the macros in \c state_utils.h +*/ + +/*!\ingroup chew_module + \defgroup chew_internals The Chew module internals. +*/ + +/*!\ingroup chew_internals + * \defgroup chew_internals_state_utils Macro-generated code + * This code is generated by the macros in \c state_utils.h + */ + + /*! \defgroup line_edit_module The Line Edit module + * This module provides routines for editing the line-buffer. + */ + +/*!\ingroup line_edit_module + * \defgroup line_edit_interface The Line Edit module interface + */ + +/*!\ingroup line_edit_interface + * \defgroup line_edit_interface_state_utils Macro-generated code + * This code is generated by the macros in \c state_utils.h + */ + +/*!\ingroup line_edit_module + * \defgroup line_edit_internals The Line Edit module internals + */ + +/*!\ingroup line_edit_internals + * \defgroup line_edit_internals_state_utils Macro-generated code + * This code is generated by the macros in \c state_utils.h + */ + + /*! \defgroup line_despatch_module The Line Despatch module + * This module controls the final handling of an evaluated + * #-directive in the line-buffer. It is printed to + * output, or dropped, or replaced with a diagnostic insert. + */ + +/*!\ingroup line_despatch_module + * \defgroup line_despatch_interface The Line Despatch module interface + */ + +/*!\ingroup line_despatch_interface + * \defgroup line_despatch_interface_state_utils Macro-generated code + * This code is generated by the macros in \c state_utils.h + */ + + +/*!\ingroup line_despatch_module + * \defgroup line_despatch_internals The Line Despatch module internals + */ + +/*!\ingroup line_despatch_internals + * \defgroup line_despatch_internals_state_utils Macro-generated code + * This code is generated by the macros in \c state_utils.h + */ + + /*! \defgroup if_control_module The #if-Control module + * This module manages the navigation of #if-directives. + */ + +/*!\ingroup if_control_module + * \defgroup if_control_interface The #if-Control module interface + */ + +/*! \ingroup if_control_module + * \defgroup if_control_internals The #if-Control module internals + * + * The module is essentially a state machine. The implementation differs + * only trivially from that of + *
Tony Finch + * + * A state transition function alters the global \c #if processing state + * in a particular way. The state table is indexed by the current + * processing state and the type of the current line. + * + * Nesting is handled by keeping a stack of states; some transition + * functions increase or decrease the depth. In some complicated cases they have to + * alter the preprocessor directive, as follows: + * + * When we have processed a group that starts off with a known false + * \c #if/#elif sequence (which has therefore been deleted) followed by an + * \c #elif that we cannot resolve and therefore must keep, we edit the + * latter into a #if to keep the nesting correct. + * + * When we find a true \c #elif in a group, the following block will + * always be kept and the rest of the sequence after the next \c #elif or + * \c #else will be discarded. We edit the true \c #elif into an \c #else + * and the following directive to \c #endif since this has the desired + * behaviour. + * + * "Dodgy" directives are split across multiple lines, the most common + * example being a multi-line comment hanging off the right of the + * directive. We can handle them correctly only if there is no change + * from printing to dropping (or vice versa) caused by that directive. + * If the directive is the first of a group we have a choice between + * failing with an error, or passing it through unchanged instead of + * evaluating it. The latter is not the default to avoid user questions about + * preprocessor directives being unexpectedly retained. + */ + +/*! \ingroup if_control_internals + * \defgroup if_control_internals_state_utils Macro-generated code + * This code is generated by the macros in \c state_utils.h + */ + +/*! \ingroup if_control_interface + * \defgroup if_control_interface_state_utils Macro-generated code + * This code is generated by the macros in \c state_utils.h + */ + + /*! \defgroup categorical_module The Categorical module + * This module deals with the issue of categorical directives, + * specifically \c #define or \c #undef, that may echo or contradict the + * \c --define or \c --undefine options. + * + * Categorical directives that echo \c --define or \c --undefine + * options are dropped. + * + * Categorical directives that conflict with \c --define or \c --undefine + * options are handled according to the policy specified by the + * actual or default value of the \c --conflict option. The conflicting + * directive is either deleted, or replaced with a diagnostic comment, + * or a diagnostic \c #error directive. + * + * Two sorts of conflict may arise: + * - An \c #undef directive is read that contradicts a \c --define option + * - A #define FOO [STRING] directive is read that conflicts + * with a --define FOO[=STRING] option by differently + * redfining \c FOO. + * + * Handling conflicts of the first sort is aggravated by the precautionary + * idiom: + * + * #undef FOO
+ * ...Possibly comments...
+ * #define FOO [STRING]

+ * + * When we have --define FOO[=STRING] we will detect a conflict + * on reading the \c #undef. But the conflict is going to be cancelled when + * we read the following \c #define, as long as it does not differently + * refine \c FOO. This possibility obliges us to save diagnostic information + * on reading the \c #undef and decide whether to use or discard it + * depending on what follows. + */ + +/*!\ingroup categorical_module + * \defgroup categorical_interface The Categorical module interface + */ + +/*!\ingroup categorical_interface + * \defgroup categorical_interface_state_utils Macro-generated code + * This code is generated by the macros in \c state_utils.h + */ + +/*!\ingroup categorical_module + * \defgroup categorical_internals The Categorical module internals + */ + +/*!\ingroup categorical_internals + * \defgroup categorical_internals_state_utils Macro-generated code + * This code is generated by the macros in \c state_utils.h + */ + + /*! \defgroup evaluator_module The Evaluator module + This module deals with the evaluation of input lines. + + Each line of input is evaluated to assign it a type. + The type determines + the action to be taken on the line and the state of the + evaluator for the next line of input. + */ + +/*!\ingroup evaluator_module + * \defgroup evaluator_interface The Evaluator module interface + */ + +/*!\ingroup evaluator_module + * \defgroup evaluator_internals The Evaluator module internals + */ + +/*!\ingroup evaluator_internals + * \defgroup evaluator_internals_state_utils Macro-generated code + * This code is generated by the macros in \c state_utils.h + */ + +/*!\ingroup evaluator_interface + * \defgroup evaluator_interface_state_utils Macro-generated code + * This code is generated by the macros in \c state_utils.h + */ + + /*! \defgroup main_module The Main module + * This module implements the Sunifdef program + */ + + /*! \defgroup exception_module The Exception module + This module provides a very rudimentary exception + handling facility using \c setjmp() and \c longjmp(). + Exceptions are integer error codes. Throwing an exception + can return execution to a point prior to the occurrence + of the exception, where by testing the exception it + can take an alternative course. It is not possible to + re-throw an exception. + */ + +/*! \defgroup filesystem_module The Filesystem module. + This module provides an interface to filesystem operations + that is neutral between Unix and Windows. +*/ + +/*!\ingroup filesystem_module + \defgroup filesystem_interface The Filesystem module interface. + */ + +/*!\ingroup filesystem_module + \defgroup filesystem_unix The Filesystem module for Unix. + Unix-specific implementations for the filesystem module. + */ + +/*!\ingroup filesystem_unix + \defgroup filesystem_unix_internals The Unix Filesystem module internals. + Unix-specific internals of the filesystem module. + */ + +/*!\ingroup filesystem_module + \defgroup filesystem_windows The Filesystem module for Windows. + Windows-specific implementations for the filesystem module. + */ + +/*!\ingroup filesystem_windows + \defgroup filesystem_windows_internals The Windows Filesystem module internals. + Windows-specific internals of the filesystem module. + */ + +/*! \defgroup file_tree_module The File Tree module. + This module provides a data structure to represent a + hierarchy of files and directories as organised in the + file system and an API to query properties of the tree + and to perform interative operations. +*/ + +/*! \ingroup file_tree_module + \defgroup file_tree_interface The File Tree module interface. +*/ + +/*! \ingroup file_tree_module + \defgroup file_tree_internals The File Tree module internals. +*/ + +/*! \defgroup dataset_module The Dataset module. + This module provides a data structure to represent the + the set files input to sunifdef, which can be a hierarchy + including directories if the \c --recurse option is used. + The module also holds the extension patterns given with + the \c --filter option to select input files. + + The module thinly wraps the \e file_tree structure, exposing + only operations to specify the filter patterns and to + filter files within a given path into the dataset. +*/ + +/*! \ingroup dataset_module + \defgroup dataset_interface The Dataset module interface. +*/ + +/*! \ingroup dataset_interface + \defgroup dataset_interface_state_utils Macro-generated code + * This code is generated by the macros in \c state_utils.h +*/ + +/*! \ingroup dataset_module + \defgroup dataset_internals The Dataset module interals. +*/ + +/*! \ingroup dataset_internals + \defgroup dataset_internals_state_utils Macro-generated code + * This code is generated by the macros in \c state_utils.h +*/ + + +#endif /* EOF */ diff --git a/src/evaluator.c b/src/evaluator.c new file mode 100755 index 0000000..ec4ae60 --- /dev/null +++ b/src/evaluator.c @@ -0,0 +1,1606 @@ +/*************************************************************************** + * Copyright (C) 2004, 2006 Symbian Software Ltd. * + * All rights reserved. + * Copyright (C) 2002, 2003 Tony Finch . * + * All rights reserved. * + * Copyright (C) 1985, 1993 The Regents of the University of California. * + * All rights reserved. * + * Copyright (C) 2007, 2008 Mike Kinghan, imk@strudl.org * + * All rights reserved. * + * * + * Contributed by Mike Kinghan, imk@strudl.org, derived from the code * + * of Tony Finch * + * * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * Redistributions of source code must retain the above copyright * + * notice, this list of conditions and the following disclaimer. * + * * + * Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * * + * Neither the name of Symbian Software Ltd. nor the names of its * + * contributors may be used to endorse or promote products derived from * + * this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,* + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * + * DAMAGE. * + * * + ***************************************************************************/ + +#include "evaluator.h" +#include "io.h" +#include "report.h" +#include "line_edit.h" +#include "chew.h" +#include "args.h" +#include "categorical.h" +#include "if_control.h" +#include "symbol_table.h" +#include "report.h" +#include "line_despatch.h" +#include +#include +#include +#include +#include + +/*!\ingroup evaluator_module evaluator_internals evaluator_interface + * + * \file evaluator.c + * This file implements the Evaluator module + */ + +/*! \addtogroup evaluator_internals */ +/*@{*/ + +/*! Set flags in an \em eval_result_t + */ +#define SET_FLAGS(eval_result,bits) ((eval_result).flags |= (bits)) + +/*! Set flags in an \em eval_result_t if a condition is true + */ +#define SET_FLAGS_IF(cond,eval_result,bits)\ + (void)((cond) ? SET_FLAGS(eval_result,bits) : 0) + +/*! Clear flags in an \em eval_result_t + */ +#define CLEAR_FLAGS(eval_result,bits) ((eval_result).flags &= ~(bits)) + +/*! Clear flags in an \em eval_result_t if a condition is true + */ +#define CLEAR_FLAGS_IF(cond,eval_result,bits)\ + (void)((cond) ? CLEAR_FLAGS(eval_result,bits) : 0) + +/*! Invert the values of specified flags in an + \em eval_result_t + */ +#define FLIP_FLAGS(eval_result,bits) ((eval_result).flags ^= (bits)) + +/*! Get the flags in \em eval_result_t that match a mask */ +#define FLAGS_IN(eval_result,bits) ((eval_result).flags & (bits)) + +/*! Test whether specified flags are set in an \em eval_result_t +*/ +#define AFFIRM_FLAGS(eval_result,bits)\ + (((eval_result).flags & (bits)) == (bits)) + +/*! Test whether specified flags are clear in an + \em eval_result_t +*/ +#define DENY_FLAGS(eval_result,bits)\ + (((eval_result).flags & (bits)) == 0) + +/*! Test whether an \em eval_result_t + represents a true expression +*/ +#define IS_TRUE(eval_result) AFFIRM_FLAGS(eval_result,EVAL_TRUE) + +/*! Test whether an \em eval_result_t represents a false + expression. +*/ +#define IS_FALSE(eval_result) AFFIRM_FLAGS(eval_result,EVAL_FALSE) + +/*! Test whether an \em eval_result_t represents a constant. +*/ +#define IS_CONST(eval_result) AFFIRM_FLAGS(eval_result,EVAL_CONST) + +/*! Test whether an \em eval_result_t represents + unresolved text. +*/ +#define UNRESOLVED(eval_result) DENY_FLAGS(eval_result,EVAL_FALSE | EVAL_TRUE) + +/*! Test whether an \em eval_result_t represents a + resolved expression. +*/ +#define RESOLVED(eval_result) !UNRESOLVED(eval_result) + +/*! Test whether an \em eval_result_t represents + insoluble text. +*/ +#define INSOLUBLE(eval_result) AFFIRM_FLAGS(eval_result,EVAL_INSOLUBLE) + +/*! Test whether an \em eval_result_t represents + a symbol already parsed. + + If symbol is found to be neither resolved nor insoluble + and has already been visited then it has a circular + definition. +*/ +#define VISITED(eval_result) AFFIRM_FLAGS(eval_result,EVAL_VISITED) + +/*! Test whether an \em eval_result_t represents + a symbol defined as an empty string. +*/ +#define EMPTY_SYMBOL(eval_result) \ + ((eval_result).sym_name && \ + (eval_result).sym_def && \ + !(eval_result).sym_def[0]) + +/*! Test whether an \em eval_result_t stipulates + deleting superfluous parentheses +*/ +#define DEL_PAREN(eval_result) AFFIRM_FLAGS(eval_result,EVAL_DEL_PAREN) + +/*! Flag an \em eval_result_t for deletion of superflous + parentheses. +*/ +#define SET_DEL_PAREN(eval_result) SET_FLAGS(eval_result,EVAL_DEL_PAREN) + +/*! Test whether an \em eval_result_t evaluates as + an expression we can't eliminate. +*/ +#define KEEP(eval_result) AFFIRM_FLAGS(eval_result,EVAL_KEEP) + +/*! Flag an \em eval_result_t as an expression we can't + eliminate. +*/ +#define SET_KEEP(eval_result) SET_FLAGS(eval_result,EVAL_KEEP) + +/*! Test whether an \em eval_result_t evaluates as + a non-eliminable constant +*/ +#define KEEP_CONST(eval_result) AFFIRM_FLAGS(eval_result,EVAL_KEEP_CONST) + +/*! Flag an \em eval_resultT as a non-eliminable constant */ +#define SET_KEEP_CONST(eval_result) SET_FLAGS(eval_result,EVAL_KEEP_CONST) + +/*! Flag an \em eval_resultT as a constant */ +#define SET_CONST(eval_result) SET_FLAGS(eval_result,EVAL_CONST) + + +/* Helpers *****************************************************************/ + +/*! Assign a value in an \em eval_result_t */ +static void +set_value(eval_result_t *result, int val) +{ + result->value = val; + SET_FLAGS(*result,val ? EVAL_TRUE : EVAL_FALSE); +} + + +/*! Integer less-than */ +static int lt(int l, int r) { return l < r; } +/*! Integer greater-than */ +static int gt(int l, int r) { return l > r; } +/*! Integer less-than-or_equal */ +static int le(int l, int r) { return l <= r; } +/*! Integer greater-than-or_equal */ +static int ge(int l, int r) { return l >= r; } +/*! Integer equality */ +static int eq(int l, int r) { return l == r; } +/*! Integer inequality */ +static int ne(int l, int r) { return l != r; } +/*! Bitwise and */ +static int bit_and(int l, int r) { return l & r; } +/*! Bitwise inclusive or */ +static int bit_or(int l, int r) { return l | r; } +/*! Bitwise exclusive or */ +static int bit_xor(int l, int r) { return l ^ r; } +/*! Left shift */ +static int lshift(int l, int r) { return l << r; } +/*! Right shift */ +static int rshift(int l, int r) { return l >> r; } +/*! Plus */ +static int plus(int l, int r) { return l + r; } +/*! Minus */ +static int minus(int l, int r) { return l - r; } +/*! Multiply */ +static int mult(int l, int r) { return l * r; } +/*! Division */ +static int divide(int l, int r) { return l / r; } +/*! Modulus */ +static int mod(int l, int r) { return l % r; } + + +typedef int (integer_bin_op_t)(int,int); + +static eval_result_t +integer_binary_op( eval_result_t *lhs, + eval_result_t *rhs, + integer_bin_op_t op) +{ + eval_result_t result = {0,0,0}; + if ((IS_CONST(*lhs) || RESOLVED(*lhs)) && + (IS_CONST(*rhs) || RESOLVED(*rhs))) { + set_value(&result,op(lhs->value,rhs->value)); + } + return result; +} + +/*! Less-than operator */ +static eval_result_t +op_lt(eval_result_t * lhs, eval_result_t * rhs) +{ + return integer_binary_op(lhs,rhs,lt); +} + +/*! Greater-than operator */ +static eval_result_t +op_gt(eval_result_t *lhs, eval_result_t *rhs) +{ + return integer_binary_op(lhs,rhs,gt); +} + +/*! Less-than-or-equal operator */ +static eval_result_t +op_le(eval_result_t *lhs, eval_result_t *rhs) +{ + return integer_binary_op(lhs,rhs,le); +} + +/*! Greater-than-or-equal operator */ +static eval_result_t +op_ge(eval_result_t *lhs, eval_result_t *rhs) +{ + return integer_binary_op(lhs,rhs,ge); +} + +/*! Equality operator */ +static eval_result_t +op_eq(eval_result_t *lhs, eval_result_t *rhs) +{ + return integer_binary_op(lhs,rhs,eq); +} + +/*! Inequality operator */ +static eval_result_t +op_ne(eval_result_t *lhs, eval_result_t *rhs) +{ + return integer_binary_op(lhs,rhs,ne); +} + +/*! Inclusive-or operator */ +static eval_result_t +op_or(eval_result_t *lhs, eval_result_t *rhs) +{ + eval_result_t result = {0,0,0}; + if (IS_TRUE(*lhs) || IS_TRUE(*rhs)) { + set_value(&result,true); + } + else if (IS_FALSE(*lhs) && IS_FALSE(*rhs)) { + set_value(&result,false); + } + if (FLAGS_IN(*lhs,EVAL_RESOLVED) == FLAGS_IN(*rhs,EVAL_RESOLVED)) { + SET_FLAGS_IF(KEEP_CONST(*lhs) | KEEP_CONST(*rhs), + result,EVAL_KEEP_CONST); + } + else if (IS_TRUE(*lhs)) { + SET_FLAGS_IF(KEEP_CONST(*lhs),result,EVAL_KEEP_CONST); + CLEAR_FLAGS_IF(!KEEP_CONST(*rhs),*rhs,EVAL_KEEP); + } + else if (IS_TRUE(*rhs)) { + SET_FLAGS_IF(KEEP_CONST(*rhs),result,EVAL_KEEP_CONST); + CLEAR_FLAGS_IF(!KEEP_CONST(*lhs),*lhs,EVAL_KEEP); + } + else if (IS_FALSE(*lhs)) { + SET_FLAGS_IF(KEEP_CONST(*rhs),result,EVAL_KEEP_CONST); + } + else if (IS_FALSE(*rhs)) { + SET_FLAGS_IF(KEEP_CONST(*lhs),result,EVAL_KEEP_CONST); + } + return result; +} + +/*! And operator */ +static eval_result_t +op_and(eval_result_t *lhs, eval_result_t *rhs) +{ + eval_result_t result = {0,0,0}; + if (IS_TRUE(*rhs) && IS_FALSE(*lhs)) { + set_value(&result,false); + SET_FLAGS_IF(KEEP_CONST(*lhs),result,EVAL_KEEP_CONST); + } + else if (IS_TRUE(*lhs) && IS_FALSE(*rhs)) { + set_value(&result,false); + SET_FLAGS_IF(KEEP_CONST(*rhs),result,EVAL_KEEP_CONST); + } + else if (UNRESOLVED(*lhs)) { + if (IS_FALSE(*rhs)) { + set_value(&result,false); + SET_FLAGS_IF(KEEP_CONST(*rhs),result,EVAL_KEEP_CONST); + } + else { + SET_FLAGS_IF(KEEP_CONST(*lhs),result,EVAL_KEEP_CONST); + } + } + else if (UNRESOLVED(*rhs)) { + if (IS_FALSE(*lhs)) { + set_value(&result,false); + SET_FLAGS_IF(KEEP_CONST(*lhs),result,EVAL_KEEP_CONST); + } + else { + SET_FLAGS_IF(KEEP_CONST(*rhs),result,EVAL_KEEP_CONST); + } + } + else { + set_value(&result,lhs->value && rhs->value); + SET_FLAGS_IF(KEEP_CONST(*rhs) | KEEP_CONST(*lhs), + result,EVAL_KEEP_CONST); + } + return result; +} + +/*! Bitwise AND operator */ +static eval_result_t +op_bit_and(eval_result_t *lhs, eval_result_t *rhs) +{ + return integer_binary_op(lhs,rhs,bit_and); +} + +/*! Bitwise OR operator */ +static eval_result_t +op_bit_or(eval_result_t *lhs, eval_result_t *rhs) +{ + return integer_binary_op(lhs,rhs,bit_or); +} + +/*! Bitwise XOR operator */ +static eval_result_t +op_bit_xor(eval_result_t *lhs, eval_result_t *rhs) +{ + return integer_binary_op(lhs,rhs,bit_xor); +} + +/*! Left-shift operator */ +static eval_result_t +op_lshift(eval_result_t *lhs, eval_result_t *rhs) +{ + return integer_binary_op(lhs,rhs,lshift); +} + +/*! Right-shift operator */ +static eval_result_t +op_rshift(eval_result_t *lhs, eval_result_t *rhs) +{ + return integer_binary_op(lhs,rhs,rshift); +} + +/*! Addition operator */ +static eval_result_t +op_plus(eval_result_t *lhs, eval_result_t *rhs) +{ + return integer_binary_op(lhs,rhs,plus); +} + +/*! Substraction operator */ +static eval_result_t +op_minus(eval_result_t *lhs, eval_result_t *rhs) +{ + return integer_binary_op(lhs,rhs,minus); +} + +/*! Multiplication operator */ +static eval_result_t +op_mult(eval_result_t *lhs, eval_result_t *rhs) +{ + return integer_binary_op(lhs,rhs,mult); +} + +/*! Division operator */ +static eval_result_t +op_divide(eval_result_t *lhs, eval_result_t *rhs) +{ + eval_result_t result = {0,0,0}; + if ((IS_CONST(*lhs) || RESOLVED(*lhs)) && + (IS_CONST(*rhs) || RESOLVED(*rhs))) { + if (!rhs->value) { + report(GRIPE_ZERO_DIVIDE,NULL, + "Divide by zero"); + } + else { + set_value(&result,divide(lhs->value,rhs->value)); + } + } + return result; +} + +/*! Modulus operator */ +static eval_result_t +op_mod(eval_result_t *lhs, eval_result_t *rhs) +{ + eval_result_t result = {0,0,0}; + if ((IS_CONST(*lhs) || RESOLVED(*lhs)) && + (IS_CONST(*rhs) || RESOLVED(*rhs))) { + if (!rhs->value) { + report(GRIPE_ZERO_DIVIDE,NULL, + "Divide by zero"); + } + else { + set_value(&result,mod(lhs->value,rhs->value)); + } + } + return result; +} + + +struct ops; + +/*! Type of evaluation functions. + + \param ops A pointer to an element of the precedence + table which lists the operators at the + current level of precedence. + + \param On entry, a pointer to a \c char* that points to the + expression to be evaluated. On return, receives + the address terminating the evaluated expression. + + \return An \em eval_result_t representing the result of + evaluation. + */ +typedef eval_result_t (evaluator_t)(const struct ops *,char **); + +/*! The evaluator for binary expressions */ +static evaluator_t eval_table; +/*! The evaluator for unary expressions */ +static evaluator_t eval_unary; + +/*! Structure representing an operator + (Would rather call it "operator" but GCC thinks + that is a reserved word even in C)*/ + +struct operation { + /*! Points to the preprocessor token that denotes the operator */ + const char *str; + /*! Pointer to function to implement the operator */ + eval_result_t (*fn)(eval_result_t *, eval_result_t *); +}; + +/*! Structure of the operator precedence table. + * + * Expressions involving binary operators are evaluated + * in a table-driven way by \c eval_table(). When it evaluates a subexpression + * it calls the inner function with its first argument pointing to the next + * element of the table. + * + * Innermost expressions have special non-table-driven handling. + */ +struct ops { + /*! Pointer to function for evaluating operands of operator */ + evaluator_t *inner; + /*! Array of operators of same precedence associated with + the evaluator \c inner */ + struct operation op[5]; +}; + + +/*! The operator precedence table */ +static const struct ops eval_ops[] = { + + { + eval_table, + { + { "||", op_or } + } + }, + { + eval_table, + { + { "&&", op_and } + } + }, + { + eval_table, + { + { "|", op_bit_or }, + { "^", op_bit_xor }, + { "&", op_bit_and } + } + }, + { + eval_table, + { + { "==", op_eq }, + { "!=", op_ne } + } + }, + { + eval_table, + { + { "<=", op_le }, + { ">=", op_ge }, + { "<", op_lt }, + { ">", op_gt } + } + }, + { + eval_table, + { + { "<<", op_lshift }, + { ">>", op_rshift }, + } + }, + { + eval_table, + { + { "+", op_plus }, + { "-", op_minus }, + } + }, + { + eval_unary, + { + { "*", op_mult }, + { "/", op_divide }, + { "%", op_mod }, + } + }, +}; + +/*! Test whether a given operator occurs at a given line-buffer position. + * \param txt A line buffer position + * \param op Pointer to an operator token + * \return \em true iff the operator token \c op occurs at position \c txt + */ +static bool +op_cmp(char const * txt, char const *op) +{ + assert(op[1] == '\0' || op[2] =='\0'); + if (txt[0] != op[0]) { + return false; + } + if (op[1]) { + if (txt[1] != op[1]) { + return false; + } + } + else if (txt[1] == op[0]) { + return false; + } + return true; +} + +/*! Evaluator for innermost subexpressions, i.e. + - \em !expr + - \em (expr) + - \em (symbol) + - \em symbol + - \em number + + \param ops Pointer to the \em struct ops to be used for + the evaluation. + \param cpp On entry, a pointer to the start of the text + to be evaluated. Receives the address reached + by evaluation. + \return An \em eval_result_t representing + the result of evaluation. + */ +static eval_result_t +eval_unary(const struct ops *ops, char **cpp); + +/*! Skip right-hand operand of \c && in an \c #if + * directive when we can short-circuit the evaluation. + * + * \param cp Line-buffer position at which the operand + * begins. + * + * When an \c && can be short-circuited, the evaluator + * can skip from the start of the righthand operand until: + * - the end of the directive, or + * - an unbalanced ')', which must close the scope of the \c &&, or + * - a \c || operator, which has higher precedence. + * + * \return The address just past the skipped operand. + */ +static char * +short_circuit_and(char *cp) +{ + int balance = 0; + for ( ;*(cp = chew_on(cp)); ++cp) { + if (*cp == '(') { + ++balance; + } + else if (*cp == ')') { + --balance; + } + if (balance < 0) { + break; + } + else if (balance == 0) { + /* Check for another binary truth functor on same + * level to respect precedence. + */ + if (cp[0] == cp[1] && cp[0] == '|') { + break; + } + } + } + return cp; +} + +/*! Skip the right-hand operand of \c || in an \c #if + * directive when we can short-circuit the evaluation. + * + * \param cp Line-buffer position at which the operand + * begins. + * + * When an \c || can be short-circuited, the evaluator can + * skip from the start of the righthand operand until the end + * of the directive, or an unbalanced ')', which must close + * the scope of the \c ||. None of our operators has higher + * precedence. + * + * \return The address just past the skipped operand. + */ +static char * +short_circuit_or(char *cp) +{ + int balance = 0; + for ( ;*(cp = chew_on(cp)); ++cp) { + if (*cp == '(') { + ++balance; + } + else if (*cp == ')') { + --balance; + } + if (balance < 0) { + break; + } + } + return cp; +} + +/*! Evaluate the expression of a \c #if or \c #elif directive. + * If we can resolve the expression we return \c LT_TRUE or + * \c LT_FALSE accordingly, otherwise \c LT_IF. + */ +static int +eval_if(char **cpp); + +/*! Evaluate the text of a \c #define directive to determine if it is + consistent with the \c --define and \c --undefine assumptions. + + \param cpp Pointer to the address of the directive text. This + pointer is updated at exit with the address just past the + text consumed. + + \return A line-type, as follows: + + - Case 1: Directive is \c #define \c sym + + - If neither \c --define \c sym nor \c --undefine \c sym, + return \c LT_CONSISTENT_DEFINE_KEEP + - If \c --define \c sym, return \c LT_CONSISTENT_DEFINE_DROP + - If --define sym=val, return \c LT_DIFFERING_DEFINE + - If \c --undefine \c sym, return \c LT_CONTRADICTORY_DEFINE + + - Case 2: Directive is #define sym str1 [str2...] + + - If neither \c --define \c sym nor \c --undefine \c sym, + return \c LT_CONSISTENT_DEFINE_KEEP + - If \c --define \c sym, return \c LT_DIFFERING_DEFINE + - If --define sym=str1, return \c LT_CONSISTENT_DEFINE_KEEP + - If --define sym=val, where val != str1, + return \c LT_DIFFERING_DEFINE + - If \c --undefine \c sym return \c LT_CONTRADICTORY_DEFINE + + - Case 3: Directive is #define sym(arg1[,arg2...]) str1 [str2...] + + - If neither \c --define \c sym nor \c --undefine \c sym, + return \c LT_CONSISTENT_DEFINE_KEEP + - If \c --undefine \c sym, return \c LT_CONTRADICTORY_DEFINE + - If --define sym=val return \c LT_DIFFERING_DEFINE + - If \c --define \c sym, return \c LT_DIFFERING_DEFINE +*/ +static int +eval_define(char **cpp) +{ + char const *def; + char * cp = *cpp; + int retval; + int cursym; + bool functionoid = false; + debug(DBG_13,line_len(*cpp),*cpp); + cp = chew_on(cp); + cursym = find_sym(cp,&cp); + do { + if (cursym >= 0) { + def = SYMBOL(cursym)->sym_def; + } + else { + retval = LT_CONSISTENT_DEFINE_KEEP; /* symbol not -Ded or -Ued */ + break; + } + if (def == NULL) { + retval = LT_CONTRADICTORY_DEFINE; /* symbol is -Ued */ + break; + } + /* Symbol is -Ded */ + if (*cp == '(') { /* #define sym(x...) is inconsistent */ + retval = LT_DIFFERING_DEFINE; + functionoid = true; /* #defining a function-type macro */ + break; + } + /* Not functionoid macro, so enter PSEUDO_COMMENT state now */ + SET_PUBLIC(chew,comment_state) = PSEUDO_COMMENT; + SET_PUBLIC(chew,last_comment_start_line) = GET_PUBLIC(io,line_num); + cp = chew_on(cp); + if (*cp != '\0') { + /* #define sym str1 [str2..] */ + char *str = chew_str(cp); + size_t def_len = strlen(def); + size_t val_len = str - cp; + if (strncmp(def,cp,def_len)) { + /* str1 differs from -D value within length of value */ + retval = LT_DIFFERING_DEFINE; + break; + } + if (val_len > def_len) { + /* str1 is longer than -D value */ + retval = LT_DIFFERING_DEFINE; + break; + } + /* str1 is identical with -D value */ + cp = chew_on(str); + str = chew_sym(cp); /* But is there a str2? */ + retval = (cp == str) ? + LT_CONSISTENT_DEFINE_DROP : /* No str2. */ + LT_DIFFERING_DEFINE; /* There is a str2 */ + break; + } + /* #define sym */ + if (def[0] == '\0') { + if (cursym == GET_PUBLIC(categorical,last_contradictory_undef)) { + forget_contradiction(); + } + retval = LT_CONSISTENT_DEFINE_DROP; + } + else { + retval = LT_DIFFERING_DEFINE; + } + } while(false); + if (functionoid) { + /* If this is a functionoid macro then normal comment parsing + continues till we reach the closing ')' of the parameters */ + for ( ;*(cp = chew_on(cp)) != '\0' && *cp != ')'; ++cp){}; + } + if (*cp != '\0') { /* There's more */ + /* Might be unbalanced '(' but we don't care */ + SET_PUBLIC(chew,comment_state) = PSEUDO_COMMENT; + /* Pseudo-comment parsing */ + for ( ;*(cp = chew_on(cp)) != '\0'; ++cp){} /* Skip to newline */ + } + debug(DBG_14,line_len(*cpp),*cpp,retval); + *cpp = cp; + return retval; +} + +/*! Evaluate the text of an \c #undef to determine if it is consistent + with the \c --define and \c --undefine options. + + \param cpp Pointer to the address of the directive text. This + pointer is updated at exit with the address just past the + text consumed. + + \return A line-type, as follows: + + - If neither --define sym nor --undefine sym, + return \c LT_CONSISTENT_UNDEF_KEEP + - If \c --undefine \c sym, return \c LT_CONSISTENT_UNDEF_DROP + - Else return \c LT_CONTRADICTORY_UNDEF +*/ +static int +eval_undef(char **cpp) +{ + char const *def; + char *cp = *cpp; + int retval; + int cursym; + debug(DBG_15,line_len(*cpp),*cpp); + cp = chew_on(cp); + cursym = find_sym(cp,&cp); + do { + if (cursym >= 0) { /* Symbol is -Ded or -Ued */ + def = SYMBOL(cursym)->sym_def; + } + else { + retval = LT_CONSISTENT_UNDEF_KEEP; /* symbol not -Ded or -Ued */ + break; + } + if (def == NULL) { + retval = LT_CONSISTENT_UNDEF_DROP; /* symbol is -Ued */ + } + else { /* Symbol is -Ded */ + /* This #undef FOO contradicts -DFOO. We will complain + about this unless #define FOO is the next thing we see after + comments and whitespace, so we stash the complaint for the + the time being - unless we've already got a pending + contradiction for the same symbol */ + if (GET_PUBLIC(categorical,last_contradictory_undef) != cursym) { + flush_contradiction(); + SET_PUBLIC(categorical,last_contradictory_undef) = cursym; + save_contradiction("\"%.*s\" contradicts -D symbol"); + } + retval = LT_CONTRADICTORY_UNDEF; + } + } while(false); + debug(DBG_16,line_len(*cpp),*cpp,retval); + *cpp = cp = chew_on(cp); + return retval; +} + +/*! Table-driven evaluation of binary operators. + The evaluator does shortcircuit evaluation for && and ||. + It also simplifies && and || subexpressions that + can be partially solved. + If we are keeping constants then constants are treated like + unresolved symbols, and the rules are: + && := + && TRUE : = + && FALSE := FALSE + || := + || TRUE := TRUE + || FALSE := + + \param ops Pointer to the \em struct ops to be used for + the evaluation. + \param result Pointer to an \em eval_result_t that receives + the result of evaluation. + \param cpp On entry, a pointer to the start of the text + to be evaluated. Receives the address reached + by evaluation. + + */ +static eval_result_t +eval_table(const struct ops *ops,char **cpp); + +/*@}*/ + + +/*! \ingroup evaluator_internals_state_utils */ +/*@{*/ +/*! The global state of the Evaluator module */ +STATE_DEF(evaluator) { + /*! Line-buffer position of the start of the current \c #if condition */ + char *ifpos; + /*! The line type of the current line */ + line_type_t line_type; + /*! Are we parsing the definiens VAL of an option -DSYM=VAL, + rather than input source? */ + bool parsing_sym_def; +} STATE_T(evaluator); +/*@}*/ + +/*! \addtogroup evaluator_internals_state_utils */ +/*@{*/ +NO_PUBLIC_STATE(evaluator); + +IMPLEMENT(evaluator,ZERO_INITABLE); +/*@}*/ + +/*! + Report a symbol the occurs in an \c #if in accordance + with the \c --symbols option. + + \param policy The operative policy for listing symbols. + \param name The start of the symbol. + \param namelen The length of the symbol. + \param symind The value returned by find_sym() for + \em name. + +*/ +static void +list_symbol( symbols_policy_t policy, + char const *name, + size_t namelen, + int symind) +{ + eval_result_t * symbol; + bool visited; + if (symind < 0) { + add_unknown_symbol(~symind,name,namelen); + visited = false; + symbol = SYMBOL(~symind); + SET_FLAGS(*symbol,EVAL_VISITED); + } + else { + symbol = SYMBOL(symind); + visited = VISITED(*symbol); + } + if (visited && ((policy & SYMBOLS_LIST_FIRST) == SYMBOLS_LIST_FIRST)) { + return; + } + printf("%.*s",(int)namelen,name); + if ((policy & SYMBOLS_LOCATE) == SYMBOLS_LOCATE) { + printf(": %s(%d)",GET_PUBLIC(io,filename),GET_PUBLIC(io,line_num)); + } + putchar('\n'); +} + +/*! Evaluate a string as a numeral. + \param num The putative numeral, 0-terminated. + \param numend The address terminating any valid numeral is stored + here on return. + \return The double float value of any decimal, octal, or hex numeral + commencing at \e num, or 0 is there is no such numeral, or HUGE_VAL + if the integer value of the numeral exceeds INT_MAX. + + If the number \e N of characters \e *numend - \e num is > 0 at return then + then those \e N characters comprise the evaluated numeral. If \e *numend + != 0 then the 0-terminated string at \e num is not a valid numeral, + and if \e N == 0 then no numeral was scanned. + + The string "0x" or "0X" is parsed as a valid numeral "0" followed + by 'x' or 'X'. + + The return value != HUGE_VAL for validity. If valid, may be cast to + \c int without loss. + + This function is more serviceable that \e strtol() for evaluating + preprocessor integer constants since a seperate invocation of the + latter would be required for each possible base 8, 10, 16. + +*/ +static double +eval_numeral(char const *num, char const **numend) +{ + int sign = 1; + int base = 10; + int dval = 0; + int val = 0; + bool overflow = false; + size_t num_len = 0; + char const *start = num; + + switch(*num) { + case '-': + sign = -1; + start = ++num; + break; + case '+': + start = ++num; + break; + default:; + } + if (*num == '0') { + ++num; + if (*num == 'x' || *num == 'X') { + ++num; + base = 16; + } + else { + base = 8; + } + } + for ( ;; ++num) { + switch(*num) { + case '0': + dval = 0; + break; + case '1': + dval = 1; + break; + case '2': + dval = 2; + break; + case '3': + dval = 3; + break; + case '4': + dval = 4; + break; + case '5': + dval = 5; + break; + case '6': + dval = 6; + break; + case '7': + dval = 7; + break; + case '8': + dval = 8; + break; + case '9': + dval = 9; + break; + case 'a': + case 'A': + dval = 10; + break; + case 'b': + case 'B': + dval = 11; + break; + case 'c': + case 'C': + dval = 12; + break; + case 'd': + case 'D': + dval = 13; + break; + case 'e': + case 'E': + dval = 14; + break; + case 'f': + case 'F': + dval = 15; + break; + default: + dval = 16; + } + if (dval < base) { + int tmp = val; + val *= base; + if (val / base != tmp) { + overflow = true; + } + else { + tmp = val; + val += dval; + if (val - dval != tmp) { + overflow = true; + } + } + } + else { + break; + } + } + num_len = num - start; + if (num_len == 1 && (*num == 'x' || *num == 'X')) { + --num; + } + else { + if (*num == 'u' || *num == 'U') { + ++num; + } + if (*num == 'l' || *num == 'L') { + ++num; + } + } + *numend = num; + if (overflow) { + report(GRIPE_INT_OVERFLOW,NULL, + "Integer constant \"%.*s\" is too big for sunifdef " + "(max %d): expression will not be resolved", + num - start,start,INT_MAX); + return HUGE_VAL; + } + return sign * val; +} + +/*! Evaluate a symbol. + + \param symbol Pointer to an eval_result_t that + holds the symbol to evaluate. + + If the symbol has no definition, e.g. \c -DFOO, + then it is evaluated as insoluble. + + Otherwise an attempt is made to evaluate + the definition of the symbol as a decimal numeral. + If this attempt is successful then the symbol + assumes the integer value of numeral. + + Otherwise the definition is recursively evaluated + as an expression and the symbol assumes the + result of this evaluation. + + The function initially flags the symbol as having + been visited. If parser visits the a symbol it has + already visited and finds that the symbol is not + flagged as either resolved or insoluble it can + conclude that the evaluation of circular definition + has recursed back to its starting point. An infinite + loop can this be pre-empted and the symbol can + be evaluated as insoluble. + +*/ +static void +eval_symbol(eval_result_t *symbol) +{ + char const *symdef = symbol->sym_def; + SET_FLAGS(*symbol,EVAL_VISITED); + if (!symdef) { + SET_FLAGS(*symbol,EVAL_FALSE); + } + else { + char const *numend; + double val = eval_numeral(symdef,&numend); + if (val != HUGE_VAL) { + if (*numend != '\0' || numend == symdef) { + /* Value of symbol is not an integer. + Is it an expression? */ + eval_result_t result; + size_t len = strlen(symdef); + if (len) { + /* Possible expression */ + char * symdup = allocate(len + 1); + char * heapblk = symdup; + strcpy(symdup,symdef); + SET_STATE(evaluator,parsing_sym_def) = true; + result = eval_table(eval_ops,&symdup); + SET_STATE(evaluator,parsing_sym_def) = false; + free(heapblk); + if (UNRESOLVED(result)) { + SET_FLAGS(*symbol,EVAL_INSOLUBLE); + } + else { + set_value(symbol,result.value); + } + } + } + else { + set_value(symbol,(int)val); + } + } + } +} + +static eval_result_t +eval_unary(const struct ops *ops, char **cpp) +{ + char const *ep; + int symind; + char *sym_name; + eval_result_t * symbol; + eval_result_t result = {0,0,0}; + char *cp = chew_on(*cpp); + do { + + if (*cp == '!') { + debug(DBG_1,ops - eval_ops); + ++cp; + result = eval_unary(ops,&cp); + if (UNRESOLVED(result)) { + break; + } + result.value = !result.value; + FLIP_FLAGS(result,EVAL_RESOLVED); + } + else if (*cp == '~') { + eval_result_t neg_result; + debug(DBG_22,ops - eval_ops); + ++cp; + neg_result = eval_unary(ops,&cp); + if (UNRESOLVED(neg_result)) { + break; + } + set_value(&result,~neg_result.value); + } + else if (*cp == '(') { + char *start = cp; + ++cp; + debug(DBG_2,ops - eval_ops); + result = eval_table(eval_ops,&cp); + cp = chew_on(cp); + if (*cp != ')') { + /* Missing ')' */ + bail(GRIPE_UNBALANCED_PAREN, + "Missing \")\" in \"%.*s\"", + line_len(GET_PUBLIC(io,line_start)), + GET_PUBLIC(io,line_start)); + } + else if (DEL_PAREN(result)) { + delete_paren(start,cp); + } + ++cp; + } + else if (*cp == '+') { + debug(DBG_20,ops - eval_ops); + ++cp; + result = eval_unary(ops,&cp); + break; + } + else if (*cp == '-') { + debug(DBG_21,ops - eval_ops); + ++cp; + result = eval_unary(ops,&cp); + if (UNRESOLVED(result)) { + break; + } + result.value = -result.value; + } + else if (isdigit((unsigned char)*cp)) { + double val; + debug(DBG_3,ops - eval_ops); + val = eval_numeral(cp,&ep); + if (val != HUGE_VAL) { + result.value = (int)val; + if (!GET_STATE(evaluator,parsing_sym_def)) { + SET_CONST(result); + if (!GET_PUBLIC(args,del_consts)) { + SET_KEEP(result); + } + if (GET_PUBLIC(args,eval_consts)) { + SET_FLAGS(result,result.value ? EVAL_TRUE : EVAL_FALSE); + } + } + else { + SET_FLAGS(result,result.value ? EVAL_TRUE : EVAL_FALSE); + } + } + cp = (char *)ep; + } + else if (strncmp(cp, "defined", 7) == 0 && !symchar(cp[7])) { + symbols_policy_t symbols_policy; + bool paren; + ptrdiff_t sym_len; + cp = chew_on(cp + 7); + debug(DBG_4, ops - eval_ops); + paren = *cp == '('; + if (paren) { + ++cp; + } + sym_name = chew_on(cp); + symind = find_sym(sym_name,&cp); + sym_len = cp - sym_name; + cp = chew_on(cp); + if (paren) { + if (*cp == ')') { + ++cp; + } + else { + /* Missing ')' */ + bail(GRIPE_UNBALANCED_PAREN,NULL, + "Missing \")\" in \"%.*s\"", + line_len(GET_PUBLIC(io,line_start)), + GET_PUBLIC(io,line_start)); + } + } + symbols_policy = GET_PUBLIC(args,symbols_policy); + if (symbols_policy) { + /* --symbols in force */ + list_symbol(symbols_policy,sym_name,sym_len,symind); + break; + } + if (symind < 0) { + /* Unknown symbol */ + break; + } + symbol = SYMBOL(symind); + set_value(&result,symbol->sym_def != NULL); + } + else if (symchar(*cp)) { + symbols_policy_t symbols_policy; + sym_name = cp; + debug(DBG_5,ops - eval_ops); + symind = find_sym(cp,&cp); + symbols_policy = GET_PUBLIC(args,symbols_policy); + if (symbols_policy) { + /* --symbols in force */ + list_symbol(symbols_policy,sym_name,cp - sym_name,symind); + break; + } + if (symind < 0) { + /* Unknown symbol */ + break; + } + symbol = SYMBOL(symind); + if (INSOLUBLE(*symbol)) { + break; + } + if (UNRESOLVED(*symbol)) { + if (!VISITED(*symbol)) { + eval_symbol(symbol); + } + else { + SET_FLAGS(*symbol,EVAL_INSOLUBLE); + } + } + if (EMPTY_SYMBOL(result)) { + report(GRIPE_EMPTY_SYMBOL,NULL, + "Empty symbol \"%s\" in expression",result.sym_name); + } + result = *symbol; + + } else { + debug(DBG_6,ops - eval_ops); + break; + } + } while(false); + *cpp = cp; + if (RESOLVED(result)) { + debug(DBG_7,ops - eval_ops,result.value); + } + else { + SET_KEEP(result); + } + return result; +} + +static int +eval_if(char **cpp) +{ + eval_result_t result; + debug(DBG_11, *cpp); + result = eval_table(eval_ops,cpp); + debug(DBG_12,result.value); + + if (KEEP_CONST(result)) { + return LT_IF; + } + if (IS_TRUE(result)) { + return LT_TRUE; + } + if (IS_FALSE(result)) { + return LT_FALSE;; + } + return LT_IF; +} + +static eval_result_t +eval_table(const struct ops *ops, char **cpp) +{ + char *start_cut = (debug(DBG_8, ops - eval_ops),*cpp); + /* Evaluate the lhs... */ + eval_result_t lhs_result = ops->inner(ops+1,cpp); + /* Assume lhs is all we've got... */ + eval_result_t result = lhs_result; + /* Assume we will delete parentheses... */ + char * cp = *cpp; + SET_DEL_PAREN(result); + for (; *(cp = chew_on(cp)) && *cp != ')'; ) { + eval_result_t rhs_result = {0,0,0}; + char *start_lhs_cut = start_cut; + char *end_lhs_cut = cp; + const struct operation *op; + + /* Now look for binary op at current precedence... */ + for (op = ops->op; op->str != NULL && !op_cmp(cp,op->str); op++){} + if (op->str == NULL) { /* No binary op, no rhs */ + break; + } + cp += strlen(op->str); + /* Got bin op - we will not delete parentheses... */ + CLEAR_FLAGS(result,EVAL_DEL_PAREN); + if (RESOLVED(lhs_result) && !KEEP_CONST(lhs_result)) { + /* ...Possibly can short-circuit */ + if (IS_TRUE(lhs_result) && op->fn == op_or) { + /* Can shortcircuit on TRUE || ... */ + cp = short_circuit_or(cp); + /* result == lhs_result. OK */ + break; + } + else if (IS_FALSE(lhs_result) && op->fn == op_and) { + /* Can shortcircuit on FALSE && ... */ + cp = short_circuit_and(cp); + /* result == lhs_result. OK */ + break; + } + else if ((IS_TRUE(lhs_result) && op->fn == op_and) || + (IS_FALSE(lhs_result) && op->fn == op_or)) { + /* Can delete TRUE &&, or FALSE ||... */ + cut_text(start_lhs_cut,cp); + /* Cutting lhs can make superflous parentheses */ + SET_DEL_PAREN(result); + } + } + start_cut = end_lhs_cut; + end_lhs_cut = cp; + debug(DBG_9, ops - eval_ops, op->str); + /* Evaluate rhs... */ + rhs_result = ops->inner(ops,&cp); + result = op->fn(&lhs_result,&rhs_result); + if (op->fn == op_or || op->fn == op_and) { + if (!KEEP(lhs_result) && KEEP(rhs_result)) { + cut_text(start_lhs_cut,end_lhs_cut); + SET_FLAGS(result,EVAL_DEL_PAREN | EVAL_KEEP); + } + else if (!KEEP(rhs_result) && KEEP(lhs_result)) { + cut_text(start_cut,cp); + SET_FLAGS(result,EVAL_DEL_PAREN | EVAL_KEEP); + } + } + } + if (RESOLVED(result)) { + debug(DBG_10, ops - eval_ops, result.value); + } + else { + SET_KEEP(result); + } + *cpp = cp; + return result; +} + +/* API ***************************************************************/ + +/* + * Parse a line and determine its type. We keep the preprocessor line + * parser state between calls in the global variable linestate, with + * help from chew_on(). + */ +line_type_t +eval_line(void) +{ + char *cp; + int cursym; + size_t kwlen; + int retval; + comment_state_t wascomment; + + if (!get_line()) { + flush_contradiction(); + return LT_EOF; + } + + SET_PUBLIC(line_edit,simplification_state) = UNSIMPLIFIED; + /* Assume no simplification possible */ + retval = LT_PLAIN; + wascomment = GET_PUBLIC(chew,comment_state); + cp = chew_on(GET_PUBLIC(io,line_start)); + if (GET_PUBLIC(chew,line_state) == LS_NEUTER) { + if (*cp == '#') { + SET_PUBLIC(chew,line_state) = LS_DIRECTIVE; + cp = chew_on(cp + 1); + } + else if (*cp != '\0') { + SET_PUBLIC(chew,line_state) = LS_CODE; + flush_contradiction(); + } + } + if (GET_PUBLIC(chew,comment_state) == NO_COMMENT && + GET_PUBLIC(chew,line_state) == LS_DIRECTIVE) { + symbols_policy_t symbols_policy = GET_PUBLIC(args,symbols_policy); + size_t kwoff = read_offset(cp); + char *kwpos; + cp = chew_sym(cp); + kwpos = read_pos(kwoff); + kwlen = cp - kwpos; + SET_PUBLIC(line_edit,keyword) = kwpos; + if (kwpos[0] == 'i' && kwpos[1] == 'f') { + /* Possible #if, #ifdef or #ifndef */ + bool ifdef = false; + if (kwpos[2] == 'n') { + ifdef = false; + kwpos += 3; + kwlen -= 3; + } + else if (kwpos[2] == 'd') { + ifdef = true; + kwpos += 2; + kwlen -= 2; + } + if (strncmp(kwpos,"def",kwlen) == 0 ) { + /* Got #ifdef or #ifndef */ + char *name; + cp = chew_on(cp); + name = cp; + cursym = find_sym(cp,&cp); + retval = LT_IF; + if (symbols_policy) { + list_symbol(symbols_policy,name,cp - name,cursym); + } + if (cursym >= 0) { + if (SYMBOL(cursym)->sym_def == NULL) { + /* symbol is -Ued */ + retval = ifdef ? LT_FALSE : LT_TRUE; + } + else { + /* symbol is -Ded */ + retval = ifdef ? LT_TRUE : LT_FALSE; + } + } + } + else { /* Just #if */ + SET_STATE(evaluator,ifpos) = cp; + retval = eval_if(&cp); + } + } + else if (GET_PUBLIC(line_edit,keyword)[0] == 'e') { + /* Possible #elif, #else, #endif, or #error */ + char const *kwpos = GET_PUBLIC(line_edit,keyword) + 1; + --kwlen; + if (strncmp(kwpos,"lif",kwlen) == 0) { /* #elif */ + retval = eval_if(&cp) - LT_IF + LT_ELIF; + } + else if (strncmp(kwpos,"lse",kwlen) == 0) { /* #else */ + retval = LT_ELSE; + } + else if (strncmp(kwpos,"ndif",kwlen) == 0) { /* #endif */ + retval = LT_ENDIF; + } + else if (strncmp(kwpos,"rror",kwlen) == 0) { /* #error */ + SET_PUBLIC(chew,comment_state) = PSEUDO_COMMENT; + if (!symbols_policy && !dropping_line()) { + SET_PUBLIC(chew,last_comment_start_line) = + GET_PUBLIC(io,line_num); + if (is_unconditional_line()) { + set_exit_flags(EVENT_SUMMARY_ERROR_OUTPUT,true); + if (was_unconditional_line()) { + report(GRIPE_UNCONDITIONAL_ERROR_INPUT,NULL, + "An unconditional #error directive was input"); + } + else { + report(GRIPE_UNCONDITIONAL_ERROR_INPUT,NULL, + "An unconditional #error directive was output"); + } + } + } + } + } + else if (strncmp(GET_PUBLIC(line_edit,keyword),"define",kwlen) == 0) { + if (!symbols_policy && !dropping_line()) { + retval = eval_define(&cp); + } + } + else if (strncmp(GET_PUBLIC(line_edit,keyword),"undef",kwlen) == 0 ) { + if (!symbols_policy && !dropping_line()) { + retval = eval_undef(&cp); + } + } + else { + SET_PUBLIC(chew,line_state) = LS_CODE; + retval = LT_PLAIN; + } + cp = chew_on(cp); + if (*cp != '\0') { + SET_PUBLIC(chew,line_state) = LS_CODE; + if (retval != LT_PLAIN) { + if (*cp == ')') { + bail(GRIPE_UNBALANCED_PAREN, + "Missing \"(\" in \"%.*s\"", + line_len(GET_PUBLIC(io,line_start)), + GET_PUBLIC(io,line_start)); + } + else { + report(GRIPE_GARBAGE_AFTER_DIRECTIVE,NULL, + "Garbage following preprocessor directive in \"%.*s\"", + line_len(GET_PUBLIC(io,line_start)), + GET_PUBLIC(io,line_start)); + } + } + } + /* chew should have changed the state */ + if (GET_PUBLIC(chew,line_state) == LS_DIRECTIVE) { + if (input_eof()) { + parse_error(GRIPE_MISSING_EOF_NEWLINE,"Missing newline at EOF"); + } + else { + give_up_confused(); /* bug */ + } + } + if (retval != LT_CONTRADICTORY_UNDEF) { + flush_contradiction(); + } + } + if (GET_PUBLIC(chew,line_state) == LS_CODE) { + while (*cp != '\0') { + cp = chew_on(cp + 1); + } + } + debug(DBG_17); + return (retval); +} + + +/* EOF */ + diff --git a/src/evaluator.h b/src/evaluator.h new file mode 100755 index 0000000..416cb4e --- /dev/null +++ b/src/evaluator.h @@ -0,0 +1,159 @@ +#ifndef EVALUATOR_H +#define EVALUATOR_H + +/*************************************************************************** + * Copyright (C) 2004, 2006 Symbian Software Ltd. * + * All rights reserved. + * Copyright (C) 2002, 2003 Tony Finch . * + * All rights reserved. * + * Copyright (C) 1985, 1993 The Regents of the University of California. * + * All rights reserved. * + * Copyright (C) 2007, 2008 Mike Kinghan, imk@strudl.org * + * All rights reserved. * + * * + * Contributed by Mike Kinghan, imk@strudl.org, derived from the code * + * of Tony Finch * + * * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * Redistributions of source code must retain the above copyright * + * notice, this list of conditions and the following disclaimer. * + * * + * Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * * + * Neither the name of Symbian Software Ltd. nor the names of its * + * contributors may be used to endorse or promote products derived from * + * this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,* + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * + * DAMAGE. * + * * + ***************************************************************************/ + +#include "opts.h" + + /*!\ingroup evaluator_module evaluator_interface + * \file evaluator.h + * This file provides the Evaluator module interface + */ + +/*! \addtogroup evaluator_interface */ +/*@{*/ + +/*! Enumeration of types of input lines */ +typedef enum { + /*! An \c #if that we can't resolve */ + LT_IF, + /*! A true \c #if */ + LT_TRUE, + /*! A false \c #if */ + LT_FALSE, + /*! An \c #elif that we can't resolve */ + LT_ELIF, + /*! A true \c #elif */ + LT_ELTRUE, + /*! A false \c #elif */ + LT_ELFALSE, + /*! An \c #else */ + LT_ELSE, + /*! An \c #endif */ + LT_ENDIF, + /*! An non-directive line */ + LT_PLAIN, + /*! End of file */ + LT_EOF, + /*! Not a line type. This is the number of line types for which we + handlers exist in the transition table. Subsequent line types + are handled outside the transition table. + */ + LT_TABLE_HANDLERS, + /*! A \c #define that is independant of the \c --define and \c --undefine + * options and is kept + */ + LT_CONSISTENT_DEFINE_KEEP, + /*! A \c #define that echoes a \c --define option and is dropped */ + LT_CONSISTENT_DEFINE_DROP, + /*! A \c #define that contradicts an \c --undefine option */ + LT_CONTRADICTORY_DEFINE, + /*! A \c #define that differently redefines a \c --define option */ + LT_DIFFERING_DEFINE, + /*! An \c #undef that is independant of the \c --define and \c --undefine + * options and is kept + */ + LT_CONSISTENT_UNDEF_KEEP, + /*! An \c #undefine that echoes a \c --undefine option and is dropped */ + LT_CONSISTENT_UNDEF_DROP, + /*! An \c #undef that contradicts a \c --define option */ + LT_CONTRADICTORY_UNDEF, +} line_type_t; + +/*! Bit flags denoting findings of evaluation */ +enum eval_flags { + EVAL_INSOLUBLE = 1, + /*!< Evaluated text cannot be resolved */ + EVAL_CONST = 2, + /*!< Expression is a constant */ + EVAL_KEEP = 4, + /*!< Expression is not to be eliminated */ + EVAL_KEEP_CONST = EVAL_CONST | EVAL_KEEP, + /*!< Expression is constant not be eliminated */ + EVAL_DEL_PAREN = 8, + /*!< Redundant parentheses to deleted from expression */ + EVAL_TRUE = 16, + /*!< Expression evaluates as true */ + EVAL_FALSE = 32, + /*!< Expression evaluates as false */ + EVAL_RESOLVED = EVAL_TRUE | EVAL_FALSE, + /*!< Expression is be resolved */ + EVAL_VISITED = 64 + /*!< The text has been visited by the parser. + This flag lets us head off infinite looping on + circular macro definitions */ +}; + +/*! Structure representing the evaluation of + a text item */ +typedef struct eval_result { + char * sym_name; + /*!< Name of symbol, if text is a symbol or a + unary function of one */ + char * sym_def; + /*!< Definition of symbol, if text assigns a + definition to a symbol */ + int value; + /*!< The value of text if it is a soluble + expression */ + int flags; + /*!< Bit set of \em eval_flags */ +} eval_result_t; + + +/*! Parse the current input line and return its line type. */ +extern line_type_t +eval_line(void); + + +/*@}*/ + +/*! \addtogroup evaluator_interface_state_utils */ +/*@{*/ +IMPORT_INITOR(evaluator); +IMPORT_FINITOR(evaluator); +/*@}*/ + + +#endif /* EOF */ diff --git a/src/exception.c b/src/exception.c new file mode 100755 index 0000000..202fdb3 --- /dev/null +++ b/src/exception.c @@ -0,0 +1,53 @@ +/*************************************************************************** + * Copyright (C) 2004, 2006 Symbian Software Ltd. * + * All rights reserved. * + * Copyright (C) 2007, 2008 Mike Kinghan, imk@strudl.org * + * All rights reserved. * + * Contributed by Mike Kinghan, imk@strudl.org, derived from the code * + * of Tony Finch * + * * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * Redistributions of source code must retain the above copyright * + * notice, this list of conditions and the following disclaimer. * + * * + * Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * * + * Neither the name of Symbian Software Ltd. nor the names of its * + * contributors may be used to endorse or promote products derived from * + * this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,* + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * + * DAMAGE. * + * * + ***************************************************************************/ + +#include "exception.h" +#include "report.h" +#include +#include + +/*!\ingroup exception_module + *\file exception.c + * This file implements the Exception module. + */ + +jmp_buf exception_context; + +bool exceptions_enabled = 0; + +/* EOF */ diff --git a/src/exception.h b/src/exception.h new file mode 100755 index 0000000..24a6186 --- /dev/null +++ b/src/exception.h @@ -0,0 +1,74 @@ +#ifndef EXCEPTION_H +#define EXCEPTION_H +/*************************************************************************** + * Copyright (C) 2004, 2006 Symbian Software Ltd. * + * All rights reserved. * + * Copyright (C) 2007, 2008 Mike Kinghan, imk@strudl.org * + * All rights reserved. * + * * + * Contributed originally by Mike Kinghan, imk@strudl.org * + * * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * Redistributions of source code must retain the above copyright * + * notice, this list of conditions and the following disclaimer. * + * * + * Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * * + * Neither the name of Symbian Software Ltd. nor the names of its * + * contributors may be used to endorse or promote products derived from * + * this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,* + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * + * DAMAGE. * + * * + ***************************************************************************/ + +#include "opts.h" +#include "setjmp.h" + +/*!\ingroup exception_module + *\file exception.h + * This file provides the Exception module interface. + */ + +/*! \addtogroup exception_module */ +/*@{*/ + +/*! The execution context to which exceptions return. +*/ +extern jmp_buf exception_context; + +/*! Status of exception handling, enabled/disabled */ +extern bool exceptions_enabled; + +/*! Catch an exception. + The macro returns 0 if no exception was + thrown, else the integer exception. +*/ +#define catch() setjmp(exception_context) + +/*! Throw an exception. + The function causes control to pass to the site + of the last call to \c catch(), which will then + return the value \c exception +*/ +#define throw(x) longjmp(exception_context,(x)) + +/*@}*/ + +#endif /* EOF */ diff --git a/src/file_tree.c b/src/file_tree.c new file mode 100755 index 0000000..f9591fa --- /dev/null +++ b/src/file_tree.c @@ -0,0 +1,817 @@ +/*************************************************************************** + * Copyright (C) 2004, 2006 Symbian Software Ltd. * + * All rights reserved. * + * Copyright (C) 2007, 2008 Mike Kinghan, imk@strudl.org * + * All rights reserved. * + * * + * Contributed originally by Mike Kinghan, imk@strudl.org * + * * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * Redistributions of source code must retain the above copyright * + * notice, this list of conditions and the following disclaimer. * + * * + * Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * * + * Neither the name of Symbian Software Ltd. nor the names of its * + * contributors may be used to endorse or promote products derived from * + * this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,* + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * + * DAMAGE. * + * * + ***************************************************************************/ + +#include "file_tree.h" +#include "filesys.h" +#include "ptr_vector.h" +#include "platform.h" +#include "report.h" +#include +#include + +/*!\ingroup file_tree_module file_tree_interface file_tree_internals + *\file file_tree.c + * This file implements the File Tree module + */ + +/*! \addtogroup file_tree_internals */ +/*@{*/ + +/*! Value of the \c parent field in \c struct \c file_tree + indicating the the true value has yet to be set. +*/ +#define PARENT_PENDING ((void *)-1) +/*! + Test whether a file tree is not yet linked to its + parent. +*/ +#define IS_UNLINKED(ftree) ((ftree)->parent == PARENT_PENDING) +/*! + A file tree is a root node if it has no parent +*/ +#define IS_ROOT(ftree) ((ftree)->parent == NULL) +/*! + A file tree represents a file if it has no list of + children (not even an empty list). +*/ +#define IS_FILE(ftree) ((ftree)->children == NULL) +/*! + A file tree represents a directory if it does not + represent a file. +*/ +#define IS_DIR(ftree) (!IS_FILE(ftree)) + +/*! + \e flags for \c file_tree_count() specify that files are + to be counted. +*/ +#define COUNT_FILES(flags) (((flags) & FT_COUNT_FILES) == FT_COUNT_FILES) +/*! + \e flags for \c file_tree_count() specify that only files are + to be counted. +*/ +#define COUNT_FILES_ONLY(flags) (((flags) & FT_COUNT_ALL) == FT_COUNT_FILES) +/*! + \e flags for \c file_tree_count() specify that directories are + to be counted. +*/ +#define COUNT_DIRS(flags) (((flags) & FT_COUNT_DIRS) == FT_COUNT_DIRS) +/*! + \e flags for \c file_tree_count() specify that only + directories are to be counted. +*/ +#define COUNT_DIRS_ONLY(flags) (((flags) & FT_COUNT_ALL) == FT_COUNT_DIRS) +/*! + \e flags for \c file_tree_count() specify that both + directories and files are to be counted. +*/ +#define COUNT_ALL(flags) (((flags) & FT_COUNT_ALL) == FT_COUNT_ALL) +/*! + \e flags for \c file_tree_count() specify that only + the immediate children of the file tree are to be + counted +*/ +#define COUNT_CHILDREN(flags) (((flags) & FT_COUNT_CHILDREN) == FT_COUNT_CHILDREN) + +/*! Structure representing a file or directory in + relation to its parent directory (if any) and + contained files (if any) +*/ +struct file_tree { + union { + heap_str leafname; /*!< In non-root node, leafname of file + or directory */ + file_filter_t filter; /*!< In root-node, pointer to the + filter function of the tree. */ + } var; + struct file_tree * parent; /*!< NULL for root node. For + non-root node, node representing + parent directory */ + ptr_vector_h children; /*!< Immediate children of directory node, + or NULL */ + unsigned files; /*!< Total number of files (excluding directories) + within this tree */ +}; + +/*! + The default filter function for a file tree to which + no filter is attached. It accepts all files. +*/ +static bool +null_filter(char const *leafname) +{ + return true; +} + +/*! + The default callback function for a file tree traversals + where none is specified. It does nothing. +*/ +static void +null_callback( file_tree_h tree, + char const *name, + file_tree_traverse_state_t context) +{ +} + +/*! + Construct a new file tree node. + + \param leafname Pointer to the name of the new node. + \param len The length of the name at \c leafname. + If 0, \c strlen(leafname) is used. + + \return The new node. +*/ +static file_tree_h +new_node(char const *leafname, size_t len) +{ + file_tree_h tree = callocate(1,sizeof(struct file_tree)); + if (!len) { + len = strlen(leafname); + } + tree->parent = PARENT_PENDING; + tree->var.leafname = allocate(len + 1); + strncpy(tree->var.leafname,leafname,len); + return tree; +} + + +/*! + Construct a new file tree node to represent a file. + + \param leafname The name of the new node. + \param filter Pointer to a function that + shall be applied to \c leafname to accept or + reject it for constructing a node. + \return iIf \c leafname satisfies \c filter then + a new node is returned; else NULL. +*/ +static file_tree_h +new_file_node(char const *leafname, file_filter_t filter) +{ + file_tree_h tree = NULL; + if (filter(leafname)) { + tree = new_node(leafname,0); + tree->files = 1; + } + return tree; +} + +/*! + Return the parent of a file tree. + + \param child The file tree whose parent is required. + \return The parent of \e child, if any; NULL if + \e child is a root node or is not yet linked. + +*/ +static file_tree_h +get_parent(file_tree_h child) +{ + return IS_UNLINKED(child) || IS_ROOT(child) ? NULL : child->parent; +} +/*! + Link a child node to its parent node in a file tree. + + \param parent The parent node. + \param child The child node. + + \e child is added to the children of \e child->parent + and \e parent is assigned as the parent of \e child + +*/ +static void +link(file_tree_h parent, file_tree_h child) +{ + unsigned new_files; + assert(!IS_ROOT(child)); + if (!parent->children) { + parent->children = ptr_vector_new(); + } + child->parent = parent; + ptr_vector_append(parent->children,child); + new_files = child->files; + if (new_files) { + for ( ;parent; child = parent,parent = get_parent(child)) { + parent->files += new_files; + } + } +} + +/* Forward declaration */ +static void +file_tree_add_symlink( file_tree_h root, + fs_dir_t parent, + char const *symlink, + file_tree_callback_t callback); + + +/*! + Construct a new file tree node to represent a directory + + \param root The root node of the file tree in which + the new node will potentially be added. + \param leafname The name of the new node. + \param dir Handle to the directory of which + \c leafname is the leafname. + \param filter A pointer to a function that + shall be applied to the names of files + (not directories) under \c dir to accept or reject + them for inclusion under the new node. + \param callback NULL, or a \c file_tree_callback_t to be + called at entry and exit for each directory node + constructed and for each file added. + \return If any files are found recursively under \c dir + that satisfy \c filter then a new node is returned + representing the directory together with all such + files and the subdirectories that contain them. +*/ + +static file_tree_h +new_dir_node( file_tree_h root, + char const *leafname, + fs_dir_t dir, + file_filter_t filter, + file_tree_callback_t callback) +{ + file_tree_h tree = new_node(leafname,0); + char const *cur_entry; + char const *fullname = fs_cur_dir_entry(dir,&cur_entry); + assert(cur_entry[0] == '\0'); + callback(tree,fullname,FT_ENTERING_DIR); + tree->children = ptr_vector_new(); + while((leafname = fs_read_dir(dir,&fullname)) != NULL) { + fs_obj_type_t obj_type = fs_obj_type(fullname); + if (FS_IS_SLINK(obj_type)) { + file_tree_add_symlink(tree,dir,fullname,callback); + } + else { + file_tree_h child = NULL; + fs_dir_t subdir = fs_open_dir(fullname,dir); + if (subdir) { + child = new_dir_node(root,leafname,subdir,filter,callback); + fs_close_dir(subdir); + } + else { + child = new_file_node(leafname,filter); + if (child) { + callback(child,fullname,FT_AT_FILE); + } + } + if (child) { + assert(child->files); + link(tree,child); + } + } + } + fullname = fs_cur_dir_entry(dir,&cur_entry); + assert(cur_entry[0] == '\0'); + callback(tree,fullname,FT_LEAVING_DIR); + if (!tree->files) { + file_tree_dispose(&tree); + } + return tree; +} + +/*! Return the root node of a file tree */ +static file_tree_h +get_root(file_tree_h tree) +{ + if (IS_ROOT(tree)) { + return tree; + } + return get_root(tree->parent); +} + + +static file_tree_h +seek_child(file_tree_h node, char const *childname) +{ + file_tree_h child = NULL; + if (node->children) { + file_tree_h *start = + (file_tree_h *)ptr_vector_start(node->children); + file_tree_h *end = + (file_tree_h *)ptr_vector_end(node->children); + for ( ;start != end; ++start) { + if (!strcmp(childname,(*start)->var.leafname)) { + child = *start; + break; + } + } + } + return child; +} + + +/*! + Search for a path in a file tree. + + \param tree The file tree to be searched. + \param path Pointer to the path to be searched for. + + \return The deepest node in \c tree to which any + initial subpath of \c *path is a key. The + unmatched reminder of the path will be stored + at \c path. + + If the path at \c *path is relative then then it is + assumed to be relative to a path that is a key to the + parent of \c tree. If \c *path is absolute then + the function returns \c seek(root,path), where \c root + is the root node of \c tree. + +*/ +static file_tree_h +seek(file_tree_h tree, char const **path) +{ + char const *posn = *path; + char const *end = strchr(posn,PATH_DELIM); + fs_path_type_t path_type = fs_path_type(posn); + if (!end) { + end = posn + strlen(posn); + } + if (!IS_ROOT(tree)) { + size_t elmlen = end - posn; + if (fs_windows_path(path_type) && fs_absolute_path(path_type)) { + path_type = 0; + } + if (tree->var.leafname[elmlen] =='\0' && + !strncmp(tree->var.leafname,posn,elmlen)) { + *path = posn += elmlen; + } + else { + return tree; + } + } + if (*posn) { + if (!fs_windows_path(path_type) || !fs_absolute_path(path_type)) { + *path = posn = end + 1; + } + if (tree->children) { + file_tree_h child = NULL; + file_tree_h *start = + (file_tree_h *)ptr_vector_start(tree->children); + file_tree_h *end = + (file_tree_h *)ptr_vector_end(tree->children); + for ( ;start != end && posn == *path; ++start) { + child = seek(*start,&posn); + } + if (posn != *path) { + *path = posn; + tree = child; + } + } + } + return tree; +} + +/*! + Deepen a file tree by linking additional nodes + to represent successive directory components of a + path. + + \param tree The file tree to be deepened. + \param path Pointer to the path to be parsed. + + \return The final node that has been added to the + file tree. The address of the final element + of the parsed path is stored at \c path. +*/ +static file_tree_h +deepen(file_tree_h tree, char const **path) +{ + char const *end = strchr(*path,PATH_DELIM); + if (end) { + file_tree_h child = new_node(*path,end - *path); + child->children = ptr_vector_new(); + link(tree,child); + *path = end + 1; + tree = deepen(child,path); + } + return tree; +} + +/*! + Recursively traverse a file tree, + executing a callback at each node. + + \param tree The file tree to traverse. + \param callback The callback to execute at each node. + \param path_start Pointer to the full pathname of + \em tree + \param path_end Pointer just past the end of the + full pathname of \em tree. + + \em callback is executed at each file node reached, + passing the full pathname of the file and the flag + \c FT_AT_FILE. It is executed at entry and exit for each + directory node, passing the full pathname of the directory + and \c FT_ENTERING_DIR or \c FT_LEAVING_DIR respectively. +*/ +static void +traverse( file_tree_h tree, + file_tree_callback_t callback, + char *path_start, + char *path_end) +{ + strcpy(path_end,tree->var.leafname); + if (IS_DIR(tree)) { + size_t leaflen = strlen(path_end); + file_tree_h * start = (file_tree_h *)ptr_vector_start(tree->children); + file_tree_h * end = (file_tree_h *)ptr_vector_end(tree->children); + callback(tree,path_start,FT_ENTERING_DIR); + path_end[leaflen++] = PATH_DELIM; + for ( ;start != end; ++start) { + traverse(*start,callback,path_start,path_end + leaflen); + } + path_end[--leaflen] = '\0'; + callback(tree,path_start,FT_LEAVING_DIR); + } + else { + callback(tree,path_start,FT_AT_FILE); + } +} + + +/*! Add the filtered contents of a canonical path to a file tree. + + The function is the same as \e file_tree_add() with the + restriction that the path parameter must be an absolute + real path (not a symbolic link). +*/ +static void +file_tree_add_canon( file_tree_h root, + char const *path, + file_tree_callback_t callback) +{ + char const * fullpath = path; + heap_str parent_path = fs_split_filename(path,NULL); + fs_dir_t parent_dir = parent_path ? fs_open_dir(parent_path,NULL) : NULL; + fs_dir_t dir = fs_open_dir(path,parent_dir); + file_filter_t filter; + file_tree_h lowest; + if (parent_path) { + free(parent_path); + } + root = get_root(root); + filter = root->var.filter; + if (!callback) { + callback = null_callback; + } + lowest = seek(root,&path); + if (*path) { + file_tree_h child; + lowest = deepen(lowest,&path); + if (!dir) { + child = new_file_node(path,filter); + if (child) { + callback(child,fullpath,FT_AT_FILE); + } + } + else { + child = new_dir_node(root,path,dir,filter,callback); + } + if (child) { + link(lowest,child); + } + } + else if (dir) { + char const * leafname; + char const *fullname; + while((leafname = fs_read_dir(dir,&fullname)) != NULL) { + fs_obj_type_t obj_type = fs_obj_type(fullname); + if (FS_IS_SLINK(obj_type)) { + file_tree_add_symlink(root,dir,fullname,callback); + } + else { + file_tree_h child = seek_child(lowest,leafname); + if (!child) { + fs_dir_t subdir = fs_open_dir(fullname,dir); + if (!subdir) { + child = new_file_node(leafname,filter); + if (child) { + callback(child,fullname,FT_AT_FILE); + } + } + else { + child = + new_dir_node(root,leafname,subdir,filter,callback); + fs_close_dir(subdir); + } + if (child) { + link(lowest,child); + } + } + } + } + } + if (parent_dir) { + fs_close_dir(parent_dir); + } + if (dir) { + fs_close_dir(dir); + } +} + + +/*! Add a the contents of a symbolic link to a file tree. + + \param root The file tree to which a symbolic link is + to be added. + \param dir NULL, or the handle of the directory being + traversed when the symlink was found. + \param symlink The absolute name of the symlink. + \return True if the symlink is found to be eligible for + addition to the file tree, else false. + + When a symbolic link is found among the inputs, it can + represent a "jump" from one ostensible position in the + filesystem to an arbitrary other position. + + The basic approach for handling such a jump is to + "start from scratch", calling \em file_tree_add_canon() + on the resolved real pathname \em R of the symbolic link. + + There is one snag with this approach. \em R might lie beneath + some directory \em D that is still in play at the time when + we wish to call \em file_tree_add_canon(R), i.e. we are + in the process of traversing \em D and have not yet + linked it into the input file tree. In this case a call + to \em file_tree_add_canon(R) would force \em D to be + linked while we are trying to determine whether it should + be; and if we finally decided that \em D should be linked, + we will end up linking it twice. + + The addition of a depuplication precautions to the linkage + logic simply to cater for symbolic links would have very poor + cost-benefit. Instead, we just determine whether \em R is + a subdirectory of any of the directories that are in play + when we encounter the symlink, by backtracking from the + directory in which we found the symlink and comparing the + successive directory pathnames with \em R until either we + find one that is a parent of \em R or reach the root of + of the directories currently open for traversal. Only + if \em R is not found found to lie under any of the open + directories is it necessary to call + \em file_tree_add_canon(R), because otherwise \em R + has either already been traversed or it is going to be + traversed within the active call to \em file_tree_add_canon(). + +*/ +static void +file_tree_add_symlink( file_tree_h root, + fs_dir_t dir, + char const *symlink, + file_tree_callback_t callback) +{ + heap_str realpath; + realpath = fs_real_path(symlink,NULL); + report(GRIPE_SYMLINK,NULL,"Resolved symbolic link \"%s\"",symlink); + if (dir) { + size_t shared_len = 0; + char const *entry; + char const * dirname = fs_cur_dir_entry(dir,&entry); + char const *shared_path = + fs_path_comp(dirname,realpath,&shared_len); + while (!(shared_path == dirname && dirname[shared_len] == 0)) { + if ((dir = fs_get_parent(dir)) == NULL) { + break; + } + dirname = fs_cur_dir_entry(dir,&entry); + shared_path = fs_path_comp(dirname,realpath,&shared_len); + } + } + if (!dir) { + file_tree_add_canon(root,realpath,callback); + } + free(realpath); +} + +#ifdef DEBUG_FILE_TREE +static void +file_tree_print_name(file_tree_h tree, char const *name, int context) +{ + (void)context; + puts(name); +} + +void +file_tree_dump(file_tree_h file_tree) +{ + if (!IS_ROOT(file_tree)) { + file_tree_dump(file_tree->parent); + } + else { + file_tree_traverse(file_tree,file_tree_print_name); + } +} + +#endif + +/*@}*/ + +/* API */ + +heap_str +file_tree_name(const file_tree_h file_tree) +{ + heap_str full_name; + if (IS_ROOT(file_tree)) { + full_name = callocate(1,1); + } + else { + heap_str path_name = file_tree_name(file_tree->parent); + full_name = + fs_compose_filename(path_name,file_tree->var.leafname); + free(path_name); + } + return full_name; +} + +file_tree_h +file_tree_new(void) +{ + file_tree_h tree = callocate(1,sizeof(struct file_tree)); + tree->var.filter = null_filter; + return tree; +} + +bool +file_tree_set_filter(file_tree_h file_tree, file_filter_t filter) +{ + if (!file_tree_is_empty(file_tree)) { + return false; + } + file_tree->var.filter = filter; + return true; +} + +void +file_tree_dispose(file_tree_h * file_tree) +{ + file_tree_h tree = *file_tree; + if (tree) { + if (tree->children) { + file_tree_h * start = (file_tree_h *)ptr_vector_start(tree->children); + file_tree_h * end = (file_tree_h *)ptr_vector_end(tree->children); + for ( ;start != end; ++start) { + file_tree_dispose(start); + } + ptr_vector_dispose(&tree->children); + } + if (!IS_ROOT(tree) && tree->var.leafname) { + free(tree->var.leafname); + } + release((void **)file_tree); + } +} + + +void +file_tree_add( file_tree_h root, + char const *path, + file_tree_callback_t callback) +{ + fs_obj_type_t obj_type = fs_file_or_dir(path); + if (FS_IS_SLINK(obj_type)) { + file_tree_add_symlink(root,NULL,path,callback); + } + else { + heap_str fullpath = fs_real_path(path,NULL); + file_tree_add_canon(root,fullpath,callback); + free(fullpath); + } +} + +void +file_tree_traverse( file_tree_h tree, + file_tree_callback_t callback) +{ + callback(tree,NULL,FT_ENTERING_TREE); + if (tree->children) { + file_tree_h * start; + file_tree_h * end; + heap_str pathstack = callocate(1,PATH_MAX); + strcpy(pathstack,FS_ROOT_PREFIX); + start = (file_tree_h *)ptr_vector_start(tree->children); + end = (file_tree_h *)ptr_vector_end(tree->children); + for ( ;start != end; ++start) { + traverse(*start,callback,pathstack,pathstack + strlen(pathstack)); + } + free(pathstack); + } + callback(tree,NULL,FT_LEAVING_TREE); +} + +bool +file_tree_is_empty(file_tree_h file_tree) +{ + if (!IS_ROOT(file_tree)) { + return false; + } + return !file_tree->children || ptr_vector_count(file_tree->children) == 0; +} + +size_t +file_tree_count(const file_tree_h tree, unsigned flags, file_tree_count_t *counter) +{ + file_tree_count_t count = {0,0,0}; + int count_children = COUNT_CHILDREN(flags); + int count_dirs = COUNT_DIRS(flags); + int count_files = COUNT_FILES(flags); + if (!count_children && count_files && !count_dirs) { + count.files = tree->files; + } + else { + if (!IS_ROOT(tree)) { + if (!count_children) { + if (IS_DIR(tree)) { + count.dirs += count_dirs; + } + else { + count.files += count_files; + } + } + } + if (IS_DIR(tree)) { + file_tree_h * start = (file_tree_h *)ptr_vector_start(tree->children); + file_tree_h * end = (file_tree_h *)ptr_vector_end(tree->children); + for ( ;start != end; ++ start) { + if (count_children) { + ++count.children; + if (IS_DIR(*start)) { + count.dirs += count_dirs; + } + else { + count.files += count_files; + } + } + else { + file_tree_count(*start,flags,&count); + } + } + } + } + if (counter) { + *counter = count; + } + return count.files + count.dirs; +} + + +file_tree_h +file_tree_child(file_tree_h file_tree, size_t which) +{ + file_tree_h child = NULL; + if (IS_DIR(file_tree)) { + size_t children = ptr_vector_count(file_tree->children); + if (children) { + if (which == FT_LAST) { + which = children - 1; + } + if (which < children) { + child = *(file_tree_h *)ptr_vector_at(file_tree->children,which); + } + } + } + return child; +} + +/* EOF */ diff --git a/src/file_tree.h b/src/file_tree.h new file mode 100755 index 0000000..778f18b --- /dev/null +++ b/src/file_tree.h @@ -0,0 +1,250 @@ +#ifndef FILE_TREE_H +#define FILE_TREE_H +/*************************************************************************** + * Copyright (C) 2004, 2006 Symbian Software Ltd. * + * All rights reserved. * + * Copyright (C) 2007, 2008 Mike Kinghan, imk@strudl.org * + * All rights reserved. * + * * + * Contributed originally by Mike Kinghan, imk@strudl.org * + * * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * Redistributions of source code must retain the above copyright * + * notice, this list of conditions and the following disclaimer. * + * * + * Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * * + * Neither the name of Symbian Software Ltd. nor the names of its * + * contributors may be used to endorse or promote products derived from * + * this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,* + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * + * DAMAGE. * + * * + ***************************************************************************/ +#include "memory.h" + +/*!\ingroup file_tree_module file_tree_interface + *\file file_tree.h + * This file provides the File Tree module interface. + */ + +/*! \addtogroup file_tree_interface */ +/*@{*/ + +/*! + Symbolic constant denoting the index of the last child + of a file tree. +*/ +#define FT_LAST ((size_t)-1) + +/*! Enmeration of the states of file tree traversal. */ +typedef enum { + FT_ENTERING_TREE = -2, /*! Entering file tree */ + FT_ENTERING_DIR = -1, /*!< Entering directory */ + FT_AT_FILE = 0, /*!< At a file */ + FT_LEAVING_DIR = 1, /*!< Leaving directory */ + FT_LEAVING_TREE = 2 /*! Leaving file tree */ +} file_tree_traverse_state_t; + +/*! Bit flags that may be combined in flags passed to + \c file_tree_count() to select the nodes counted. +*/ +enum file_tree_count_flags { + FT_COUNT_FILES = 1, /*!< Count only files */ + FT_COUNT_DIRS = 2, /*!< Count only directories */ + FT_COUNT_ALL = FT_COUNT_FILES | FT_COUNT_DIRS, /*!< Count everything */ + FT_COUNT_CHILDREN = 4 /*!< Only count immediate children.*/ +}; + +/*! Abstract type of file tree */ +typedef struct file_tree * file_tree_h; + + +/*! Type of structure optionally passed to \em file_tree_count() + in which to store a break-down of the counted objects */ +typedef struct { + size_t files; /*!< Files counted, with \c FT_COUNT_FILES */ + size_t dirs; /*!< Directories counted, with \c FT_COUNT_DIRS */ + size_t children; /*!< Number of immediate children counted, + with FT_COUNT_CHILDREN */ +} file_tree_count_t; + +/*! Type of callabck function to be iterated over a file tree. + + \param tree The current file tree. + \param name The pathame of the file or directory + \param context Indicator of calling context:- + FT_ENTERING_TREE => Starting traversal. \e name is NULL + FT_ENTERING_DIR => Entering directory \e name + FT_AT_FILE => \e name is a file + FT_LEAVING_DIR => Entering directory \e name + FT_LEAVING_TREE => Finished traversal. \e name is NULL + + */ + +typedef void (*file_tree_callback_t)( file_tree_h tree, + char const *name, + file_tree_traverse_state_t context); + +/*! Type of functions for filtering files by leafname. + A file tree contains a function pointer of this type that + is used to decide the eligibility of files (not directories) + for insertion in the file tree. If no such function is + assigned to a file tree then the default filter accepts + all files. + + \param leafname The leafname of the file. + \return True iff the leafname satisfies the filter. +*/ +typedef bool (*file_filter_t)(char const *leafname); + + +/*! Compose the full name of a file tree, i.e. + the pathname composed from the root name of the + file tree and the root names of its recursive + parents. +*/ +extern heap_str +file_tree_name(const file_tree_h file_tree); + +/*! Construct and return a new file tree. + The new file tree is empty and may be populated with + \c file_tree_add(), but this object always represents + the root of the file system. +*/ +extern file_tree_h +file_tree_new(void); + +/*! Try to attach a filter function to a file tree, to be used + to be used to decide the eligibility of files (not directories) + for insertion in the file tree. + + \param file_tree The file tree to which the filter + will be attached. + \param filter Pointer to the filter function to + attach. + + \return True if the filter function can be attached to + the file tree, else false. A filter can only be + attached to a file tree when it is empty. +*/ +extern bool +file_tree_set_filter(file_tree_h file_tree, file_filter_t filter); + + +/*! Add the filtered contents of a path to a file tree. + + \param parent The file tree to which a path is to be + added. + \param path The path to be added. + + \param callback NULL, or \c file_tree_callback_t to be + called on entry and exit for each directory + added and for each file added. + + Files in \c path are added to the tree that satisfy the + assigned or default filter function of the tree. The + default filter accepts all files. + + If \c path is a file, the function adds the file to \c parent + if it satisfies the filter and is not already + present, together with all component directories of \c path + that are not already present. + + If \c path is a directory and recursively contains any files + that satisfy the filter and are not already present + then all these files are added to parent, together with any + of the directories recursively containing them that are not + already present. + + The function populates the file tree grudgingly. A new + node will only be added to any parent when the subtree rooted + at the new node has been wholly constructed in the same + grudging manner and found to contain any wanted files. +*/ +extern void +file_tree_add( file_tree_h parent, + char const *path, + file_tree_callback_t callback); + + +/*! Dispose of a file tree, releasing its resources. + + \param file_tree Pointer to the file tree to be + destroyed. +*/ +extern void +file_tree_dispose(file_tree_h * file_tree); + +/*! Iterate a function over a file tree. + + \param file_tree The file_tree to be traversed. + \param callback NULL, or \c file_tree_callback_t to be + called on entry and exit for each directory + added and for each file traversed. +*/ +extern void +file_tree_traverse( file_tree_h file_tree, + file_tree_callback_t callback); + + +/*! Say whether a file tree contains any files or directories. +*/ +extern bool +file_tree_is_empty(file_tree_h file_tree); + +/*! Count nodes in a file tree + \param file_tree The file tree to be counted. + \param flags A combination of the bitflags in + \c enum \c file_tree_count_flags controlling + which nodes are counted. + \param counter. NULL, or a pointer to a + \em file_tree_count_t that is filled in with:- + - Total files counted, for flag \em FT_COUNT_FILES + - Total dirs counted, for flag \em FT_COUNT_FILES + - Immediate children counted, for flag + \em FT_COUNT_CHILDREN +*/ +extern size_t +file_tree_count( const file_tree_h file_tree, + unsigned flags, + file_tree_count_t * counter); + +/*! + Return a child of a file tree. + + \param file_tree The file tree from which a child + is to be returned. + \param which The index of the required child. + If \em which == \c FT_LAST then the last child, + if any, is returned. + \return The child of \em file_tree that is indexed by + \em which, if any, else NULL. +*/ +extern file_tree_h +file_tree_child(file_tree_h file_tree, size_t which); + +#ifdef DEBUG_FILE_TREE +extern void +file_tree_dump(file_tree_h file_tree); +#endif + +/*@}*/ + +#endif /* EOF */ diff --git a/src/filesys.c b/src/filesys.c new file mode 100755 index 0000000..144128f --- /dev/null +++ b/src/filesys.c @@ -0,0 +1,195 @@ +/*************************************************************************** + * Copyright (C) 2004, 2006 Symbian Software Ltd. * + * All rights reserved. * + * Copyright (C) 2007, 2008 Mike Kinghan, imk@strudl.org * + * All rights reserved. * + * * + * Contributed originally by Mike Kinghan, imk@strudl.org * + * * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * Redistributions of source code must retain the above copyright * + * notice, this list of conditions and the following disclaimer. * + * * + * Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * * + * Neither the name of Symbian Software Ltd. nor the names of its * + * contributors may be used to endorse or promote products derived from * + * this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,* + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * + * DAMAGE. * + * * + ***************************************************************************/ + +#include "filesys.h" +#include "platform.h" +#include "report.h" +#include +#include + +/*! \file filesys.c + * \ingroup filesystem_module + * + * This file implements the Filesystem module + */ + +heap_str +fs_compose_filename(char const *path, char const *leafname) +{ + size_t path_len = path ? strlen(path) : 0; + size_t leafname_len = strlen(leafname); + heap_str filename = allocate(path_len + sizeof(PATH_DELIM) + + leafname_len + 1); + if (path) { + strcpy(filename,path)[path_len++] = PATH_DELIM; + } + strcpy(filename + path_len,leafname); + return filename; +} + +fs_obj_type_t +fs_file_or_dir(char const *name) +{ + fs_obj_type_t obj_type = fs_obj_type(name); + if (obj_type == FS_OBJ_NONE) { + bail(GRIPE_NO_FILE,"No such file or directory as \"%s\"",name); + } + return obj_type; +} + +char * +fs_tempname(char * template) +{ + char *tempname = NULL; + char *suffix = strstr(template,"XXXXXX"); + if (suffix) { + if (!suffix[6]) { + unsigned lim = 0xffffff + 1; + unsigned i = 0; + for ( ;i < lim; ++i) { + sprintf(suffix,"%06x",i); + if (fs_obj_type(template) == FS_OBJ_NONE) { + tempname = template; + break; + } + } + } + } + return tempname; +} + +fs_path_type_t +fs_path_type(char const *filename) +{ + /* This lets the style of the first path delimiter + in filename determine whether we call it a + unix path or a windows path, unless windows + drive prefix has already settled it. + */ + fs_path_type_t pathtype = 0; + char lastch; + if (filename[0] == '/') { + pathtype |= FS_ABS_PATH | FS_UNIX_PATH; + if (!filename[1]) { + return pathtype |= FS_ROOT_PATH | FS_DANGLING_PATH; + } + } + else if (isalpha(filename[0]) && filename[1] == ':') { + pathtype |= FS_ABS_PATH | FS_WIN_PATH; + if (!filename[2]) { + return pathtype |= FS_ROOT_PATH; + } + else if (filename[2] == '\\' && !filename[3]) { + return pathtype |= FS_ROOT_PATH | FS_DANGLING_PATH; + } + } + else if (strchr(filename,'/')) { + pathtype |= FS_UNIX_PATH; + } + else if (strchr(filename,'\\')) { + pathtype |= FS_WIN_PATH; + } + lastch = filename[strlen(filename) - 1]; + if (lastch == '/' || lastch == '\\') { + pathtype |= FS_DANGLING_PATH; + } + return pathtype; +} + +char const * +fs_path_comp(char const *first, char const *second, size_t *sharedlen) +{ + char const *delim = NULL; + char const *lhs = first; + char const *rhs = second; + for ( ;*lhs && *lhs == *rhs; ++lhs,++rhs) { + if (*lhs == PATH_DELIM) { + delim = lhs; + } + } + if (*lhs != *rhs) { + if (!*lhs) { + *sharedlen = strlen(first); + return first; + } + if (!*rhs) { + *sharedlen = strlen(second); + return second; + } + if (delim) { + *sharedlen = lhs - first; + return first; + } + *sharedlen = 0; + return NULL; + } + *sharedlen = 0; + return first; +} + +heap_str +fs_split_filename(char const *path, char **leafname) +{ + heap_str parent = NULL; + char const *child = NULL; + char *delim = strrchr(path,PATH_DELIM); + if (!delim) { + fs_obj_type_t obj_type = fs_file_or_dir(path); + if (FS_IS_FILE(obj_type)) { + child = path; + } + else { + parent = allocate(strlen(path) + 1); + strcpy(parent,path); + } + } + else { + size_t len = delim - path; + parent = allocate(len + 1); + memcpy(parent,path,len); + child = delim + 1; + } + if (leafname) { + *leafname = delim; + } + return parent; +} + + + +/* EOF */ diff --git a/src/filesys.h b/src/filesys.h new file mode 100755 index 0000000..b63c52f --- /dev/null +++ b/src/filesys.h @@ -0,0 +1,314 @@ +#ifndef FILESYS_H +#define FILESYS_H +/*************************************************************************** + * Copyright (C) 2004, 2006 Symbian Software Ltd. * + * All rights reserved. * + * Copyright (C) 2007, 2008 Mike Kinghan, imk@strudl.org * + * All rights reserved. * + * * + * Contributed originally by Mike Kinghan, imk@strudl.org * + * * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * Redistributions of source code must retain the above copyright * + * notice, this list of conditions and the following disclaimer. * + * * + * Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * * + * Neither the name of Symbian Software Ltd. nor the names of its * + * contributors may be used to endorse or promote products derived from * + * this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,* + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * + * DAMAGE. * + * * + ***************************************************************************/ + +#include "memory.h" + +/*! \file filesys.h + * \ingroup filesystem_module filesystem_interface + * + * This file provides the Filesystem module interface + */ + +/*!\addtogroup filesystem_interface */ +/*@{*/ + +/*! Abstract type of directory handle */ +typedef void * fs_dir_t; + + +/*! Enumerated type of filesystem objects */ +typedef enum { + FS_OBJ_NONE, /*!< No such object */ + FS_OBJ_SLINK = 1, /*!< Object is a symbolic link */ + FS_OBJ_FILE = 2, /*!< Object is a file */ + FS_OBJ_DIR = 4 /*!< Object is a directory */ +} fs_obj_type_t; + +/*! Enumerated attributes of pathnames as returned by \em fs_path_type() */ +typedef enum { + FS_ABS_PATH = 1 , /*!< Absolute path */ + FS_UNIX_PATH = 2, /*!< Unix path */ + FS_WIN_PATH = 6, /*!< Windows path */ + FS_DANGLING_PATH = 8, /*!< Path has trailing PATH_DELIM */ + FS_ROOT_PATH = 16 /*!< Path represents files system root */ +} fs_path_type_t; + +/*! + The path type \e pathtype denotes an absolute path. +*/ +#define fs_absolute_path(pathtype) \ + (((pathtype) & FS_ABS_PATH) == FS_ABS_PATH) + +/*! + The path type \e pathtype denotes a unix path. +*/ +#define fs_unix_path(pathtype) \ + (((pathtype) & FS_UNIX_PATH) == FS_UNIX_PATH) + +/*! + The path type \e pathtype denotes a windows path. +*/ +#define fs_windows_path(pathtype) \ + (((pathtype) & FS_WIN_PATH) == FS_WIN_PATH) + +/*! + The path type \e pathtype denotes a dangling path + (with trailing path delimiter) +*/ +#define fs_dangling_path(pathtype) \ + (((pathtype) & FS_DANGLING_PATH) == FS_DANGLING_PATH) + +/*! + The path type \e pathtype denotes a root path + of the filesystem (\c "/" for unix, drive paths for + windows. +*/ +#define fs_root_path(pathtype) \ + (((pathtype) & FS_ROOT_PATH) == FS_ROOT_PATH) + +/*! + The object type \e objtype indicates a file +*/ +#define FS_IS_FILE(objtype) (((objtype) & FS_OBJ_FILE) != 0) + +/*! + The object type \e objtype indicates a directory +*/ +#define FS_IS_DIR(objtype) (((objtype) & FS_OBJ_DIR) != 0) + +/*! + The object type \e objtype indicates a symbolic link +*/ +#define FS_IS_SLINK(objtype) (((objtype) & FS_OBJ_SLINK) != 0) + +/*! Return the type of the object putatively designated + by a filename +*/ +extern fs_obj_type_t +fs_obj_type(char const *name); + +/*! Return the type of the putative file or directory + designated by a filename. Bail if neither file nor + directory. +*/ +extern +fs_obj_type_t +fs_file_or_dir(char const *name); + + +/*! Open an abstract directory handle through which + the contents of a directory can be traversed. + + \param dirname The name of the directory to be + opened. + \param parent. The handle of the open directory of + \em dirname is a subdirectory, or NULL if none. + + + \return A handle to \em dirname, or NULL if an error + occurs, which will be indicated by \c errno. +*/ +extern fs_dir_t +fs_open_dir(char const *dirname, fs_dir_t const parent); + +/*! Close an abstract directory handle, releasing + its resources. +*/ +extern void +fs_close_dir(fs_dir_t dir); + +/*! Get the name of the next entry in + a directory. + + \param dir The open directory handle to read. + \param fullname NULL, or a pointer at which + the function will store the address of + the absolute name of the entry returned. + This pointer is only valid until the next + call or until \e fs_close_dir(dir) + \return A pointer to the next entry in the directory, if + any; otherwise NULL. + The pointer is only valid until the next call or + until \e fs_close_dir(dir) + + The function ignores the entries '.' and '..'. + +*/ +extern char const * +fs_read_dir(fs_dir_t dir, char const ** fullname); + + +/*! Return the handle of the open parent directory of + a directory, if any, else NULL. +*/ +extern fs_dir_t +fs_get_parent(fs_dir_t dir); + +/*! Compose a filename from a path and a leafname. + If either \e path or \e leafname is quoted or + contains spaces then the resulting filename is + quoted. + + \return The composed filename in a string allocated + on the heap. It is the caller's responsiblity to + free this string. +*/ +extern heap_str +fs_compose_filename(char const *path, char const *leafname); + +/*! Split at filename into its parent directory component + and its terminal component. + + \param path Path to be split + \param leafname NULL, or an address at which the + function will store the address of the + terminal component of \em path. + + \return The parent directory component of \em path + allocated in a string on the heap. It is the caller's + responsibility to free this string. + + If \em path has only one component then, if that + component is a directory, it is returned and NULL + will be stored at \em leafname; if the one component + is a file then NULL is returned +*/ +extern heap_str +fs_split_filename(char const *path, char **leafname); + +/*! Return the absolute real pathname of a + file or directory name (which may be the name of + a symbolic link). + + \param relname Possibly relative file or + directory name. + \param namelen If non-NULL then the length of + the absolute real name of \c relname + is stored here at return. + + \return The absolute real pathname of \c relname + in a string allocated on the heap. It is the caller's + responsiblity to free this string. NULL is returned + if an error occurs. +*/ +extern heap_str +fs_real_path(char const *relname, size_t *namelen); + +/*! Return the absolute pathname of the current entry + from a directory handle. + + \param dir Directory handle + \param entry NULL, or an address at which the + function shall store a pointer to the terminal + portion of the current full pathname that + follows the full pathname of \em dir. + \return Pointer to the absolute pathname of the + current entry in \em dir. + + The current entry in \em dir is the entry read by the last + call to \em fs_read_dir(dir), if any. If \em fs_read_dir(dir) + has not yet been called, or if the last call returned NULL, + then the returned pointer addresses the absolute + name of \em dir and, if \em leafname is not NULL, then + \em *leafname[0] will be 0. + + Otherwise, if \em leafname is not NULL then \em *leafname + will point to the last component of the current absolute + pathname commencing with '/' (unix) or '\' (windows) + +*/ +extern char const * +fs_cur_dir_entry(fs_dir_t dir, char const **entry); + + +/*! Get the type of a pathname */ +extern fs_path_type_t +fs_path_type(char const *filename); + +/*! Create a tempory filename from a template + \param template A pathname pattern from which to compose + the temporary filename. + \return A pointer to the temporary filename created, + or NULL if a temporary file satisfying template + cannot be created. + + The writable string \c template must terminate with \c XXXXXX + This suffix will be replaced, if possible, with a string of + characters to compose a filename different from that of + any existing file. +*/ +extern char * +fs_tempname(char * template); + +/*! Compare two pathnames. + \param first The first pathname. + \param second The second pathname. + \param sharedlen Address of an integer at which the + function shall store the length of any common + initial component of \em first and \em second + unless they are identical pathnames, in which + case 0 shall be stored at \em sharedlen. + + \return Pointer to the common initial component of + \em first and \em second, or NULL if there is none. + + If the returned value \em cp is non-NULL then it is equal to + either \em first or to \em second. Then: + + - If \em *sharedlen != 0 and \em cp[*sharedlen] == 0, then + returned pathname is entirely an intitial component of the + other pathname. + + - If \em *sharedlen != 0 and \em cp[*sharedlen] != 0 then + the \em *sharedlen bytes at \em cp comprise the common + initial component of \em first and \em second. + + - If \em *sharedlen == 0 then \em first and \em second + are identical pathnames. + + If the returned value is NULL then \em first and \em second + are wholly disjoint pathnames. + +*/ +extern char const * +fs_path_comp(char const *first, char const *second, size_t *sharedlen); + +/* @) */ +#endif /* EOF */ diff --git a/src/fs_nix.c b/src/fs_nix.c new file mode 100755 index 0000000..8b26c63 --- /dev/null +++ b/src/fs_nix.c @@ -0,0 +1,207 @@ +/*************************************************************************** + * Copyright (C) 2004, 2006 Symbian Software Ltd. * + * All rights reserved. * + * Copyright (C) 2007, 2008 Mike Kinghan, imk@strudl.org * + * All rights reserved. * + * * + * Contributed originally by Mike Kinghan, imk@strudl.org * + * * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * Redistributions of source code must retain the above copyright * + * notice, this list of conditions and the following disclaimer. * + * * + * Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * * + * Neither the name of Symbian Software Ltd. nor the names of its * + * contributors may be used to endorse or promote products derived from * + * this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,* + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * + * DAMAGE. * + * * + ***************************************************************************/ + +/*! \file fs_nix.c + * \ingroup filesystem_module filesystem_unix filesystem_unix_internals + * + * This file implements the filesystem module for Unix. + */ +#include "platform.h" + +#ifdef UNIX + +#include +#include +#include +#include "filesys.h" +#include "report.h" + + +/*! \addtogroup filesystem_unix_internals */ +/*@{*/ + +/*! Structure implementing \e fs_dir_t for Unix */ +typedef struct fs_dir_nix { + /*! Handle of parent directory if any, else NULL. */ + struct fs_dir_nix * parent; + /*! Name of directory */ + heap_str dirname; + /*! The end of the directory name */ + char *dirname_end; + /*! The directory handle */ + DIR * dir; + /*! Latest retrieved directory entry */ + struct dirent entry; +} fs_dir_nix_t; + +/*@}*/ + + +heap_str +fs_real_path(char const *relname, size_t *namelen) +{ + char buf[PATH_MAX]; + if (realpath(relname,buf)) { + char *full_path; + size_t len = strlen(buf); + if (namelen) { + *namelen = len; + } + full_path = allocate(len + 1); + strcpy(full_path,buf); + return full_path; + } + return NULL; +} + +fs_obj_type_t +fs_obj_type(char const *name) +{ + fs_obj_type_t type = FS_OBJ_NONE; + struct stat obj_info; + int res = lstat(name,&obj_info); + if (!res) { + if (S_ISLNK(obj_info.st_mode)) { + type |= FS_OBJ_SLINK; + } + res = stat(name,&obj_info); + if (!res) { + if (S_ISREG(obj_info.st_mode)) { + type |= FS_OBJ_FILE; + } + else if (S_ISDIR(obj_info.st_mode)) { + type |= FS_OBJ_DIR; + } + } + } + return type; +} + +fs_dir_t +fs_open_dir(char const *dirname, fs_dir_t const parent) +{ + fs_dir_nix_t * dir = NULL; + DIR * dir_handle = opendir(dirname); + if (dir_handle ) { + size_t namelen; + heap_str fullname = fs_real_path(dirname,&namelen); + if (fullname) { + dir = allocate(sizeof(fs_dir_nix_t)); + dir->parent = (fs_dir_nix_t *)parent; + dir->dir = dir_handle; + dir->dirname = fullname; + dir->dirname_end = dir->dirname + namelen; + } + } + return dir; +} + + +void +fs_close_dir(fs_dir_t dir) +{ + fs_dir_nix_t * nix_dir = dir; + assert(dir); + if (nix_dir->dir) { + closedir(nix_dir->dir); + free(nix_dir->dirname); + free(nix_dir); + } +} + +char const * +fs_read_dir(fs_dir_t dir, char const **fullname) +{ + char *filename = NULL; + fs_dir_nix_t * nix_dir = dir; + struct dirent * entry; + int res = readdir_r(nix_dir->dir,&nix_dir->entry,&entry); + if (res) { + bail(GRIPE_CANT_READ_DIR,"Read error on directory \"%s\"", + nix_dir->dirname); + } + if (entry) { + filename = nix_dir->entry.d_name; + if (filename[0] == '.' && + ((filename[1] == '.' && filename[2] == '\0') || filename[1] == '\0')) { + return fs_read_dir(dir,fullname); + } + if (fullname) { + size_t len = nix_dir->dirname_end - nix_dir->dirname; + size_t available = strlen(nix_dir->dirname_end) ; + size_t needed = strlen(filename) + 1; + if (available < needed) { + nix_dir->dirname = reallocate(nix_dir->dirname,len + needed + 1); + nix_dir->dirname_end = nix_dir->dirname + len; + } + *nix_dir->dirname_end = PATH_DELIM; + strcpy(nix_dir->dirname_end + 1,filename); + filename = nix_dir->dirname_end + 1; + *fullname = nix_dir->dirname; + } + } + else { + *nix_dir->dirname_end = '\0'; + } + return filename; +} + +char const * +fs_cur_dir_entry(fs_dir_t dir, char const **entry) +{ + fs_dir_nix_t * nix_dir = dir; + assert(dir); + if (entry) { + *entry = nix_dir->dirname_end; + } + return nix_dir->dirname; +} + +fs_dir_t +fs_get_parent(fs_dir_t dir) +{ + fs_dir_nix_t * nix_dir; + assert(dir); + nix_dir = dir; + return nix_dir->parent; +} + +#endif + +/* EOF */ + diff --git a/src/fs_win.c b/src/fs_win.c new file mode 100755 index 0000000..4d22f1b --- /dev/null +++ b/src/fs_win.c @@ -0,0 +1,212 @@ +/*************************************************************************** + * Copyright (C) 2004, 2006 Symbian Software Ltd. * + * All rights reserved. * + * Copyright (C) 2007, 2008 Mike Kinghan, imk@strudl.org * + * All rights reserved. * + * * + * Contributed originally by Mike Kinghan, imk@strudl.org * + * * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * Redistributions of source code must retain the above copyright * + * notice, this list of conditions and the following disclaimer. * + * * + * Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * * + * Neither the name of Symbian Software Ltd. nor the names of its * + * contributors may be used to endorse or promote products derived from * + * this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,* + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * + * DAMAGE. * + * * + ***************************************************************************/ + +/*! \file fs_win.c + * \ingroup filesystem_module filesystem_windows filesystem_windows_internals + * + * This file implements the filesystem module for windows. + */ +#include "platform.h" + +#ifdef WINDOWS + +#include "filesys.h" +#include "memory.h" +#include "report.h" +#include +#include +#include + +/*! \addtogroup filesystem_windows_internals */ +/*@{*/ + +/*! Structure implementing \e fs_dir_t for Windows */ +typedef struct fs_dir_win { + /*! Handle of parent directory if any, else NULL. */ + struct fs_dir_win * parent; + /*! Name of directory */ + heap_str dirname; + /*! The end of the directory name */ + char *dirname_end; + /*! Handle returned by FindFirstFile() */ + HANDLE handle; + /*! Search data updated by FindFirstFile or FindFile() */ + WIN32_FIND_DATA obj_info; +} fs_dir_win_t; + + +/*@}*/ + +heap_str +fs_real_path(char const *relname, size_t *namelen) +{ + heap_str fullpath = _fullpath(NULL,relname,MAX_PATH); + if (namelen) { + *namelen = strlen(fullpath); + } + return fullpath; +} + +fs_obj_type_t +fs_obj_type(char const *name) +{ + WIN32_FILE_ATTRIBUTE_DATA obj_info; + int res = GetFileAttributesEx(name,GetFileExInfoStandard,&obj_info); + if (res) { + if (obj_info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { + return FS_OBJ_DIR; + } + else { + return FS_OBJ_FILE; + } + } + return FS_OBJ_NONE; +} + +fs_dir_t +fs_open_dir(char const *dirname, fs_dir_t const parent) +{ + fs_dir_win_t * dir = NULL; + size_t namelen; + heap_str fullname = fs_real_path(dirname,&namelen); + if (fullname) { + HANDLE find_handle; + WIN32_FIND_DATA obj_info; + if (fullname[namelen - 1] == PATH_DELIM) { + --namelen; + } + fullname = reallocate(fullname,namelen + 3); + strcpy(fullname + namelen,"\\*"); + find_handle = FindFirstFile(fullname,&obj_info); + if (find_handle != INVALID_HANDLE_VALUE) { + size_t needed; + dir = allocate(sizeof(fs_dir_win_t)); + dir->parent = (fs_dir_win_t *)parent; + dir->dirname = fullname; + dir->handle = find_handle; + dir->obj_info = obj_info; + dir->dirname[namelen] = '\0'; + dir->dirname_end = dir->dirname + namelen; + needed = strlen(dir->obj_info.cFileName) + 1; + dir->dirname = reallocate(dir->dirname,namelen + needed + 1); + dir->dirname_end = dir->dirname + namelen; + *dir->dirname_end = '\0'; + } + } + return dir; +} + +void +fs_close_dir(fs_dir_t dir) +{ + fs_dir_win_t * win_dir = dir; + assert(dir); + if (win_dir->handle != INVALID_HANDLE_VALUE) { + FindClose(win_dir->handle); + } + free(win_dir->dirname); + free(win_dir); +} + +char const * +fs_read_dir(fs_dir_t dir, char const ** fullname) +{ + fs_dir_win_t * win_dir = dir; + char * filename = NULL; + BOOL res; + assert(dir); + if (win_dir->handle != INVALID_HANDLE_VALUE) { + size_t len = win_dir->dirname_end - win_dir->dirname; + size_t available = strlen(win_dir->dirname_end) ; + size_t needed = strlen(win_dir->obj_info.cFileName) + 1; + if (available < needed) { + win_dir->dirname = reallocate(win_dir->dirname,len + needed + 1); + win_dir->dirname_end = win_dir->dirname + len; + } + *win_dir->dirname_end = PATH_DELIM; + filename = win_dir->dirname_end + 1; + strcpy(filename,win_dir->obj_info.cFileName); + if (fullname) { + *fullname = win_dir->dirname; + } + } + if (filename) { + res = FindNextFile(win_dir->handle,&win_dir->obj_info); + if (!res) { + FindClose(win_dir->handle); + win_dir->handle = INVALID_HANDLE_VALUE; + if (GetLastError() != ERROR_NO_MORE_FILES) { + bail(GRIPE_CANT_READ_DIR,"Read error on directory \"%s\"", + win_dir->dirname); + } + } + if (filename[0] == '.' && + ((filename[1] == '.' && filename[2] == '\0') || filename[1] == '\0')) { + return fs_read_dir(dir,fullname); + } + } + else { + *win_dir->dirname_end = '\0'; + } + return filename; +} + +char const * +fs_cur_dir_entry(fs_dir_t dir, char const **entry) +{ + fs_dir_win_t * win_dir = dir; + assert(dir); + if (entry) { + *entry = win_dir->dirname_end; + } + return win_dir->dirname; +} + +fs_dir_t +fs_get_parent(fs_dir_t dir) +{ + fs_dir_win_t * win_dir; + assert(dir); + win_dir = dir; + return win_dir->parent; +} + +#endif + +/* EOF */ + diff --git a/src/if_control.c b/src/if_control.c new file mode 100755 index 0000000..bcde81b --- /dev/null +++ b/src/if_control.c @@ -0,0 +1,401 @@ +/*************************************************************************** + * Copyright (C) 2004, 2006 Symbian Software Ltd. * + * All rights reserved. + * Copyright (C) 2002, 2003 Tony Finch . * + * All rights reserved. * + * Copyright (C) 1985, 1993 The Regents of the University of California. * + * All rights reserved. * + * Copyright (C) 2007, 2008 Mike Kinghan, imk@strudl.org * + * All rights reserved. * + * * + * Contributed by Mike Kinghan, imk@strudl.org, derived from the code * + * of Tony Finch * + * * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * Redistributions of source code must retain the above copyright * + * notice, this list of conditions and the following disclaimer. * + * * + * Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * * + * Neither the name of Symbian Software Ltd. nor the names of its * + * contributors may be used to endorse or promote products derived from * + * this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,* + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * + * DAMAGE. * + * * + ***************************************************************************/ + +#include "if_control.h" +#include "report.h" +#include "evaluator.h" +#include "line_edit.h" +#include "line_despatch.h" +#include "opts.h" +#include "chew.h" +#include "args.h" +#include "io.h" +#include + + +/*! \ingroup if_control_module, if_control_interface, if_control_internals + * \file if_control.c + * + * This file implements the #if-Control module + */ + +/*! \addtogroup if_control_internals */ +/*@{*/ + +/*! Maximum depth of #if nesting, c.f. + * Minimum translation limits from ISO/IEC 9899:1999 5.2.4.1 + */ +#define MAXDEPTH 64 + +/* Helpers *****************************************************************/ + +/*! Type of if-state transition functions.*/ +typedef void transition_t(void); + +/*! End-of-file routine. + * + * Trap errors for end of file within comment or within quotation. + * Reset nesting depth = 0 + */ +static void +done_file(void); + +/*! Increment the nesting depth. */ +static void +nest(void); + +/*! Assign the if-control state at the current nesting depth. + * \param is The state to be assigned. */ +static void +set_state(if_state_t is); + +/*! State transition */ +static void Strue (void) { drop(); set_state(IS_TRUE_PREFIX); } +/*! State transition */ +static void Sfalse(void) { drop(); set_state(IS_FALSE_PREFIX); } +/*! State transition */ +static void Selse (void) { drop(); set_state(IS_TRUE_ELSE); } +/*! State transition */ +static void Pelif (void) { print(); set_state(IS_PASS_MIDDLE); } +/*! State transition */ +static void Pelse (void) { print(); set_state(IS_PASS_ELSE); } +/*! State transition */ +static void Pendif(void); +/*! State transition */ +static void Dfalse(void) { drop(); set_state(IS_FALSE_TRAILER); } +/*! State transition */ +static void Delif (void) { drop(); set_state(IS_FALSE_MIDDLE); } +/*! State transition */ +static void Delse (void) { drop(); set_state(IS_FALSE_ELSE); } +/*! State transition */ +static void Dendif(void); +/*! State transition */ +static void Fdrop (void) { nest(); Dfalse(); } +/*! State transition */ +static void Fpass (void) { nest(); Pelif(); } +/*! State transition */ +static void Ftrue (void) { nest(); Strue(); } +/*! State transition */ +static void Ffalse(void) { nest(); Sfalse(); } +/*! State transition */ +static void Mpass (void){ + strncpy(GET_PUBLIC(line_edit,keyword), "if ", 4); + Pelif(); +} +/*! State transition */ +static void Mtrue (void) { keywordedit("else\n"); set_state(IS_TRUE_MIDDLE); } +/*! State transition */ +static void Melif (void) +{ + keywordedit("endif\n"); + set_state(IS_FALSE_TRAILER); +} +/*! State transition */ +static void Melse (void) { keywordedit("endif\n"); set_state(IS_FALSE_ELSE); } + +/*! The state transition table + * + * An array of pointers to state transition functions. + */ +static transition_t * const transition_table[IS_COUNT][LT_TABLE_HANDLERS] = { +/* IS_OUTSIDE */ +{ + Fpass, + Ftrue, + Ffalse, + orphan_elif, + orphan_elif, + orphan_elif, + orphan_else, + orphan_endif, + print, + done_file +}, +/* IS_FALSE_PREFIX */ +{ + Fdrop, + Fdrop, + Fdrop, + Mpass, + Strue, + Sfalse, + Selse, + Dendif, + drop, + early_eof +}, +/* IS_TRUE_PREFIX */ +{ + Fpass, + Ftrue, + Ffalse, + Dfalse, + Dfalse, + Dfalse, + Delse, + Dendif, + print, + early_eof +}, +/* IS_PASS_MIDDLE */ +{ + Fpass, + Ftrue, + Ffalse, + Pelif, + Mtrue, + Delif, + Pelse, + Pendif, + print, + early_eof +}, +/* IS_FALSE_MIDDLE */ +{ + Fdrop, + Fdrop, + Fdrop, + Pelif, + Mtrue, + Delif, + Pelse, + Pendif, + drop, + early_eof +}, +/* IS_TRUE_MIDDLE */ +{ + Fpass, + Ftrue, + Ffalse, + Melif, + Melif, + Melif, + Melse, + Pendif, + print, + early_eof +}, +/* IS_PASS_ELSE */ +{ + Fpass, + Ftrue, + Ffalse, + orphan_elif, + orphan_elif, + orphan_elif, + orphan_else, + Pendif, + print, + early_eof +}, +/* IS_FALSE_ELSE */ +{ + Fdrop, + Fdrop, + Fdrop, + orphan_elif, + orphan_elif, + orphan_elif, + orphan_else, + Dendif, + drop, + early_eof +}, +/* IS_TRUE_ELSE */ +{ + Fpass, + Ftrue, + Ffalse, + orphan_elif, + orphan_elif, + orphan_elif, + orphan_else, + Dendif, + print, + early_eof +}, +/* IS_FALSE_TRAILER */ +{ + Fdrop, + Fdrop, + Fdrop, + Dfalse, + Dfalse, + Dfalse, + Delse, + Dendif, + drop, + early_eof +} +/*IF TRUE FALSE ELIF ELTRUE ELFALSE ELSE ENDIF PLAIN EOF */ +}; + +/*@}*/ + + +/*! \ingroup if_control_internals_state_utils */ +/*@{*/ + +/*! The private state of if-control module */ +STATE_DEF(if_control) { + /*! Array of states of nested #ifs */ + if_state_t ifstate[MAXDEPTH]; + /*! Current depth of \c #if nesting */ + size_t depth; + /*! Array of start lines of nested #ifs */ + size_t if_start_lines[MAXDEPTH]; +} STATE_T(if_control); + +/*@}*/ + +/*! \addtogroup if_control_internals_state_utils */ +/*@{*/ + +NO_PUBLIC_STATE(if_control); + +IMPLEMENT(if_control,ZERO_INITABLE); + +/*@}*/ + +static void +done_file(void) +{ + if (GET_PUBLIC(chew,comment_state) != NO_COMMENT) { + parse_error(GRIPE_EOF_IN_COMMENT, + "EOF in comment, #error ... or #define ... commencing line %d", + GET_PUBLIC(chew,last_comment_start_line)); + } + if (in_quotation()) { + parse_error(GRIPE_EOF_IN_QUOTE, + "EOF in quotation commencing line %d", + GET_PUBLIC(chew,last_quote_start_line)); + } +} + +static void +nest(void) +{ + size_t deep = ++SET_STATE(if_control,depth); + if (deep >= MAXDEPTH) { + bail(GRIPE_TOO_DEEP,"Too many levels of nesting"); + } + GET_STATE(if_control,if_start_lines)[deep] = GET_PUBLIC(io,line_num); +} + +static void +set_state(if_state_t is) +{ + size_t deep = if_depth(); + GET_STATE(if_control,ifstate)[deep] = is; +} + +static void Pendif(void) { print(); --SET_STATE(if_control,depth); } + +static void Dendif(void) { drop(); --SET_STATE(if_control,depth); } + +/* API *********************************************************************/ + +void +transition(line_type_t linetype) +{ + if_state_t state = GET_STATE(if_control,ifstate)[if_depth()]; + transition_table[state][linetype](); +} + +bool +dropping_line(void) +{ + if_state_t state = + GET_STATE(if_control,ifstate)[if_depth()]; + return state == IS_FALSE_PREFIX || + state == IS_FALSE_MIDDLE || + state == IS_FALSE_ELSE || + state == IS_FALSE_TRAILER; +} + +bool +was_unconditional_line(void) +{ + return + GET_STATE(if_control,ifstate)[if_depth()] == + IS_OUTSIDE; +} + +bool +is_unconditional_line(void) +{ + if_state_t state = + GET_STATE(if_control,ifstate)[if_depth()]; + return state == IS_OUTSIDE || + state == IS_TRUE_PREFIX || + state == IS_TRUE_MIDDLE || + state == IS_TRUE_ELSE ; +} + +if_state_t +if_state(void) +{ + return GET_STATE(if_control,ifstate)[if_depth()]; +} + +size_t +if_depth(void) +{ + return GET_STATE(if_control,depth); +} + +size_t +if_start_line(void) +{ + return GET_STATE(if_control,if_start_lines)[if_depth()]; +} + +void +if_control_toplevel(void) +{ + SET_STATE(if_control,depth) = 0; +} + + +/* EOF */ diff --git a/src/if_control.h b/src/if_control.h new file mode 100755 index 0000000..9d99e17 --- /dev/null +++ b/src/if_control.h @@ -0,0 +1,141 @@ +#ifndef IF_CONTROL_H +#define IF_CONTROL_H + +/*************************************************************************** + * Copyright (C) 2004, 2006 Symbian Software Ltd. * + * All rights reserved. * + * Copyright (C) 2002, 2003 Tony Finch . * + * All rights reserved. * + * Copyright (C) 1985, 1993 The Regents of the University of California. * + * All rights reserved. * + * Copyright (C) 2007, 2008 Mike Kinghan, imk@strudl.org * + * All rights reserved. * + * * + * Contributed by Mike Kinghan, imk@strudl.org, derived from the code * + * of Tony Finch * + * * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * Redistributions of source code must retain the above copyright * + * notice, this list of conditions and the following disclaimer. * + * * + * Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * * + * Neither the name of Symbian Software Ltd. nor the names of its * + * contributors may be used to endorse or promote products derived from * + * this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,* + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * + * DAMAGE. * + * * + ***************************************************************************/ +#include "opts.h" +#include "evaluator.h" +#include "bool.h" +#include + +/*!\ingroup if_control_module, if_control_interface + *\file if_control.h + * This file provides the If-Control module interface + */ + +/*! \addtogroup if_control_interface */ +/*@{*/ + +/*! Enumeration of the if-control states */ +typedef enum { + IS_OUTSIDE, + /*!< We are outside any \c #if */ + IS_FALSE_PREFIX, + /*!< We have a false \c #if followed by false #elifs */ + IS_TRUE_PREFIX, + /*!< The first non-false \c #(el)if is true */ + IS_PASS_MIDDLE, + /*!< The first non-false \c #(el)if is unknown */ + IS_FALSE_MIDDLE, + /*!< We have a false \c #elif after a pass state */ + IS_TRUE_MIDDLE, + /*!< We have a true \c #elif after a pass state */ + IS_PASS_ELSE, + /*!< We have an \c #else after a pass state */ + IS_FALSE_ELSE, + /*!< We have an \c #else after a true state */ + IS_TRUE_ELSE, + /*!< We have an \c #else after only false states */ + IS_FALSE_TRAILER, + /*!< All #elifs after a true are false */ + IS_COUNT + /*!< Count of if-control states */ +} if_state_t; + +/*! Transition the if-control state given an evaluated line type. + * \param linetype The linetype of the last evaluated input line. + * + * The function advances a state-machine whose parameters are the + * current input linetype and the current if-control state. The + * transition performs the appropriate action to despatch the + * line just evaluated and sets a new if-state. + */ +extern void +transition(line_type_t linetype); + +/*! Are we dropping the current line? */ +extern bool +dropping_line(void); + +/*! Were we always going to keep the current line unconditionally? + * I.e. it is not in any #if-scope? + */ +extern bool +was_unconditional_line(void); + +/*! Are we keeping the current line unconditionally? + * i.e. it is not in any #if-scope or is in the scope of a + * satisfied #if-condition. + */ +extern bool +is_unconditional_line(void); + +/*! For debug(), return the starting line number of the + * current #if-sequence. + */ +extern size_t +if_start_line(void); + +/*! Return the current depth of if-nesting */ +extern size_t +if_depth(void); + +/*! Return the current if-state */ +extern if_state_t +if_state(void); + +/*! Reset the depth of if-nesting to 0 */ +void +if_control_toplevel(void); + + +/*@}*/ + +/*! \addtogroup if_control_interface_state_utils */ +/*@{*/ +IMPORT_INITOR(if_control); +IMPORT_FINITOR(if_control); +/*@}*/ + + +#endif /* EOF */ diff --git a/src/io.c b/src/io.c new file mode 100755 index 0000000..d17aef2 --- /dev/null +++ b/src/io.c @@ -0,0 +1,504 @@ +/*************************************************************************** + * Copyright (C) 2004, 2006 Symbian Software Ltd. * + * All rights reserved. * + * Copyright (C) 2007, 2008 Mike Kinghan, imk@strudl.org * + * All rights reserved. * + * * + * Contributed originally by Mike Kinghan, imk@strudl.org * + * * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * Redistributions of source code must retain the above copyright * + * notice, this list of conditions and the following disclaimer. * + * * + * Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * * + * Neither the name of Symbian Software Ltd. nor the names of its * + * contributors may be used to endorse or promote products derived from * + * this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,* + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * + * DAMAGE. * + * * + ***************************************************************************/ + +#include "report.h" +#include "filesys.h" +#include "io.h" +#include "args.h" +#include "platform.h" +#include "dataset.h" +#include + +/*!\ingroup io_module, io_interface, io_internals + *\file io.c + * This file implements the I/O module + */ + +/*! \addtogroup io_internals */ +/*@{*/ + +/*! Read a source line from the current input stream into the line buffer. + * \return \em true iff a source line is read. + */ +static bool +readon(void); + +/*! Generate a temporary file for output, when the \c --replace + * option is in force. + * + * The temporary file is created in the same location + * as the input source file for ready identification in + * the event of a crash. + */ +static void +make_tempfile(void); + +/*! Replace the current input source file with the temporary output + * file, when the \c --replace option is in force. + * + * The input source file has either been deleted or renamed to a backup + * when this function is called, depending on whether the \c --backup + * option is in force. + */ +static void +replace_infile(void); + +/*! Generate a backup name for the current input source file, + * when the \c --replace and \c --backup options + * are in force. + * + * The backup filename is committed to static storage. + * \param filename The name of the source file to be backed up. + */ +static void +make_backup_name(const char *filename); + +/*! Backup the current input source file when the \c backup option is + * in force. + * The current source file is renamed with a generated backup filename. + */ +static void +backup_infile(void); + +/*! Delete the current input source file, preparatory to replacing it + * with the corresponding output file. + */ +static void +delete_infile(void) +{ + if (remove(GET_PUBLIC(io,filename))) { + bail(GRIPE_CANT_DELETE_FILE, + "Cannot remove file \"%s\"",GET_PUBLIC(io,filename)); + } +} + + +/*! Open an output stream for the current input file. + * The output stream is \c stdout unless input source + * files are to be replaced with output. Otherwise the + * output stream is opened on a temporary output file. + */ +static void +open_output(void); + +/*@}*/ + +/*! \ingroup io_internals_state_utils */ +/*@{*/ + +/*! * The global state of the I/O module. */ +STATE_DEF(io) { + INCLUDE_PUBLIC(io); /*!< The public state of the I/O module */ + FILE * input; /*!< The input stream */ + size_t bufsz; /*!< Current size of line buffer */ + size_t linelen; + /*!< Length of current the line, excluding terminal nul */ + size_t infile; /*!< Index of current input file */ + char * in_name_buf; + /*!< Current input filename on heap, if needed */ + char * out_name_buf; + /*!< Current output filename on heap, if needed */ + char * bak_name_buf; /*!< Backup filename on heap, if needed */ + size_t saved_read_pos; /*!< Saved offset into line buffer */ +} STATE_T(io); +/*@}*/ + +/*! \addtogroup io_internals_state_utils */ +/*@{*/ +IMPLEMENT(io,ZERO_INITABLE); +/*@}*/ + +/*! Read the name of a source file from \c stdin. + * Filenames may contain spaces if quoted. + * \return A pointer to the source filename in static storage, + * if a valid filename is read; NULL if no filename is read. + */ +char * read_filename(void) +{ + int ch; + size_t pos = 0; + bool quoted; + char * in_name_buf = GET_STATE(io,in_name_buf); + if (in_name_buf == NULL) { + in_name_buf = SET_STATE(io,in_name_buf) = allocate(PATH_MAX + 1); + } + ch = getchar(); + in_name_buf[0] = '\0'; + /* Skip whitespace on stdin */ + for ( ;ch != EOF && isspace(ch); ch = getchar()){}; + if (ch == EOF) { + return NULL; + } + quoted = ch == '\"'; + if (quoted) { + for (ch = getchar() ;ch != EOF && ch != '\"'; ch = getchar()) { + if (isspace(ch) && ch != ' ') { + in_name_buf[pos] = '\0'; + bail(GRIPE_ILLEGAL_FILENAME, + "Illegal whitespace in input filename: \"%s...", + in_name_buf); + } + in_name_buf[pos++] = ch; + if (pos == PATH_MAX) { + in_name_buf[pos] = '\0'; + bail(GRIPE_FILENAME_TOO_LONG, + "A filename exceeds max %d bytes: \"%s...", + PATH_MAX,in_name_buf); + } + } + in_name_buf[pos] = '\0'; + if (ch == EOF) { + bail(GRIPE_EOF_IN_FILENAME, + "A quoted input filename is unterminated: \"%s...", + in_name_buf); + } + } + else { + for ( ;ch != EOF && !isspace(ch); ch = getchar()) { + in_name_buf[pos++] = ch; + if (pos == PATH_MAX) { + in_name_buf[pos] = '\0'; + bail(GRIPE_FILENAME_TOO_LONG, + "An input filename exceeds max %d bytes: \"%s...", + PATH_MAX,in_name_buf); + } + } + in_name_buf[pos] = '\0'; + } + return in_name_buf; +} + + +/*! Read the remainder of an incomplete line into the + line buffer. + + Return true if the rest of the line is read, else false +*/ +static bool +readon(void) +{ + size_t read = 0; + for (;;) { + char *bufp; + if (GET_STATE(io,linelen) + 1 >= GET_STATE(io,bufsz)) { + /* Need more buffer */ + SET_PUBLIC(io,line_start) + = reallocate(GET_PUBLIC(io,line_start), + SET_STATE(io,bufsz) += BUFSIZ); + } + /* Position to end of current line */ + bufp = GET_PUBLIC(io,line_start) + GET_STATE(io,linelen); + /* Read some more at that position */ + if (NULL == fgets(bufp,(int)(GET_STATE(io,bufsz) - + GET_STATE(io,linelen)),GET_STATE(io,input))) { + /* EOF (or possibly read error). */ + if (ferror(GET_STATE(io,input))) { + bail(GRIPE_CANT_READ_INPUT,"Read error on file %s", + GET_PUBLIC(io,filename)); + } + break; + } + /* Update length of line */ + SET_STATE(io,linelen) += read = strlen(bufp); + bufp += read; + if (bufp[-1] == '\n') { + /* End of line. That's all */ + SET_PUBLIC(io,line_end) = bufp; + break; + } + } + return read != 0; +} + +/*! Try to read another line of input from the current source file + to extend the current line when a line-continuation is found or + when a newline is read within a C-comment. + \return \em true iff another line is read. + */ +static bool +extend_line(void) +{ + bool eof = !readon(); + if (!eof) { + ++SET_PUBLIC(io,line_num); + return true; + } + if (GET_STATE(io,linelen) > 0) { + parse_error(GRIPE_MISSING_EOF_NEWLINE, + "Missing newline at EOF"); + } + return false; +} + + +/*! Generate a temporary filename for an output file + that will replace its input file +*/ +static void +make_tempfile(void) +{ + char *out_name_buf = GET_STATE(io,out_name_buf); + const char *infile = GET_PUBLIC(io,filename); + const char *delim = strrchr(infile,PATH_DELIM); + char const *tempname = NULL; + size_t dirlen = delim ? delim - infile : 0; + if (out_name_buf == NULL) { + out_name_buf = SET_STATE(io,out_name_buf) = + allocate(PATH_MAX); + } + if (dirlen) { + strncpy(out_name_buf,infile,dirlen); + out_name_buf[dirlen++] = PATH_DELIM; + } + strcpy(out_name_buf + dirlen,"sunifdef_out_XXXXXX"); + tempname = fs_tempname(out_name_buf); + if (!tempname) { + bail(GRIPE_NO_TEMPFILE, + "Cannot create temporary file"); + } +} + +static void +replace_infile(void) +{ + if (rename(GET_STATE(io,out_name_buf), + GET_PUBLIC(io,filename))) { + bail(GRIPE_CANT_RENAME_FILE, + "Cannot rename file \"%s\" as \"%s\"", + GET_STATE(io,out_name_buf), + GET_PUBLIC(io,filename)); + } +} + +static void +make_backup_name(const char *filename) +{ + FILE *exists = NULL; + size_t suffix_len = strlen(GET_PUBLIC(args,backup_suffix)); + size_t namelen = strlen(filename) + suffix_len; + if (GET_STATE(io,bak_name_buf) == NULL) { + SET_STATE(io,bak_name_buf) = allocate(PATH_MAX + 1); + } + strncpy(GET_STATE(io,bak_name_buf), + GET_PUBLIC(io,filename),PATH_MAX)[PATH_MAX] = 0; + do { + if (namelen > PATH_MAX) { + bail(GRIPE_FILENAME_TOO_LONG, + "A filename exceeds max %d bytes: \"%s...", + PATH_MAX,GET_STATE(io,bak_name_buf)); + } + strcat(GET_STATE(io,bak_name_buf), + GET_PUBLIC(args,backup_suffix)); + exists = fopen(GET_STATE(io,bak_name_buf),"r"); + if (!exists) { + break; + } + fclose(exists); + namelen += suffix_len; + } while(true); +} + +static void +backup_infile(void) +{ + make_backup_name(GET_PUBLIC(io,filename)); + if (rename(GET_PUBLIC(io,filename), + GET_STATE(io,bak_name_buf))) { + bail(GRIPE_CANT_RENAME_FILE, + "Cannot rename file \"%s\" as \"%s\"", + GET_PUBLIC(io,filename), + GET_STATE(io,bak_name_buf)); + } +} + + +static void +open_output(void) +{ + if (!GET_PUBLIC(args,replace)) { + SET_PUBLIC(io,output) = stdout; + } + else { + make_tempfile(); + SET_PUBLIC(io,output) = + open_file(GET_STATE(io,out_name_buf),"w"); + } +} + +/* API ***************************************************************/ + +FILE * open_file(const char *file, const char *mode) +{ + FILE * stream = fopen(file, mode); + if (stream == NULL) { + bail(GRIPE_CANT_OPEN_INPUT,"Can't open %s for %s", + file, (mode[0] == 'r' ? "reading": "writing")); + } + return stream; +} + +void +close_io(int error) +{ + if (GET_STATE(io,input) != NULL) { + ++SET_PUBLIC(dataset,donefiles); + if (error) { + ++SET_PUBLIC(dataset,errorfiles); + } + if (GET_STATE(io,input) != stdin) { + + fclose(GET_STATE(io,input)); + SET_STATE(io,input) = NULL; + + if (GET_PUBLIC(io,output) != stdout && + GET_PUBLIC(io,output) != NULL) { + fclose(GET_PUBLIC(io,output)); + SET_PUBLIC(io,output) = NULL; + } + if (!error && GET_PUBLIC(args,replace)) { + if (GET_PUBLIC(args,backup_suffix) != NULL) { + backup_infile(); + } + else { + delete_infile(); + } + replace_infile(); + } + } + io_toplevel(); + } +} + + +void +open_io(char const *filename) +{ + SET_PUBLIC(io,filename) = filename; + if (!strcmp(GET_PUBLIC(io,filename),STDIN_NAME)) { + SET_STATE(io,input) = stdin; + } + else { + SET_STATE(io,input) = + open_file(GET_PUBLIC(io,filename),"r"); + SET_PUBLIC(io,line_num) = 0; + } + open_output(); +} + +bool get_line(void) +{ + SET_STATE(io,linelen) = 0; + SET_PUBLIC(io,extension_lines) = 0; + return extend_line(); +} + +char * +read_more(char const *readpos) +{ + save_read_pos(readpos); + if (extend_line()) { + return saved_read_pos(); + } + early_eof(); + return NULL; +} + +size_t +read_offset(char const *readpos) +{ + char *linestart = GET_PUBLIC(io,line_start); + assert(readpos > linestart); + return readpos - linestart; +} + +char * +read_pos(size_t readoff) +{ + return GET_PUBLIC(io,line_start) + readoff; +} + + +void +ensure_buf(size_t extra) +{ + size_t spare = GET_STATE(io,bufsz) - GET_STATE(io,linelen); + int i; + for ( i = 0; spare <= extra; ++i) { + SET_STATE(io,bufsz) += BUFSIZ; + spare = GET_STATE(io,bufsz) - GET_STATE(io,linelen); + } + if (i) { + SET_PUBLIC(io,line_start) + = reallocate(GET_PUBLIC(io,line_start), + GET_STATE(io,bufsz)); + } +} + +bool +input_opened(void) +{ + return !!GET_STATE(io,input); +} + +bool +input_eof(void) +{ + return feof(GET_STATE(io,input)); +} + +void +save_read_pos(char const *cp) +{ + SET_STATE(io,saved_read_pos) = cp - GET_PUBLIC(io,line_start); +} + +char * +saved_read_pos(void) +{ + return GET_PUBLIC(io,line_start) + GET_STATE(io,saved_read_pos); +} + +void +io_toplevel(void) +{ + SET_PUBLIC(io,line_num) = 0; + SET_PUBLIC(io,filename) = NULL; +} + + +/* EOF */ diff --git a/src/io.h b/src/io.h new file mode 100755 index 0000000..9173f0e --- /dev/null +++ b/src/io.h @@ -0,0 +1,199 @@ +#ifndef IO_H +#define IO_H + +/*************************************************************************** + * Copyright (C) 2004, 2006 Symbian Software Ltd. * + * All rights reserved. * + * Copyright (C) 2007, 2008 Mike Kinghan, imk@strudl.org * + * All rights reserved. * + * * + * Contributed originally by Mike Kinghan, imk@strudl.org * + * * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * Redistributions of source code must retain the above copyright * + * notice, this list of conditions and the following disclaimer. * + * * + * Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * * + * Neither the name of Symbian Software Ltd. nor the names of its * + * contributors may be used to endorse or promote products derived from * + * this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,* + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * + * DAMAGE. * + * * + ***************************************************************************/ +#include "opts.h" +#include + +/*! \ingroup io_module io_interface + * \file io.h + * This file provides the I/O module interface + */ + +/*! \addtogroup io_interface */ +/*@{*/ +/*! Nominal filename for the standard input stream */ +#define STDIN_NAME "[stdin]" + +/*! Read the name of a source file from \c stdin. + * Filenames may contain spaces if quoted. + * \return A pointer to the source filename in static storage, + * if a valid filename is read; NULL if no filename is read. + */ +extern +char * read_filename(void); + +/*! Open a named file for reading or writing + * \param file The name of the file to be opened + * \param mode The read or write mode in which to open the file, + * \c "r" or \c "w". + * \return Stream to opened file on success, else NULL. + */ +extern +FILE * open_file(const char *file, const char *mode); + +/*! Open an input file and the appropriate + * output file. + + \param filename The name of the input file to open. + An empty string, "", denotes the standard input + */ +extern void +open_io(char const *filename); + +/*! Finalise the current pairing of source input and processed output, + * if any. + + \param error 0 if no errors were raised in processing the + input file that is to be closed, else the issue code + of the error that aborted processing. + + * If a file is associated with either of these streams, it is closed. + * The output file replaces the input file, if \c error == 0 and the \c --replace + * option is in force, and is also backed up beforehand, if the \c --backup + * option is in force. If the function is called before any input has been + * opened it is a NOOP. + */ +extern void +close_io(int error); + +/*! Close the current source file. */ +extern void +close_input(void); + +/*! Try to read a line of input from the current source file. + * \return \em true iff a line is read. + */ +extern bool +get_line(void); + +/*! Read another line of input from the current source file + to extend the current line when a line-continuation is found or + when a newline is read within a C-comment. + + \param readpos The current text pointer in the line buffer. + \return The restored text pointer, which + will differ from \em readpos if the line buffer has been + reallocated. + + The function assumes that more input is available. If not an + unexpected eof error is raised. + + */ +extern char * +read_more(char const *readpos); + +/*! Is the current source file open? + */ +extern bool +input_opened(void); + +/*! Is the current source file at end-of-file? + */ +extern bool +input_eof(void); + +/*! Ensure additional capacity in the input line-buffer. + * \param extra The number of additional bytes to ensure. + * The function will extend the line buffer as necessary to + * ensure that \em extra bytes are available. + */ +extern void +ensure_buf(size_t extra); + +/*! Save the current line buffer position. + * + * \param cp The current line buffer position. + * + * The position is saved as an offset into the line buffer + * so that the correct position can be recovered is the + * line buffer is moved. + */ +extern void +save_read_pos(char const *cp); + +/*! Get the last saved line buffer position. + * + * \returns cp A ptr to the line buffer position + * last saved by save_read_pos() + * + * The returned position equates to the last position saved + * even if the line buffer has moved in the interim. + */ +extern char * +saved_read_pos(void); + +/*! Reset the input filename to NULL and line number to 0 */ +extern void +io_toplevel(void); + +/*! Get the offset of an address in the input line buffer */ +extern size_t +read_offset(char const *readpos); + +/*! Get the address of an ofset into the input line buffer */ +extern char * +read_pos(size_t readoff); + + +/*@}*/ + +/*!\ingroup io_interface_state_utils */ +/*@(*/ + +/*! * The public state of the I/O module.*/ +PUBLIC_STATE_DEF(io) { + int line_num; /*!< The current source line number */ + const char *filename; /*!< The name of the current source file */ + char *line_start; /*!< The start of the current source line in memory */ + char *line_end; /*!< The end of the current source line in memory */ + FILE * output; /*!< The output stream */ + int extension_lines; /*!< Number of linefeeds embedded in the current + extended line */ +} PUBLIC_STATE_T(io); + +/*@}*/ + +/*!\addtogroup io_interface_state_utils */ +/*@(*/ +IMPORT(io); +/*@}*/ + + +#endif /* EOF */ diff --git a/src/line_despatch.c b/src/line_despatch.c new file mode 100755 index 0000000..14b3c1b --- /dev/null +++ b/src/line_despatch.c @@ -0,0 +1,285 @@ +/*************************************************************************** + * Copyright (C) 2004, 2006 Symbian Software Ltd. * + * All rights reserved. + * Copyright (C) 2002, 2003 Tony Finch . * + * All rights reserved. * + * Copyright (C) 1985, 1993 The Regents of the University of California. * + * All rights reserved. * + * Copyright (C) 2007, 2008 Mike Kinghan, imk@strudl.org * + * All rights reserved. * + * * + * Contributed by Mike Kinghan, imk@strudl.org, derived from the code * + * of Tony Finch * + * * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * Redistributions of source code must retain the above copyright * + * notice, this list of conditions and the following disclaimer. * + * * + * Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * * + * Neither the name of Symbian Software Ltd. nor the names of its * + * contributors may be used to endorse or promote products derived from * + * this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,* + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * + * DAMAGE. * + * * + ***************************************************************************/ + +#include "line_despatch.h" +#include "report.h" +#include "args.h" +#include "line_edit.h" +#include "io.h" +#include "opts.h" +#include "bool.h" +#include +#include + +/*!\ingroup line_despatch_internals line_despatch_interface + * \file line_despatch.c + * This file implements the Line Despatch module + */ + +/*!\addtogroup line_despatch_internals */ +/*@{*/ + +/* Helpers ***********************************************************/ + + +/*! Print an unmodified line to output with no complications + */ +static void +printline_fast(void) +{ + fputs(GET_PUBLIC(io,line_start),GET_PUBLIC(io,output)); +} + +/*! Print a line to output deleting chunks marked for + * unconditional deletion. + */ +static void +printline_cut(void) +{ + char *leader = GET_PUBLIC(io,line_start); + char *follower = leader; + int concat_risk = 0; + for ( ;*leader; leader += (*leader != 0)) { + for ( ;!DELETEABLE(*leader); ++leader) {}; + if (fwrite(follower,1,leader - follower,GET_PUBLIC(io,output)) != + leader - follower) { + bail(GRIPE_CANT_WRITE_FILE,"Write error on output\n"); + } + + follower = leader; + concat_risk = !isspace(follower[-1]); + for ( ;*leader && DELETEABLE(*leader); ++leader) {}; + concat_risk += (*leader && !isspace(*leader)); + if (concat_risk == 2) { + fputc(' ',GET_PUBLIC(io,output)); + } + follower = leader; + } + if (*follower) { + fputc(*follower,GET_PUBLIC(io,output)); + } +} + +/*! Print an output line that may contain superfluous + * parentheses marked for deletion, but no other parts + * marked for deletion. + * + * In this case we have not materially simplified the line and just restore + * the parentheses before printing the line. + */ +static void +printline_restore_paren(void) +{ + restore_paren(); + printline_fast(); +} + +/*! Print an output line containing chunks marked for + * deletion. + * + * We will delete all these chunks only if and only if some of them + * represent truth-functional simplifications of the line. + * Otherwise the only logical deletions will represent superfluous parentheses. + * We will then restore those parentheses before printing the line. + */ +static void +printline_slow(void) +{ + if (GET_PUBLIC(line_edit,simplification_state) & OPS_CUT) { + ++SET_PUBLIC(line_despatch,lines_changed); + printline_cut(); + } + else { + printline_restore_paren(); + } +} + +/*! Print a line to output from the line-buffer. + * + * The function selects a more specialised helper function to which + * it delegates. + */ +static void +printline(void) +{ + if (GET_PUBLIC(line_edit,simplification_state) == UNSIMPLIFIED) { + printline_fast(); + } + else { + printline_slow(); + } +} + +/*! No-op implementation of flushline() selected when the \c --symbols option + * in force + */ +static void +flushline_dummy(bool keep,const char *insert_text){} + + +/*! Write a line to the output or drop it, according to command line options. + * + * \param keep Is the line to be kept of dropped? + * \param insert_text Either \c NULL or a pointer to a null-terminated + * diagnostic that is to be written instead of + * the line-buffer. + * + * If \c insert_text is non-null then this string is output. + * + * Otherwise is \c keep is true then the line-buffer is output unless + * the \c --complement option is in force. + * + * If \c keep is false, or is true together with \c --complement, + * the line buffer is dropped. If the \c --blank is not in force then + * nothing is written to putput. Otherwise an empty line is written to + * output. + */ + +static void +flushline_live(bool keep, char const *insert_text) +{ + int extension_lines = GET_PUBLIC(io,extension_lines); + if (insert_text) { + /* Replacing a contradictory input line with a + * diagnostic comment or #error */ + fputs(insert_text,GET_PUBLIC(io,output)); + ++SET_PUBLIC(line_despatch,lines_changed); + return; + } + if (keep ^ GET_PUBLIC(args,complement)) { + printline(); + } + else { + discard_policy_t discard_policy = GET_PUBLIC(args,discard_policy); + if (discard_policy == DISCARD_BLANK) { + ++SET_PUBLIC(line_despatch,lines_changed); + putc('\n', GET_PUBLIC(io,output)); + for ( ;extension_lines; --extension_lines) { + putc('\n', GET_PUBLIC(io,output)); + } + } + else if (discard_policy == DISCARD_DROP) { + SET_PUBLIC(line_despatch,lines_dropped) += extension_lines; + ++SET_PUBLIC(line_despatch,lines_dropped); + } + else { + fputs("//sunifdef < ",GET_PUBLIC(io,output)); + ++SET_PUBLIC(line_despatch,lines_changed); + printline_fast(); + } + } +} + +/*@}*/ + +/*!\ingroup line_despatch_internals_state_utils */ +/*@{*/ + +/*! The global state of the Line Despatch module */ +STATE_DEF(line_despatch) { + /*! The public state of the Line Despatch module */ + INCLUDE_PUBLIC(line_despatch); + /*! Pointer to the function that will be called to flush the + * the line-buffer to output. Will address flushline_dummy() + * (a no-op) when the \c --symbols option is specified, and + * otherwise \c flushline_line(). + */ + void (*flushline)(bool,const char *); + /*! Count of contiguous lines that are dropped together */ + size_t drop_run; +} STATE_T(line_despatch); + +/*@}*/ + +/*!\addtogroup line_despatch_internals_state_utils */ +/*@{*/ + +IMPLEMENT(line_despatch,STATIC_INITABLE); + +USE_STATIC_INITIALISER(line_despatch) = { { 0, 0 }, flushline_live, false }; +/*@}*/ + +/* API ***************************************************************/ + +void +line_despatch_no_op(void) +{ + SET_STATE(line_despatch,flushline) = flushline_dummy; +} + +void +print(void) +{ + if (GET_PUBLIC(args,line_directives)) { + if (GET_STATE(line_despatch,drop_run)) { + int line_num = GET_PUBLIC(io,line_num); + size_t extension_lines = GET_PUBLIC(io,extension_lines); + if (extension_lines) { + --line_num; + } + printf("#line %d\n",line_num); + --SET_PUBLIC(line_despatch,lines_dropped); + ++SET_PUBLIC(line_despatch,lines_changed); + } + SET_STATE(line_despatch,drop_run) = 0; + } + GET_STATE(line_despatch,flushline)(true,NULL); + +} + +void +drop(void) +{ + GET_STATE(line_despatch,flushline)(false,NULL); + if (GET_PUBLIC(args,line_directives)) { + ++SET_STATE(line_despatch,drop_run); + } +} + +void +substitute(const char *replacement) +{ + GET_STATE(line_despatch,flushline)(false,replacement); +} + +/* EOF */ diff --git a/src/line_despatch.h b/src/line_despatch.h new file mode 100755 index 0000000..dbbd422 --- /dev/null +++ b/src/line_despatch.h @@ -0,0 +1,104 @@ +#ifndef LINE_DESPATCH_H +#define LINE_DESPATCH_H + +/*************************************************************************** + * Copyright (C) 2004, 2006 Symbian Software Ltd. * + * All rights reserved. * + * Copyright (C) 2002, 2003 Tony Finch . * + * All rights reserved. * + * Copyright (C) 1985, 1993 The Regents of the University of California. * + * All rights reserved. * + * Copyright (C) 2007, 2008 Mike Kinghan, imk@strudl.org * + * All rights reserved. * + * * + * Contributed by Mike Kinghan, imk@strudl.org, derived from the code * + * of Tony Finch * + * * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * Redistributions of source code must retain the above copyright * + * notice, this list of conditions and the following disclaimer. * + * * + * Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * * + * Neither the name of Symbian Software Ltd. nor the names of its * + * contributors may be used to endorse or promote products derived from * + * this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,* + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * + * DAMAGE. * + * * + ***************************************************************************/ + +#include "opts.h" + +/*!\ingroup line_despatch_module, line_despatch_interface + *\file line_despatch.h + * This file provides the Line Despatch module interface + */ + +/*! \addtogroup line_despatch_interface */ +/*@{*/ + +/*! Print the line-buffer to output */ +extern void +print(void); + +/*! Drop the line-buffer from output */ +extern void +drop(void); + +/*! Substitute a diagnostic insert for the line in the line-buffer + * and print it to output. + * \param replacement The diagnostic insert to print. + * + * Depending on the policy selected by the specified or default value of + * the \c --conflict option, a \c #define or \c #undef directive read from + * input that contradicts one of the \c --define or \c --undefine options + * may be replaced on output with a diagnostic comment or a diagnostic + * \c #error directive. + */ +extern void +substitute(const char *replacement); + +/*! Config the print() and drop() functions to be no-ops + * when the \c --symbols option is specified, as they are then + * redundant. + */ +extern void +line_despatch_no_op(void); + +/*@}*/ + +/*! \ingroup line_despatch_interface_state_utils */ +/*@{*/ + +/*! The public state of the Line Despatch module */ +PUBLIC_STATE_DEF(line_despatch) { + int lines_dropped; /*!< Number of input lines dropped */ + int lines_changed; /*!< Number of input lines changed */ +} PUBLIC_STATE_T(line_despatch); +/*@}*/ + +/*! \addtogroup line_despatch_interface_state_utils */ +/*@{*/ +IMPORT(line_despatch); +/*@}*/ + + +#endif /* EOF */ + diff --git a/src/line_edit.c b/src/line_edit.c new file mode 100755 index 0000000..b5a9f42 --- /dev/null +++ b/src/line_edit.c @@ -0,0 +1,170 @@ +/*************************************************************************** + * Copyright (C) 2004, 2006 Symbian Software Ltd. * + * All rights reserved. * + * Copyright (C) 2007, 2008 Mike Kinghan, imk@strudl.org * + * All rights reserved. * + * * + * Contributed originally by Mike Kinghan, imk@strudl.org * + * * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * Redistributions of source code must retain the above copyright * + * notice, this list of conditions and the following disclaimer. * + * * + * Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * * + * Neither the name of Symbian Software Ltd. nor the names of its * + * contributors may be used to endorse or promote products derived from * + * this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,* + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * + * DAMAGE. * + * * + ***************************************************************************/ +#include "line_edit.h" +#include "io.h" +#include "report.h" +#include "line_despatch.h" +#include "symbol_table.h" +#include + +/*!\ingroup line_edit_module, line_edit_interface, line_edit_internals + *\file line_edit.c + * This file implements the Line Edit module + */ + +/*! \addtogroup line_edit_internals */ +/*@{*/ + + +/*! Macro function that marks a character block as logically deleted in the + * course of simplifying a directive, by setting all chars with a deletion + * placeholder + * \param start The start of the text to be deleted. + * \param end Just past the text to be deleted. + */ +#define DELETE_CHARS(start,end) memset(start,DELETEABLE_CHR,end - start) + + +/*! Replace text at the end of the line-buffer + * \param where The start of the terminal segment of the line-buffer + * to replace + * \param what The start of the null-terminated string to replace + * the terminal segement at \c where. + * + * The function does the editing work for \c keywordedit(). It ensures + * that there is sufficient capacity in the line-buffer to contain the + * replacement, extending the buffer if necessary. + * + */ +static void +tail_edit(char *where, const char *what) +{ + assert(GET_PUBLIC(io,line_start) <= where && + where < GET_PUBLIC(io,line_end)); + ensure_buf(strlen(what)); + strcpy(where,what); +} + +/*@}*/ + +/* API *********************************************************************/ + +void +keywordedit(const char *replacement) +{ + tail_edit(GET_PUBLIC(line_edit,keyword),replacement); + ++SET_PUBLIC(line_despatch,lines_changed); + print(); +} + + +void +delete_paren(char *lparen, char *rparen) +{ +#if 0 + if (*lparen == '(' && *rparen == ')' ) { + if ((lparen[-1] == ' ' || + lparen[-1] == '(' || + lparen[1] == ' ' || + lparen[1] == '(' ) + && + (rparen[-1] == ' ' || + rparen[-1] == ')' || + rparen[1] == ' ' || + rparen[1] == ')' || + rparen[1] == '\n')) + + { + *lparen = DELETEABLE_LPAREN; + *rparen = DELETEABLE_RPAREN; + SET_PUBLIC(line_edit,simplification_state) |= BRACKETS_PRUNED; + } + } +#endif + if (*lparen == '(' && *rparen == ')' ) { + if ((!symchar(lparen[-1]) || !symchar(lparen[1])) + && + (!symchar(rparen[-1]) || !symchar(rparen[1]))) + { + *lparen = DELETEABLE_LPAREN; + *rparen = DELETEABLE_RPAREN; + SET_PUBLIC(line_edit,simplification_state) |= BRACKETS_PRUNED; + } + } + +} + +void +restore_paren(void) +{ + char *buf = GET_PUBLIC(io,line_start); + for ( ;*buf; ++buf) { + if (*buf == DELETEABLE_LPAREN) { + *buf = '('; + } + else if (*buf == DELETEABLE_RPAREN) { + *buf = ')'; + } + }; +} + +void +cut_text(char *start, char *end) +{ + /* Set up for printing a line with deleted chunks */ + SET_PUBLIC(line_edit,simplification_state) |= OPS_CUT; + DELETE_CHARS(start,end); + /* Never delete the terminal newline in directive */ + if (!*end) { + end[-1] = '\n'; + } +} + +/*!\ingroup line_edit_internals_state_utils */ +/*@{*/ +/*! The Line Edit module has no private state */ +NO_PRIVATE_STATE(line_edit); +/*@}*/ + +/*!\addtogroup line_edit_internals_state_utils */ +/*@{*/ +IMPLEMENT(line_edit,ZERO_INITABLE); +/*@}*/ + + +/* EOF */ diff --git a/src/line_edit.h b/src/line_edit.h new file mode 100755 index 0000000..dd78125 --- /dev/null +++ b/src/line_edit.h @@ -0,0 +1,166 @@ +#ifndef LINE_EDIT_H +#define LINE_EDIT_H + +/*************************************************************************** + * Copyright (C) 2004, 2006 Symbian Software Ltd. * + * All rights reserved. * + * Copyright (C) 2007, 2008 Mike Kinghan, imk@strudl.org * + * All rights reserved. * + * * + * Contributed originally by Mike Kinghan, imk@strudl.org * + * * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * Redistributions of source code must retain the above copyright * + * notice, this list of conditions and the following disclaimer. * + * * + * Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * * + * Neither the name of Symbian Software Ltd. nor the names of its * + * contributors may be used to endorse or promote products derived from * + * this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,* + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * + * DAMAGE. * + * * + ***************************************************************************/ + +#include "opts.h" + +/*!\ingroup line_edit_module, line_edit_interface + *\file line_edit.h + * This file provides the Line Edit module interface + */ + +/*! \addtogroup line_edit_interface */ +/*@{*/ + +/*! This character is provisionally inserted in the line + buffer to mark it for eventual deletion +*/ +#define DELETEABLE_CHR ((char)001) +/*! This character is provisionally inserted in the line + buffer in place of a '(' that will eventually be + deleted if the line is significantly simplified. +*/ +#define DELETEABLE_LPAREN ((char)002) +/*! This character is provisionally inserted in the line + buffer in place of a ')' that will eventually be + deleted if the line is significantly simplified. +*/ +#define DELETEABLE_RPAREN ((char)003) +/*! Macro function to decide if a character in the line-buffer is deleteable + * \param ch The character to test. + * \return Non-zero if the character may be deleted. + */ +#define DELETEABLE(ch) ((ch) < 4) + +/*! Enumeration of the possible simplification states of an + * #i-directive in the line-buffer + */ +typedef enum { + UNSIMPLIFIED, /*!< The directive has not been simplified */ + BRACKETS_PRUNED, /*!< Superfluous brackets have been deleted */ + OPS_CUT /*!< Operators and operands have been deleted through + truth-functional simplification */ +} simplification_state_t; + + +/*! Replace the keyword of the current directive with another + * to rectify the CPP syntax for dropped lines, then output + * the edited directive. + * + * \param replacement The keyword with which to replace the current + * keyword. + */ +extern void +keywordedit(const char *replacement); + +/*! Logically delete a pair of redundant parentheses from a + * #-directive in the line-buffer. + * \param lparen Pointer to the '(' + * \param rparen Poiunter to the ')' + * + * Logical deletion is done by inserting \c DELETEABLE_LPAREN + * in the line-buffer in place of the '(' and \c DELETEABLE_RPAREN + * in place of the ')'. + * + * If evaluation of the directive results in material simplification + * (i.e. results in deletions other than deletions of redundant parentheses), + * then the logically deleted parentheses will be physically deleted when + * evaluation is complete. + * + * If evaluation of the directive results in no materal simplification + * then the logically deleted parentheses will finally be restored + * by restore_paren(); + * + * The function updates the module state with \c BRACKETS_PRUNED + */ +void +delete_paren(char *lparen, char *rparen); + +/*! Restore logically deleted parentheses to the #-directive in the + * line buffer when we cannot materially simplify it. + * + * This is done on the principle that if we cannot materially simplify + * the directive then wev will leave it alone. + * + * The function does not bother to retract \c BRACKETS_PRUNED from the module + * state, because this is superflous whenever the the function is called. + */ +void +restore_paren(void); + +/*! Logically delete part of a #-directive in the line buffer. + * \param start The start of the text to delete + * \param end The address just past the text to delete. + * + * The logical deletion is done by filling the line-buffer from \c start + * to \c end with \c DELETEABLE_CHR. Logical deletion is efficient because + * it avoids shuffling down terminal segments of the buffer in the course + * of evaluation, when the effect of such editing may be obliterated by + * subsequent deletions. Physical deletion is performed only once at the + * end of evaluation, by removing all logically deleted portions of the + * line-buffer. + * + * The function is only called to delete a truth-functionally redundant + * operator and one of its operands, so it updates the module state with + * \c OPS_CUT + */ +void +cut_text(char *start, char *end); + +/*@}*/ + +/*! \ingroup line_edit_interface_state_utils */ +/*@{*/ + +/*! The public state of the Line Edit module */ +PUBLIC_STATE_DEF(line_edit) { + char* keyword; /*!< Pointer to keyword of the current directive */ + int simplification_state; + /*!< The simplification state of the current directive */ +} PUBLIC_STATE_T(line_edit); +/*@}*/ + +/*! \addtogroup line_edit_interface_state_utils */ +/*@{*/ +IMPORT(line_edit); +/*@}*/ + + +#endif /* EOF */ diff --git a/src/main.c b/src/main.c new file mode 100755 index 0000000..f78e4d1 --- /dev/null +++ b/src/main.c @@ -0,0 +1,188 @@ +/*************************************************************************** + * Copyright (C) 2004, 2006 Symbian Software Ltd. * + * All rights reserved. * + * Copyright (C) 2007, 2008 Mike Kinghan, imk@strudl.org * + * All rights reserved. * + * * + * Contributed originally by Mike Kinghan, imk@strudl.org * + * * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * Redistributions of source code must retain the above copyright * + * notice, this list of conditions and the following disclaimer. * + * * + * Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * * + * Neither the name of Symbian Software Ltd. nor the names of its * + * contributors may be used to endorse or promote products derived from * + * this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,* + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * + * DAMAGE. * + * * + ***************************************************************************/ + +#include "report.h" +#include "evaluator.h" +#include "categorical.h" +#include "line_despatch.h" +#include "if_control.h" +#include "args.h" +#include "symbol_table.h" +#include "io.h" +#include "chew.h" +#include "line_edit.h" +#include "platform.h" +#include "exception.h" +#include "dataset.h" + +/*! \ingroup main_module + * \file main.c + * This file implments the Sunifdef program + */ + +/*! \addtogroup main_module */ +/*@{*/ + +/*! Perform all module initialisations */ +static void ready(void); + +/*! Execute a sunifdef process */ +static void process(void); + +/*! The main program. */ +int +main(int argc, char *argv[]) +{ + ready(); + atexit(exit_diagnostics); + parse_executable(argv); + parse_args(argc,argv); + finish_args(); + process(); + give_up_confused(); /* bug */ + return 0; +} + +static void +line_debug(int line) +{ + if (line < 0) { + /* Call with negative value to write line numbers */ + printf("%d\n",GET_PUBLIC(io,line_num)); + } + else if (line > 0 && line == GET_PUBLIC(io,line_num)) { + /* Call with positive line number and put breakpoint here ... */ + fputs("Here",stderr); + } +} + +/*! Initialise all module states */ +static void +ready(void) +{ + INITIALISE(chew); + INITIALISE(diagnostic); + INITIALISE(evaluator); + INITIALISE(if_control); + INITIALISE(io); + INITIALISE(dataset); + INITIALISE(line_edit); + INITIALISE(args); + INITIALISE(symbol_table); + INITIALISE(line_despatch); + INITIALISE(categorical); +} + +/*! The \c file_tree_callback_t that is + iterated over the input file tree. +*/ +static void +node_proc( file_tree_h file_tree, + char const *name, + file_tree_traverse_state_t context) +{ + static int error; + switch(context) { + case FT_AT_FILE: + processing_file(name); + open_io(name); + if_control_toplevel(); + chew_toplevel(); + exceptions_enabled = GET_PUBLIC(args,keepgoing); + error = catch(); + for (;!error && !input_eof();) { + line_type_t lineval; + line_debug(0); + lineval = eval_line(); + if (!weed_categorical_directive(lineval)) { + transition(lineval); + } + debug(DBG_19,lineval); + } + if (if_depth() && !error && input_eof()) { + early_eof(); + } + exceptions_enabled = false; + close_io(false); + break; + case FT_ENTERING_DIR: + { + file_tree_count_t count; + file_tree_count(file_tree,FT_COUNT_CHILDREN | FT_COUNT_ALL,&count); + /* Don't report entry to a directory if it is merely + the parent of another */ + if (count.dirs != 1 || count.files != 0) { + entering_dir(name); + } + } + break; + case FT_LEAVING_DIR: + { + file_tree_count_t count; + file_tree_count(file_tree,FT_COUNT_CHILDREN | FT_COUNT_ALL,&count); + /* Don't report leaving a directory if it is merely + the parent of another */ + if (count.dirs != 1 || count.files != 0) { + leaving_dir(name); + } + } + break; + case FT_ENTERING_TREE: + if (file_tree_is_empty(file_tree)) { + node_proc(file_tree,STDIN_NAME,FT_AT_FILE); + } + break; + case FT_LEAVING_TREE: + io_toplevel(); + break; + default: + assert(false); + } +} + +static void +process(void) +{ + file_tree_h tree = GET_PUBLIC(dataset,file_tree); + file_tree_traverse(tree,node_proc); + exit(exitcode()); +} + +/*@}*/ + +/* EOF */ diff --git a/src/memory.c b/src/memory.c new file mode 100755 index 0000000..ddd01f8 --- /dev/null +++ b/src/memory.c @@ -0,0 +1,96 @@ +/*************************************************************************** + * Copyright (C) 2004, 2006 Symbian Software Ltd. * + * All rights reserved. * + * Copyright (C) 2007, 2008 Mike Kinghan, imk@strudl.org * + * All rights reserved. * + * * + * Contributed originally by Mike Kinghan, imk@strudl.org * + * * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * Redistributions of source code must retain the above copyright * + * notice, this list of conditions and the following disclaimer. * + * * + * Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * * + * Neither the name of Symbian Software Ltd. nor the names of its * + * contributors may be used to endorse or promote products derived from * + * this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,* + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * + * DAMAGE. * + * * + ***************************************************************************/ +#include "report.h" +#include "memory.h" +#include "ptr_vector.h" + +/*! \ingroup memory_interface, memory_internals + * \file memory.c + * This file implements the Memory module. + */ + +/* Helpers ***********************************************************/ + +/*! \addtogroup memory_internals */ +/*@{*/ + +/*! Terminate the program with an out of memory diagnositic + * if a putative heap pointer is null. + * + * \param ptr Pointer to test. + * \return \c ptr, provided it is not null. + */ +static void * +no_alloc_fail(void *ptr) +{ + if (!ptr) { + bail(GRIPE_OUT_OF_MEMORY,"Out of memory"); + } + return ptr; +} +/*@}*/ + +/* API ***************************************************************/ + +void * +allocate(size_t bytes) +{ + return no_alloc_fail(calloc(bytes,1)); +} + +void * +reallocate(void *ptr, size_t bytes) +{ + return no_alloc_fail(realloc(ptr,bytes)); +} + +void * +callocate(size_t items, size_t size) +{ + return no_alloc_fail(calloc(items,size)); +} + +void release(void **pp) +{ + if (*pp) { + free(*pp); + *pp = NULL; + } +} + +/* EOF */ diff --git a/src/memory.h b/src/memory.h new file mode 100755 index 0000000..9f9c063 --- /dev/null +++ b/src/memory.h @@ -0,0 +1,79 @@ +#ifndef MEMORY_H +#define MEMORY_H +/*************************************************************************** + * Copyright (C) 2004, 2006 Symbian Software Ltd. * + * All rights reserved. * + * Copyright (C) 2007, 2008 Mike Kinghan, imk@strudl.org * + * All rights reserved. * + * * + * Contributed originally by Mike Kinghan, imk@strudl.org * + * * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * Redistributions of source code must retain the above copyright * + * notice, this list of conditions and the following disclaimer. * + * * + * Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * * + * Neither the name of Symbian Software Ltd. nor the names of its * + * contributors may be used to endorse or promote products derived from * + * this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,* + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * + * DAMAGE. * + * * + ***************************************************************************/ + +#include "opts.h" +#include +#include + +/*!\ingroup memory_module, memory_interface + *\file memory.h + * This file provides the Memory module interface + */ + +/*! \addtogroup memory_interface */ +/*@{*/ + +/*! Type to represent strings allocated on the heap */ +typedef char * heap_str; + +/*! \c malloc() wrapper; bails on failure */ +extern void * +allocate(size_t bytes); + +/*! \c realloc() wrapper; bails on failure */ +extern void * +reallocate(void *ptr, size_t bytes); + +/*! \c calloc() wrapper; bails on failure */ +extern void * +callocate(size_t items, size_t size); + +/*! Safely free a pointer. + \param pp Address of the pointer to be freed + + If \e *pp is NULL nothing is done. Otherwise \e *pp + is freed and set = NULL. +*/ +extern void +release(void **pp); + +/*@}*/ + +#endif /* EOF */ diff --git a/src/opts.h b/src/opts.h new file mode 100755 index 0000000..6c02790 --- /dev/null +++ b/src/opts.h @@ -0,0 +1,55 @@ +#ifndef OPTS_H +#define OPTS_H + +/*************************************************************************** + * Copyright (C) 2004, 2006 Symbian Software Ltd. * + * All rights reserved. * + * Copyright (C) 2007, 2008 Mike Kinghan, imk@strudl.org * + * All rights reserved. * + * * + * Contributed originally by Mike Kinghan, imk@strudl.org * + * * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * Redistributions of source code must retain the above copyright * + * notice, this list of conditions and the following disclaimer. * + * * + * Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * * + * Neither the name of Symbian Software Ltd. nor the names of its * + * contributors may be used to endorse or promote products derived from * + * this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,* + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * + * DAMAGE. * + * * + ***************************************************************************/ + +/*! \file opts.h + * This file defines macro options for building sunifdef + */ +#if HAVE_CONFIG_H +#include "config.h" +#endif + +#define DEFAULT_STATIC_STATE + +#include "state_utils.h" + +#endif + +/* EOF */ diff --git a/src/platform.h b/src/platform.h new file mode 100755 index 0000000..e0e558d --- /dev/null +++ b/src/platform.h @@ -0,0 +1,91 @@ +#ifndef PLATFORM_H +#define PLATFORM_H +/*************************************************************************** + * Copyright (C) 2004, 2006 Symbian Software Ltd. * + * All rights reserved. * + * Copyright (C) 2007, 2008 Mike Kinghan, imk@strudl.org * + * All rights reserved. * + * * + * Contributed originally by Mike Kinghan, imk@strudl.org * + * * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * Redistributions of source code must retain the above copyright * + * notice, this list of conditions and the following disclaimer. * + * * + * Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * * + * Neither the name of Symbian Software Ltd. nor the names of its * + * contributors may be used to endorse or promote products derived from * + * this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,* + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * + * DAMAGE. * + * * + ***************************************************************************/ + +#include "opts.h" +#include + +/*! \file platform.h + * This file defines macros for values that vary with the host environment. + */ +#ifdef _WIN32 +/*! Character that delimits elements of a filesystem path for Windows + */ +#define PATH_DELIM '\\' +/*! String that represents the root of the filesystem for Windows +*/ +#define FS_ROOT_PREFIX "" + +#define _POSIX_ +/*! Name of the host operating system type */ +#define OS_TYPE "Windows" + +/*! This is a Windows build */ +#define WINDOWS + + +#ifdef _MSC_VER +/*! This is a an MS C build */ +#define vsnprintf _vsnprintf +#endif + +#include +/*! Maximum length of pathname. */ +#define PATH_MAX _MAX_PATH + +#else /* ! _WIN32 */ +/*! Character that delimits elements of a filesystem path for Unix + */ +#define PATH_DELIM '/' +/*! String that represents the root of the filesystem for Unix. +*/ +#define FS_ROOT_PREFIX "/" + +/*! Name of the host operating system type */ +#define OS_TYPE "Unix" + +/*! This is a Unix build */ +#define UNIX + +#include +#endif + +#endif +/* EOF */ + diff --git a/src/ptr_vector.c b/src/ptr_vector.c new file mode 100755 index 0000000..bd5a426 --- /dev/null +++ b/src/ptr_vector.c @@ -0,0 +1,145 @@ +/*************************************************************************** + * Copyright (C) 2004, 2006 Symbian Software Ltd. * + * All rights reserved. * + * Copyright (C) 2007, 2008 Mike Kinghan, imk@strudl.org * + * All rights reserved. * + * * + * Contributed originally by Mike Kinghan, imk@strudl.org * + * * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * Redistributions of source code must retain the above copyright * + * notice, this list of conditions and the following disclaimer. * + * * + * Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * * + * Neither the name of Symbian Software Ltd. nor the names of its * + * contributors may be used to endorse or promote products derived from * + * this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,* + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * + * DAMAGE. * + * * + ***************************************************************************/ +#include "ptr_vector.h" +#include "report.h" +#include "memory.h" +#include + +/*! \addtogroup ptr_vector_internals */ +/*@{*/ + +/*! \file ptr_vector.c + * This file implements the Pointer-Vector module + */ + +/*! Structure of a pointer-vector object */ +struct ptr_vector { + /*! Size in bytes by which the vector will be extended on demand. + * Each time an extension is necessary this quantity is doubled. */ + size_t tranch; + /*! The number of pointers in the vector */ + size_t count; + /*! The number of pointers the vector can currently contain without + extension */ + size_t cap; + /*! The start of the stored pointers */ + void **ptrs; +}; + +/*@}*/ + +/* API ***************************************************************/ + +/*!\addtogroup ptr_vector_interface */ +/*@{*/ + +ptr_vector_h +ptr_vector_new(void) +{ + ptr_vector_h pv = allocate(sizeof(struct ptr_vector)); + pv->tranch = 16 * sizeof(void *); + pv->ptrs = NULL; + return pv; +} + +void +ptr_vector_dispose(ptr_vector_h *ppv) +{ + if (*ppv) { + ptr_vector_h pv = *ppv; + if (pv->ptrs) { + free(pv->ptrs); + } + free(pv); + *ppv = 0; + } +} + +void +ptr_vector_insert(ptr_vector_h pv, size_t pos, void *ptr) +{ + if (pv->count == pv->cap) { + pv->cap += pv->tranch; + pv->ptrs = reallocate(pv->ptrs,pv->cap * sizeof(void *)); + pv->tranch <<= 1; + } + if (pos >= pv->count) { + pv->ptrs[pv->count++] = ptr; + } + else { + memmove(pv->ptrs + pos + 1, + pv->ptrs + pos, + ((pv->count - pos) * sizeof(void *))); + pv->ptrs[pos] = ptr; + ++pv->count; + } +} + +void +ptr_vector_append(ptr_vector_h pv, void *ptr) +{ + ptr_vector_insert(pv,(size_t)-1,ptr); +} + +size_t +ptr_vector_count(ptr_vector_h pv) +{ + return pv->count; +} + +void ** +ptr_vector_start(ptr_vector_h pv) +{ + return pv->ptrs; +} + +void ** +ptr_vector_end(ptr_vector_h pv) +{ + return pv->ptrs + pv->count; +} + +void * +ptr_vector_at(ptr_vector_h pv, size_t pos) +{ + return (pos < pv->count) ? pv->ptrs[pos] : 0; +} + +/*@}*/ + +/* EOF */ diff --git a/src/ptr_vector.h b/src/ptr_vector.h new file mode 100755 index 0000000..c8d82c5 --- /dev/null +++ b/src/ptr_vector.h @@ -0,0 +1,131 @@ +#ifndef PTR_VECTOR_H +#define PTR_VECTOR_H + +/*************************************************************************** + * Copyright (C) 2004, 2006 Symbian Software Ltd. * + * All rights reserved. * + * Copyright (C) 2007, 2008 Mike Kinghan, imk@strudl.org * + * All rights reserved. * + * * + * Contributed originally by Mike Kinghan, imk@strudl.org * + * * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * Redistributions of source code must retain the above copyright * + * notice, this list of conditions and the following disclaimer. * + * * + * Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * * + * Neither the name of Symbian Software Ltd. nor the names of its * + * contributors may be used to endorse or promote products derived from * + * this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,* + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * + * DAMAGE. * + * * + ***************************************************************************/ +#include "opts.h" +#include + +/*! \addtogroup ptr_vector_interface */ +/*@{*/ + +/*! \file ptr_vector.h + * This file provides the Pointer-Vector module interface. + */ + +/*! Abstract type of pointer-vector object */ +typedef struct ptr_vector * ptr_vector_h; + +/*! Create new pointer-vector object + * \return A new \c ptr_vector object + */ +extern ptr_vector_h +ptr_vector_new(void); + +/*! Dispose of a pointer-vector object + * \param ppv Pointer to a pointer-vector to be destroyed. The + * object addressed by this pointer is set to \c NULL on return. + * \c free() is called on each pointer stored in the pointer, + * and then remaining memory controlled by the pointer-vector is + * released. + */ +extern void +ptr_vector_dispose(ptr_vector_h *ppv); + +/*! Insert a pointer into a pointer-vector. + * \param pv The pointer-vector in which a pointer is to be inserted. + * \param pos The position in the vector at which to insert. + * \param ptr The pointer to be inserted. + * If \c pos is beyond the end of \c pv then \c ptr is appended to \c pv + * The vector is extended if necessary to insert or append \c ptr. + * \note Pointers that the caller is holding to pointers within the vector + * must be assumed invalidated after an insertion. + * \note Insertion is inefficient even when it does not provoke an + * extension of the vector, because it requires all elements from \c pos + * onward to be moved up 1 position. + * + */ +extern void +ptr_vector_insert(ptr_vector_h pv, size_t pos, void *ptr); + +/*! Append a pointer to a pointer-vector. + * \param pv The pointer-vector to which the pointer is to be appended. + * \param ptr The pointer to be appended. + * The vector is extended if necessary to append \c ptr. + * \note Pointers that the caller is holding to pointers within the vector + * must be assumed invalidated after an insertion. + */ +extern void +ptr_vector_append(ptr_vector_h pv, void *ptr); +/* Append `ptr' to `pv'. `pv' is extended if need be */ + +/*! Get the number of elements in a pointer-vector. + * \param pv The pointer-vector to count. + * \return The number of elements in \c pv. + */ +extern size_t +ptr_vector_count(ptr_vector_h pv); + +/*! Get the start of a pointer-vector. + * \param pv The pointer-vector whose start is wanted. + * \return Pointer to the first element of \c pv, if + * \c pv is non-empty; otherwise \c NULL + */ +extern void ** +ptr_vector_start(ptr_vector_h pv); + +/*! Get the end of a pointer-vector. + * \param pv The pointer-vector whose end is wanted. + * \return Pointer just past the last element of \c pv, if + * \c pv is non-empty; otherwise \c NULL + */ +extern void ** +ptr_vector_end(ptr_vector_h pv); + +/*! Get the element at a given position in a pointer-vector. + * \param pv The pointer-vector from which an element is wanted. + * \param pos The position in the vector from which the element is wanted. + * \return The pointer at position \c pos in \c pv, unless \c pos + * is out of range; \c NULL if \c pos is out of range. + */ +extern void * +ptr_vector_at(ptr_vector_h pv, size_t pos); + +/*@}*/ + +#endif /* EOF */ diff --git a/src/report.c b/src/report.c new file mode 100755 index 0000000..99244e0 --- /dev/null +++ b/src/report.c @@ -0,0 +1,742 @@ +/*************************************************************************** + * Copyright (C) 2004, 2006 Symbian Software Ltd. * + * All rights reserved. * + * Copyright (C) 2007, 2008 Mike Kinghan, imk@strudl.org * + * All rights reserved. * + * * + * Contributed originally by Mike Kinghan, imk@strudl.org * + * * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * Redistributions of source code must retain the above copyright * + * notice, this list of conditions and the following disclaimer. * + * * + * Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * * + * Neither the name of Symbian Software Ltd. nor the names of its * + * contributors may be used to endorse or promote products derived from * + * this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,* + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * + * DAMAGE. * + * * + ***************************************************************************/ + +#include "opts.h" +#include "platform.h" +#include "report.h" +#include "io.h" +#include "args.h" +#include "symbol_table.h" +#include "chew.h" +#include "if_control.h" +#include "line_despatch.h" +#include "evaluator.h" +#include "exception.h" +#include "dataset.h" +#include +#include +#include +#include + +/*!\ingroup report_module, report_interface, report_internals + *\file report.c + * This file implements the Report module + */ + +/*! \addtogroup report_internals */ +/*@{*/ + +/*! Prefixes for debugging names of the comment states */ +static char const * const comment_name[] = { + "NO","C","CXX", "STARTING", "FINISHING","PSEUDO" +}; + +/*! Prefixes for debugging names of the line states */ +static char const * const linestate_name[] = { + "VACANT","DIRECTIVE","CODE" +}; + +/*! Debugging names of the \c #if states */ +static char const * const ifstate_name[] = { + "OUTSIDE", "FALSE_PREFIX", "TRUE_PREFIX", + "PASS_MIDDLE", "FALSE_MIDDLE", "TRUE_MIDDLE", + "PASS_ELSE", "FALSE_ELSE", "TRUE_ELSE", + "FALSE_TRAILER" +}; + +/*! Debugging names of the input line types */ +static char const * const linetype_name[] = { + "TRUEI", "FALSEI", "IF", "TRUE", "FALSE", + "ELIF", "ELTRUE", "ELFALSE", "ELSE", "ENDIF", + "DODGY TRUEI", "DODGY FALSEI", + "DODGY IF", "DODGY TRUE", "DODGY FALSE", + "DODGY ELIF", "DODGY ELTRUE", "DODGY ELFALSE", + "DODGY ELSE", "DODGY ENDIF", + "PLAIN", "EOF", + "CONSISTENT DEFINE KEEP","CONSISTENT DEFINE DROP", + "CONTRADICTORY DEFINE","DIFFERING DEFINE", + "CONSISTENT UNDEF KEEP", "CONSISTENT UNDEF DROP", + "CONTRADICTORY UNDEF" +}; + + +/*! Get the debugging name of the current comment state + * \return A pointer to the name in static storage. + */ +static char const * +get_comment_type_name(void) +{ + return comment_name[GET_PUBLIC(chew,comment_state)]; +} + +/*! Get the debugging name of the current line state + * \return A pointer to the name in static storage. + */ +static char const * +get_linestate_name(void) +{ + return linestate_name[GET_PUBLIC(chew,line_state)]; +} + +/*! Get the debugging name of the current \c #if state + * \return A pointer to the name in static storage. + */ +static char const * +if_state_name(void) +{ + return ifstate_name[if_state()]; +} + +/*! Get the debugging name of a line type. + * + * \param type The line type whose name is wanted. + * \return The debugging name of \em type. + */ +static char const * +get_linetype_name(line_type_t type) +{ + return linetype_name[type]; +} + + +/*! Compose an output message. + + The function interface is the same as that of + \c format_output(), with the exception that the parameter + va_list argp is a pointer that the caller has + initialised with \c va_start() to address a list of + unspecified arguments. +*/ +static size_t +vformat_output( void *dest, + int *buflen, + int *startoff, + char const *format, + va_list argp) +{ + size_t written; + if (*buflen >= 0) { + char *buf = *(heap_str *)dest; + size_t spare; + if (*buflen == 0) { + *buflen = 1024; + *startoff = 0; + release(dest); + buf = allocate(*buflen); + } + spare = *buflen - *startoff; + written = vsnprintf(buf + *startoff,spare,format,argp); + while(written >= spare) { + spare += *buflen; + buf = reallocate(buf,*buflen >>= 1); + written = vsnprintf(buf + *startoff,spare,format,argp); + } + *(heap_str *)dest = buf; + *startoff += (int)written; + } + else { + FILE * out = dest; + written = vfprintf(out,format,argp); + } + return written; +} + +/*! Produce a diagnostic message. + * The function interface is the same as that of \c report(), with + * the exception that the parameter va_list argp is a + * pointer that the caller has initialised with \c va_start() to + * address a list of unspecified arguments. + * + * All diagnostic messages are ultimately composed and output + * by this function. + */ +static void +vreport(reason_code_t reason, heap_str *buf, const char *format, va_list argp); + +/*@}*/ + + +/*! \ingroup report_internals_state_utils */ +/*@{*/ + +/*! The global state of the Diagnostic module */ +STATE_DEF(diagnostic) { + bool dbg; /*!< Is --debug enabled? */ + unsigned int exitstat; /*!< Program exit status */ +} STATE_T(diagnostic); +/*@}*/ + +/*! \addtogroup report_internals_state_utils */ +/*@{*/ +NO_PUBLIC_STATE(diagnostic); + +IMPLEMENT(diagnostic,ZERO_INITABLE); +/*@}*/ + + +static void +vreport(reason_code_t reason, heap_str *bufp, const char *format, va_list argp) +{ + if (GET_PUBLIC(args,got_opts) && reason != MSGCLASS_NONE) { + int mask = GET_PUBLIC(args,diagnostic_filter); + if (mask && ((reason & mask) != 0)) { + /* This message is filtered out. Don't output */ + SET_STATE(diagnostic,exitstat) |= reason & MSGEVENT_MASK; + if (bufp) { + *bufp = NULL; + } + return; + } + } + if (!format) { + assert(bufp); + if (*bufp) { + char *mess = *bufp; + fputs(mess,stderr); + release((void **)bufp); + } + } + else { + void *dest; + int buflen; + int startoff = 0; + int msgclass = MSGCLASS_NONE; + size_t depth = if_depth(); + if (!bufp) { + dest = stderr; + buflen = -1; + } + else { + dest = bufp; + buflen = 0; + } + format_output(dest,&buflen,&startoff,"%s: ",GET_PUBLIC(args,prog_name)); + if (GET_PUBLIC(io,filename)) { + format_output(dest,&buflen,&startoff,"%s: ",GET_PUBLIC(io,filename)); + } + if (GET_PUBLIC(io,line_num)) { + format_output(dest,&buflen,&startoff,"line %d: ", + GET_PUBLIC(io,line_num)); + } + if (reason & ISSUE_MASK) { + char * category; + msgclass = reason & MSGSEVERITY_MASK; + switch(msgclass) { + case MSGCLASS_PROGRESS: + category = "progress"; + break; + case MSGCLASS_INFO: + category = "info"; + break; + case MSGCLASS_WARNING: + category = "warning"; + break; + case MSGCLASS_ERROR: + category = "error"; + break; + case MSGCLASS_ABEND: + category = "abend"; + break; + default: + assert(false); + } + format_output(dest,&buflen,&startoff,"%s 0x%05x: ",category,reason); + SET_STATE(diagnostic,exitstat) |= reason & MSGEVENT_MASK; + } + vformat_output(dest,&buflen,&startoff,format,argp); + if (msgclass != MSGCLASS_PROGRESS && depth > 0) { + format_output(dest,&buflen,&startoff," (#if line %d depth %d)", + (int)if_start_line(),(int)depth); + } + format_output(dest,&buflen,&startoff,"\n"); + } +} + + +/* API ***************************************************************/ + +/*! Convert embedded linefeeds and tabs in a line to spaces for tidy + printing in diagnostics. + \param line Line putatively containing embedded linefeeds or tabs. +*/ +void +flatten_line(char * line) +{ + size_t len = line_len(line); + for ( ;len && *line; ++line,--len) { + if (*line == '\n' || *line == '\r' || *line == '\t') { + *line = ' '; + } + } +} + + +size_t +line_len(char const *str) +{ + /* Some rigmarole here to maintain line-end agnosticism */ + size_t len = strlen(str); + char const *last_ch = str + len - 1; + char const *last_but_1_ch = last_ch - 1; + if (EOL(last_but_1_ch)) { + /* This will be a Windows line-end when we're a Unixoid build. + Need to test this first */ + len -= 2; + } + else if (EOL(last_ch)) { + /* This will be the usual case Unix or Windows */ + --len; + } + return len; +} + +int +exitcode(void) +{ + unsigned severities; + unsigned summaries; + unsigned ret = GET_STATE(diagnostic,exitstat); + if (GET_PUBLIC(line_despatch,lines_dropped)) { + ret |= EVENT_SUMMARY_DROPPED_LINES & ~MSGCLASS_SUMMARY; + } + if (GET_PUBLIC(line_despatch,lines_changed)) { + ret |= EVENT_SUMMARY_CHANGED_LINES & ~MSGCLASS_SUMMARY; + } + SET_STATE(diagnostic,exitstat) = ret; + /* Drop the progress flag off the severities */ + severities = ret >> (MSGCLASS_SHIFT + 1); + summaries = (ret & EVENT_SUMMARY_MASK) << GRIPE_SHIFT; + return severities | summaries; +} + +int +get_exit_flags(int bits) +{ + return bits & + (EVENT_SUMMARY_MASK | MSGSEVERITY_MASK) & GET_STATE(diagnostic,exitstat); +} + +void +set_exit_flags(int bits, bool set) +{ + bits &= (EVENT_SUMMARY_MASK | MSGSEVERITY_MASK); + if (set) { + SET_STATE(diagnostic,exitstat) |= bits; + } + else { + SET_STATE(diagnostic,exitstat) &= ~bits; + } +} + +size_t +format_output(void *dest, int *buflen, int *startoff, char const *format,...) +{ + size_t written; + va_list argp; + va_start(argp,format); + written = vformat_output(dest,buflen,startoff,format,argp); + va_end(argp); + return written; +} + + +void +report(reason_code_t reason, heap_str *buf, const char *format,...) +{ + va_list argp; + va_start(argp,format); + vreport(reason,buf,format,argp); + va_end(argp); +} + +void +parse_error(int reason, const char *format,...) +{ + va_list argp; + va_start(argp,format); + vbail(reason,format,argp); + va_end(argp); +} + +void +bad_args_error(char const *sym, char const *symend, int symind) +{ + static char * formats[] = { + "Duplicated argument '-%c%s'", + "Argument '-%c%s' contradicts previous '-%c%s=%s'", + "Argument '-%c%s' contradicts previous '-%c%s'" + }; + + enum { + DUPLICATE, + CONTRADICTS_NAME_EQ_VAL, + CONTRADICTS_NAME + }; + + char const *this_val = 0; + eval_result_t * symbol = SYMBOL(symind); + char const *prev_val = symbol->sym_def; + char const *name = symbol->sym_name; + char this_opt = sym[-1]; + char prev_opt = prev_val ? 'D' : 'U'; + if (this_opt == 'D') { + if (*symend == '=') { + this_val = ++symend; + } + else { + this_val = ""; + } + } + if (this_opt == prev_opt) { + if (this_opt == 'D') { + if (!strcmp(this_val,prev_val)) { + report( GRIPE_DUPLICATE_ARGS, + NULL, + formats[DUPLICATE], + this_opt, + sym); + } + else if (prev_val[0]) { + bail(GRIPE_INVALID_ARGS,formats[CONTRADICTS_NAME_EQ_VAL], + this_opt,sym,prev_opt,name,prev_val); + } + else { + bail(GRIPE_INVALID_ARGS,formats[CONTRADICTS_NAME], + this_opt,sym,prev_opt,name); + } + } + else { /* Both -U, so can only be duplicate */ + report(GRIPE_DUPLICATE_ARGS,NULL,formats[DUPLICATE],this_opt,sym); + } + } + else if (this_opt == 'D') { /* Previous must be -U */ + bail(GRIPE_INVALID_ARGS,formats[CONTRADICTS_NAME], + this_opt,sym,prev_opt,name); + } + else if (prev_val[0]) { /* This = -UNAME, previous = -DNAME=STRING */ + bail(GRIPE_INVALID_ARGS,formats[CONTRADICTS_NAME_EQ_VAL], + this_opt,sym,prev_opt,name,prev_val); + } + else { /* This = -UNAME, previous = -DNAME */ + bail(GRIPE_INVALID_ARGS,formats[CONTRADICTS_NAME], + this_opt,sym,prev_opt,name); + } +} + +void +give_up_confused(void) +{ + bail(GRIPE_CONFUSED,"Bailing out in confusion"); +} + +void +vbail(int reason, const char *msg, va_list argp) +{ + close_io(true); + if (msg) { + vreport(reason,NULL,msg,argp); + } + else { + SET_STATE(diagnostic,exitstat) |= reason & MSGEVENT_MASK; + } + if (exceptions_enabled && ((reason & MSGEVENT_MASK) != MSGCLASS_ABEND)) { + throw(reason); + } + exit(exitcode()); +} + + +void +bail(int reason, const char *format,...) +{ + va_list argp; + va_start(argp,format); + vbail(reason,format,argp); + va_end(argp); +} + +void +debugging(bool on) +{ + SET_STATE(diagnostic,dbg) = on; +} + +void +debug(dbg_code_t how,...) +{ + if (GET_STATE(diagnostic,dbg)) { + va_list ap; + va_start(ap, how); + switch(how) + { + case DBG_1: + vreport(MSGCLASS_NONE,NULL,"eval%d !",ap); + break; + case DBG_2: + vreport(MSGCLASS_NONE,NULL,"eval%d (",ap); + break; + case DBG_3: + vreport(MSGCLASS_NONE,NULL,"eval%d number",ap); + break; + case DBG_4: + vreport(MSGCLASS_NONE,NULL,"eval%d defined",ap); + break; + case DBG_5: + vreport(MSGCLASS_NONE,NULL,"eval%d symbol",ap); + break; + case DBG_6: + vreport(MSGCLASS_NONE,NULL,"eval%d bad expr",ap); + break; + case DBG_7: + vreport(MSGCLASS_NONE,NULL,"eval%d = %d",ap); + break; + case DBG_8: + vreport(MSGCLASS_NONE,NULL,"eval%d",ap); + break; + case DBG_9: + vreport(MSGCLASS_NONE,NULL,"eval%d %s",ap); + break; + case DBG_10: + vreport(MSGCLASS_NONE,NULL,"eval%d = %d",ap); + break; + case DBG_11: + vreport(MSGCLASS_NONE,NULL,"eval %s",ap); + break; + case DBG_12: + vreport(MSGCLASS_NONE,NULL,"eval = %d",ap); + break; + case DBG_13: + vreport(MSGCLASS_NONE,NULL,"eval #define %.*s",ap); + break; + case DBG_14: + { + size_t safelen = va_arg(ap,size_t); + char const * define = va_arg(ap,char const *); + int linetype = va_arg(ap,int); + char const * const linetype_name = get_linetype_name(linetype); + report(MSGCLASS_NONE,NULL,"eval #define %.*s = %s", + safelen,define,linetype_name); + break; + } + case DBG_15: + vreport(MSGCLASS_NONE,NULL,"eval #undef %.*s",ap); + break; + case DBG_16: + { + size_t safelen = va_arg(ap,size_t); + char const * define = va_arg(ap,char const *); + int linetype = va_arg(ap,int); + char const * const linetype_name = get_linetype_name(linetype); + report(MSGCLASS_NONE,NULL,"eval #undef %.*s = %s", + safelen,define,linetype_name); + break; + } + case DBG_17: + report(MSGCLASS_NONE,NULL,"parser %s comment %s line", + get_comment_type_name(), get_linestate_name()); + break; + case DBG_18: + vreport(MSGCLASS_NONE,NULL,"find_sym %s %s",ap); + break; + case DBG_19: + { + int linetype = va_arg(ap,int); + report(MSGCLASS_NONE,NULL,"process %s -> %s depth %d", + get_linetype_name(linetype), + if_state_name(), + if_depth()); + break; + } + case DBG_20: + vreport(MSGCLASS_NONE,NULL,"eval%d +",ap); + break; + case DBG_21: + vreport(MSGCLASS_NONE,NULL,"eval%d -",ap); + break; + case DBG_22: + vreport(MSGCLASS_NONE,NULL,"eval%d ~",ap); + break; + default: + assert(false); + } + va_end(ap); + } +} + +void +exit_diagnostics(void) +{ + size_t infiles = + file_tree_count(GET_PUBLIC(dataset,file_tree),FT_COUNT_FILES,NULL); + unsigned donefiles = GET_PUBLIC(dataset,donefiles); + unsigned errorfiles = GET_PUBLIC(dataset,errorfiles); + char * diagnostic_status = ""; + + int ret = exitcode(); + if_control_toplevel(); + io_toplevel(); + + if (GET_STATE(diagnostic,exitstat) & MSGCLASS_ABEND) { + diagnostic_status = " ABNORMALLY"; + } + else if (GET_STATE(diagnostic,exitstat) & MSGCLASS_ERROR) { + diagnostic_status = " with errors"; + } + else if (GET_STATE(diagnostic,exitstat) & MSGCLASS_WARNING) { + diagnostic_status = " with warnings"; + } + else if (GET_STATE(diagnostic,exitstat) & MSGCLASS_INFO) { + diagnostic_status = " with remarks"; + } + report(PROGRESS_SUMMARY_ALL_DONE,NULL, + "Completed%s, exit code 0x%02x",diagnostic_status,ret); + if (infiles) { + report(PROGRESS_SUMMARY_FILES_REACHED,NULL, + "%d out of %d input files were reached; %d files were not reached", + donefiles,infiles,infiles - donefiles); + report(PROGRESS_SUMMARY_FILES_DROPPED,NULL, + "%d out %d files reached were valid; " + "%d were abandoned due to parse errors", + donefiles - errorfiles,donefiles,errorfiles); + if (infiles == donefiles && errorfiles == 0) { + if (GET_STATE(diagnostic,exitstat) & + EVENT_SUMMARY_DROPPED_LINES & ISSUE_MASK) { + report(EVENT_SUMMARY_DROPPED_LINES,NULL,"Input lines were dropped"); + } + if (GET_STATE(diagnostic,exitstat) & + EVENT_SUMMARY_CHANGED_LINES & ISSUE_MASK) { + report(EVENT_SUMMARY_CHANGED_LINES,NULL,"Input lines were changed"); + } + if (GET_STATE(diagnostic,exitstat) & + EVENT_SUMMARY_ERRORED_LINES & ISSUE_MASK) { + report( EVENT_SUMMARY_ERRORED_LINES, + NULL, + "Input lines were changed to #error directives"); + } + if (GET_STATE(diagnostic,exitstat) & + EVENT_SUMMARY_ERROR_OUTPUT & ISSUE_MASK) { + report( EVENT_SUMMARY_ERRORED_LINES, + NULL, + "Unconditional #error directives were output"); + } + } + } +} + +void +orphan_elif(void) +{ + parse_error(GRIPE_ORPHAN_ELIF,"Orphan #elif"); +} + +void +orphan_else(void) +{ + parse_error(GRIPE_ORPHAN_ELSE,"Orphan #else"); +} + +void +orphan_endif(void) +{ + parse_error(GRIPE_ORPHAN_ENDIF,"Orphan #endif"); +} + +void +early_eof(void) +{ + parse_error(GRIPE_EOF_TOO_SOON,"Unexpected EOF"); +} + +void +obfuscation(void) +{ + parse_error(GRIPE_OBFUSC_DIRECTIVE, + "Obfuscated preprocessor control line"); +} + +void +processing_file(char const *filename) +{ + report(PROGRESS_PROCESSING_FILE,NULL,"Processing file \"%s\"",filename); +} + +void +entering_dir(char const *dirname) +{ + report(PROGRESS_ENTERING_DIR,NULL,"Entering directory \"%s\"",dirname); +} + +void +leaving_dir(char const *dirname) +{ + report(PROGRESS_LEAVING_DIR,NULL,"Leaving directory \"%s\"",dirname); +} + +heap_str +concatenate(size_t count, char *strs[], int punctch) +{ + heap_str concat; + char *posn; + size_t *lengths = callocate(count,sizeof(size_t)); + size_t buflen = 0; + size_t punctsz = punctch == -1 ? 0 : count - 1; + size_t i = 0; + for ( ; i < count; ++i) { + buflen += lengths[i] = strlen(strs[i]); + } + buflen += punctsz + 2; + concat = allocate(buflen); + posn = concat; + for (i = 0; i < count; ++i) { + strcpy(posn,strs[i]); + posn += lengths[i]; + if (punctch != -1) { + *posn++ = (char)punctch; + } + } + if (punctch != -1) { + posn[-1] = '\0'; + } + free(lengths); + return concat; +} + + +/* EOF */ + + diff --git a/src/report.h b/src/report.h new file mode 100755 index 0000000..ad7d4de --- /dev/null +++ b/src/report.h @@ -0,0 +1,587 @@ +#ifndef REPORT_H +#define REPORT_H + +/*************************************************************************** + * Copyright (C) 2004, 2006 Symbian Software Ltd. * + * All rights reserved. * + * Copyright (C) 2007, 2008 Mike Kinghan, imk@strudl.org * + * All rights reserved. * + * * + * Contributed originally by Mike Kinghan, imk@strudl.org * + * * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * Redistributions of source code must retain the above copyright * + * notice, this list of conditions and the following disclaimer. * + * * + * Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * * + * Neither the name of Symbian Software Ltd. nor the names of its * + * contributors may be used to endorse or promote products derived from * + * this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,* + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * + * DAMAGE. * + * * + ***************************************************************************/ + +#include "opts.h" +#include "bool.h" +#include +#include + + /*!\ingroup report_module report_interface + * \file report.h + * This file provides the Report module interface + */ + +/*!\addtogroup report_interface */ +/*@{*/ + +/*! Enumeration of all diagnostic reason codes and auxiliary + bit masks and offsets. + A complete reason code consists or an or-combination + of a message class code and an issue code. + A range of issue codes are \em event \em summary codes, + representing significant diagnostics accrued in the course + of processing all inputs. Another range of issue codes are + \em gripes, representing complaints specific to input + fragments. + */ +typedef enum { + /*! The message class bitfield is offset this amount */ + MSGCLASS_SHIFT = 11, + /*! &-ed with code strips off message class */ + ISSUE_MASK = (1 << MSGCLASS_SHIFT) - 1, + /*! No message class */ + MSGCLASS_NONE = 0 << MSGCLASS_SHIFT, + /*! Progress message */ + MSGCLASS_PROGRESS = 1 << MSGCLASS_SHIFT, + /*! Informational diagnositic */ + MSGCLASS_INFO = 2 << MSGCLASS_SHIFT, + /*! Warning diagnostic */ + MSGCLASS_WARNING = 4 << MSGCLASS_SHIFT, + /*! User error diagnostic */ + MSGCLASS_ERROR = 8 << MSGCLASS_SHIFT, + /*! Fatal internal or environment error diagnostic */ + MSGCLASS_ABEND = 16 << MSGCLASS_SHIFT, + /*! Summary message. */ + MSGCLASS_SUMMARY = 32 << MSGCLASS_SHIFT, + + /*! &-ed with code extracts message class */ + MSGCLASS_MASK = 255 << MSGCLASS_SHIFT, + /*! &-ed with code extracts message severity, i.e. + message class other than summary */ + MSGSEVERITY_MASK = MSGCLASS_MASK & ~MSGCLASS_SUMMARY, + /*! &-ed with code extracts any event message class, i.e. + message class other than progress and summary. + */ + MSGEVENT_MASK = MSGSEVERITY_MASK & ~MSGCLASS_PROGRESS, + + /*! Min value of event summaries */ + EVENT_SUMMARY_MIN = 1, + /*! Summary diagnostic - input lines were dropped */ + EVENT_SUMMARY_DROPPED_LINES = 1 | MSGCLASS_INFO | MSGCLASS_SUMMARY, + /*! Summary diagnostic - input lines were changed */ + EVENT_SUMMARY_CHANGED_LINES = 2 | MSGCLASS_INFO | MSGCLASS_SUMMARY, + /*! Summary diagnostic - input lines were converted to #errors */ + EVENT_SUMMARY_ERRORED_LINES = 4 | MSGCLASS_WARNING | MSGCLASS_SUMMARY, + /*! Summary diagnostic - unconditional #error lines were output */ + EVENT_SUMMARY_ERROR_OUTPUT = 8 | MSGCLASS_WARNING | MSGCLASS_SUMMARY, + /*! All valid summary values are less than this */ + EVENT_SUMMARY_MAX = 16, + /*! &-ed with code extracts summary diagnostics */ + EVENT_SUMMARY_MASK = EVENT_SUMMARY_MAX - 1, + /*! The progress messages bitfield is offset this amount */ + PROGRESS_SHIFT = 4, + /*! Report file being processed */ + PROGRESS_PROCESSING_FILE = (45 << PROGRESS_SHIFT) | MSGCLASS_PROGRESS, + /*! Report entering directory */ + PROGRESS_ENTERING_DIR = (46 << PROGRESS_SHIFT) | MSGCLASS_PROGRESS, + /*! Report leaving directory */ + PROGRESS_LEAVING_DIR = (47 << PROGRESS_SHIFT) | MSGCLASS_PROGRESS, + /*! Report building the input tree */ + PROGRESS_BUILDING_TREE = (49 << PROGRESS_SHIFT) | MSGCLASS_PROGRESS, + /*! Report searching a directory for input files */ + PROGRESS_SEARCHING_DIR = (50 << PROGRESS_SHIFT) | MSGCLASS_PROGRESS, + /*! Report added a file to input */ + PROGRESS_ADDED_FILE = (51 << PROGRESS_SHIFT) | MSGCLASS_PROGRESS, + /*! Report added files from a directory */ + PROGRESS_ADDED_DIR = (52 << PROGRESS_SHIFT) | MSGCLASS_PROGRESS, + /*! Report total input files found */ + PROGRESS_FILE_TALLY = (53 << PROGRESS_SHIFT) | MSGCLASS_PROGRESS, + /*! Report a commandline argument parsed */ + PROGRESS_GOT_OPTIONS = (54 << PROGRESS_SHIFT) | MSGCLASS_PROGRESS, + + + /*! The progress summaries bitfield is offset this amount. */ + PROGRESS_SUMMARY_SHIFT = 4, + /*! Report total files reached & not reached */ + PROGRESS_SUMMARY_FILES_REACHED = + (55 << PROGRESS_SUMMARY_SHIFT) | MSGCLASS_INFO | MSGCLASS_SUMMARY, + /*! Report total files abandoned due to errors */ + PROGRESS_SUMMARY_FILES_DROPPED = + (56 << PROGRESS_SUMMARY_SHIFT) | MSGCLASS_INFO | MSGCLASS_SUMMARY, + PROGRESS_SUMMARY_ALL_DONE = + (57 << PROGRESS_SUMMARY_SHIFT) | MSGCLASS_PROGRESS | MSGCLASS_SUMMARY, + + /*! The gripes bitfield is offset this amount */ + GRIPE_SHIFT = 4, + /*! Duplicate diagnoistic filters are specified with the \c --gag + * option + */ + GRIPE_DUPLICATE_MASK = (27 << GRIPE_SHIFT) | MSGCLASS_INFO, + /*! Input file or directory is symbolic link. + */ + GRIPE_SYMLINK = (48 << GRIPE_SHIFT) | MSGCLASS_INFO, + /*! --replace option is redundant with --symbols + */ + GRIPE_REDUNDANT_OPTION = (49 << GRIPE_SHIFT) | MSGCLASS_WARNING, + + /*! The same argument occurs for multiple \c --define or \c + * --undefine options + */ + GRIPE_DUPLICATE_ARGS = (1 << GRIPE_SHIFT) | MSGCLASS_WARNING, + /*! An input \c #def or \c #undef directive was deleted on + * output because it contradicts a \c --define or \c --undefine + * option together with \c --contradict \c delete + */ + GRIPE_DELETED_CONTRADICTION = (2 << GRIPE_SHIFT) | MSGCLASS_WARNING, + /*! An input \c #def or \c #undef directive was commented out on + * output because it contradicts a \c --define or \c --undefine + * option togther with \c --contradict \c comment + */ + GRIPE_COMMENTED_CONTRADICTION = (3 << GRIPE_SHIFT) | MSGCLASS_WARNING, + /*! An input \c #def or \c #undef directive was converted to an + * #error on output because it contradicts a \c --define or \c --undefine + * option \c --contradict \c error + */ + GRIPE_ERRORED_CONTRADICTION = (4 << GRIPE_SHIFT) | MSGCLASS_WARNING, + /*! An \c #error directive was input unconditionally, i.e. + * not in the scope of any \c #if + */ + GRIPE_UNCONDITIONAL_ERROR_INPUT = (5 << GRIPE_SHIFT) | MSGCLASS_WARNING, + /*! An \c #error directive was output unconditionally, i.e. + * not in the scope of any \c #if + */ + GRIPE_UNCONDITIONAL_ERROR_OUTPUT = (6 << GRIPE_SHIFT) | MSGCLASS_WARNING, + /*! Garbage text was input following a \c # directive + */ + GRIPE_GARBAGE_AFTER_DIRECTIVE = (7 << GRIPE_SHIFT) | MSGCLASS_WARNING, + /*! More than \c MAXMASKS diagnostic filters are specified with the + * \c --gag option + */ + GRIPE_TOO_MANY_MASKS = (28 << GRIPE_SHIFT) | MSGCLASS_WARNING, + /*! The \c --verbose option is mixed with the \c --gag option */ + GRIPE_VERBOSE_ONLY = (29 << GRIPE_SHIFT) | MSGCLASS_WARNING, + /*! A divide by zero was found in an expression */ + GRIPE_ZERO_DIVIDE = (38 << GRIPE_SHIFT) | MSGCLASS_WARNING, + /*! Directory name ignored on input when \c --recurse not + not specified */ + GRIPE_DIR_IGNORED = (41 << GRIPE_SHIFT) | MSGCLASS_WARNING, + /*! An integer constant evaluates > INT_MAX */ + GRIPE_INT_OVERFLOW = (60 << GRIPE_SHIFT | MSGCLASS_WARNING), + /* MAX REASON = 60. When you add a new gripe, you must give it + it the MAX GRIPE gripe number, increment MAX REASON in this + comment and move this comment adjacent to your new gripe + The maximum reason */ + + /*! A symbol that evaluates to an empty string is an + operand in an expression */ + GRIPE_EMPTY_SYMBOL = (58 << GRIPE_SHIFT) | MSGCLASS_WARNING, + /*! An orphan \c #elif was found in input */ + GRIPE_ORPHAN_ELIF = (8 << GRIPE_SHIFT) | MSGCLASS_ERROR, + /*! An orphan \c #else was found in input */ + GRIPE_ORPHAN_ELSE = (9 << GRIPE_SHIFT) | MSGCLASS_ERROR, + /*! An orphan \c #endif was found in input */ + GRIPE_ORPHAN_ENDIF = (10 << GRIPE_SHIFT) | MSGCLASS_ERROR, + /*! Unexpected end of input */ + GRIPE_EOF_TOO_SOON = (11 << GRIPE_SHIFT) | MSGCLASS_ERROR, + /*! An obfuscated \c # directive was found on input */ + GRIPE_OBFUSC_DIRECTIVE = (12 << GRIPE_SHIFT) | MSGCLASS_ERROR, + /*! Input ends within a comment */ + GRIPE_EOF_IN_COMMENT = (13 << GRIPE_SHIFT) | MSGCLASS_ERROR, + /*! Input ends within quotation */ + GRIPE_EOF_IN_QUOTE = (14 << GRIPE_SHIFT) | MSGCLASS_ERROR, + /*! The commandline does not specify anything to do */ + GRIPE_NOTHING_TO_DO = (15 << GRIPE_SHIFT) | MSGCLASS_ERROR, + /*! The commandline invalidly specifies multiple input files without + * the \c --replace option + */ + GRIPE_ONE_FILE_ONLY = (16 << GRIPE_SHIFT) | MSGCLASS_ERROR, + /*! A newline occurs within quotation in input */ + GRIPE_NEWLINE_IN_QUOTE = (17 << GRIPE_SHIFT) | MSGCLASS_ERROR, + /*! A newline is missing at end of input */ + GRIPE_MISSING_EOF_NEWLINE = (18 << GRIPE_SHIFT) | MSGCLASS_ERROR, + /*! The commandline options are not a valid combination */ + GRIPE_INVALID_ARGS = (19 << GRIPE_SHIFT) | MSGCLASS_ERROR, + /*! The commandline is syntactically invalid */ + GRIPE_USAGE_ERROR = (20 << GRIPE_SHIFT) | MSGCLASS_ERROR, + /*! \c #if nesting exceeds \c MAXDEPTH in input */ + GRIPE_TOO_DEEP = (21 << GRIPE_SHIFT) | MSGCLASS_ERROR, + /*! The \c --file option occurs more than once */ + GRIPE_MULTIPLE_ARGFILES = (31 << GRIPE_SHIFT) | MSGCLASS_ERROR, + /*! The argument to a \c --define or \c --undefine option + * contains mysterious characters. + */ + GRIPE_GARBAGE_ARG = (32 << GRIPE_SHIFT) | MSGCLASS_ERROR, + /*! A valid preprocessor identifier was not found where required */ + GRIPE_NOT_IDENTIFIER = (33 << GRIPE_SHIFT) | MSGCLASS_ERROR, + /*! Unbalanced parenthesis */ + GRIPE_UNBALANCED_PAREN = (59 << GRIPE_SHIFT) | MSGCLASS_ERROR, + + /*! Cannot open an input file */ + GRIPE_CANT_OPEN_INPUT = (22 << GRIPE_SHIFT) | MSGCLASS_ABEND, + /*! Out of memory */ + GRIPE_OUT_OF_MEMORY = (23 << GRIPE_SHIFT) | MSGCLASS_ABEND, + /*! A filename exceeds the maximum length for the environment */ + GRIPE_FILENAME_TOO_LONG = (24 << GRIPE_SHIFT) | MSGCLASS_ABEND, + /*! End of input encountered while reading a quoted filename. + A closing quotation was not found */ + GRIPE_EOF_IN_FILENAME = (25 << GRIPE_SHIFT) | MSGCLASS_ABEND, + /*! Internal logic error */ + GRIPE_CONFUSED = (26 << GRIPE_SHIFT) | MSGCLASS_ABEND, + /*! Read error on input */ + GRIPE_CANT_READ_INPUT = (30 << GRIPE_SHIFT) | MSGCLASS_ABEND, + /*! Write error on output */ + GRIPE_CANT_WRITE_FILE = (39 << GRIPE_SHIFT) | MSGCLASS_ABEND, + /*! Can't identify file or directory */ + GRIPE_NO_FILE = (40 << GRIPE_SHIFT) | MSGCLASS_ABEND, + /*! Invalid filename input */ + GRIPE_ILLEGAL_FILENAME = (34 << GRIPE_SHIFT) | MSGCLASS_ABEND, + /*! Failure to delete a file */ + GRIPE_CANT_DELETE_FILE = (35 << GRIPE_SHIFT) | MSGCLASS_ABEND, + /*! Failure to rename a file */ + GRIPE_CANT_RENAME_FILE = (36 << GRIPE_SHIFT) | MSGCLASS_ABEND, + /*! Cannot create a temporary file */ + GRIPE_NO_TEMPFILE = (37 << GRIPE_SHIFT) | MSGCLASS_ABEND, + /*! Cannot open directory */ + GRIPE_CANT_OPEN_DIR = (42 << GRIPE_SHIFT) | MSGCLASS_ABEND, + /*! Read error on directory */ + GRIPE_CANT_READ_DIR = (43 << GRIPE_SHIFT) | MSGCLASS_ABEND + +} reason_code_t; + +/*! Arbitary codes to select the behaviour of the \c debug() function */ +typedef enum { + DBG_1 = 1, + DBG_2, + DBG_3, + DBG_4, + DBG_5, + DBG_6, + DBG_8, + DBG_7, + DBG_9, + DBG_10, + DBG_11, + DBG_12, + DBG_13, + DBG_14, + DBG_15, + DBG_16, + DBG_17, + DBG_18, + DBG_19, + DBG_20, + DBG_21, + DBG_22 +} dbg_code_t; + +/*! Set or clear event summary or severity flags in the exit status. + \param bits The bits to be set or cleared + \param set If \em true, then \em bits are set in the + exit status; otherwise they are cleared. + */ +extern void +set_exit_flags(int bits, bool set); + +/*! Query the current event summary and severity flags. + \param bits The bits to be queried. + \return A bit mask consisting of those bits that are set in \em bits + and also in the exit status. + */ +extern int +get_exit_flags(int bits); + +/*! Convert the internal exit status to an exit code for \c exit(), + manipulating the bits so that the exit diagnostic bits are + returned in the low order byte. + \return RC such that: + + - RC = 0: MSGCLASS_NONE: No diagnostics accrued. + + - RC & 0x2: MSGCLASS_INFO: At worst info diagnostics accrued. + + - RC & 0x4: MSGCLASS_WARNING: At worst warnings accrued. + + - RC & 0x8: MSGCLASS_ERROR: At worst errors accrued. + + - RC & 0x16: MSGCLASS_ABEND: Execution was aborted. + + - RC & 0x12: EVENT_SUMMARY_DROPPED_LINES (INFO): Input lines were dropped on + output. + + - RC & 0x22: EVENT_SUMMARY_CHANGED_LINES (INFO): Input lines were changed on + output. + + - RC & 0x44: EVENT_SUMMARY_ERRORED_LINES (WARNING): Lines were changed to + \c #errors on output. + + - RC & 0x84: EVENT_SUMMARY_ERROR_OUPUT (WARNING): Unconditional \c #errors were + output. + */ +extern int exitcode(void); + +/*! Get the length of a string excluding any final newline. + * \param str The string to be measured. + * \return The length of \c str excluding any final newline. + */ +extern size_t +line_len(char const *str); + +/*! Convert embedded linefeeds and tabs in string line to spaces for tidy + printing in diagnostics. + \param text String putatively containing embedded linefeeds or tabs. +*/ +extern void +flatten_line(char * text); + + +/*! Produce a diagnostic message. + + \param reason The reason code of the diagnostic + \param bufp Either \c NULL or the address of a pointer at + which storage shall be allocated to store the + diagnostic. + \param format Either \c NULL or a \c printf format from + which the diagnostic may be composed together with the + ensuing unspecified arguments. + + The diagnostic is prefixed with the program name, and then + the current input filename and line number, if any, that provoke the + diagnostic. + + Then follows one of: + + - progress \em reason + - info \em reason + - warning \em reason + - error \em reason + - abend \em reason + +depending on the message class of \em reason. + +Then follows the body of diagnostic composed from \em format and +subsequent args. + +Finally, if the diagnostic refers to an output line that is +within the scope of a true \c #if condition from input line \c N +at nesting depth \c D, a parenthesis is written of the form: + +(if-line N, depth D) + +The way in which production of the diagnostic is determined as +follows: + +If \em format is NULL then \em buf is assumed to be the address +of a pointer to storage in which a previous call to the function +has composed a diagnostic that is now to be output. In this case +the diagnostic at that pointer is written to stderr, the pointer +at \em buf is freed and set == NULL. + +Otherwise, if \em buf == NULL then a diagnostic composed from +\em format and subsequent arguments is written to stderr. + +Otherwise, if the pointer addressed by \em buf is not NULL, it +is freed. Then a diagnostic composed from \em format +and subsequent arguments is composed in heap storage and the +address of this storage is stored at \em buf. If is the +responsibility of the caller to ensure that this storage is +freed. +*/ + +extern void +report(reason_code_t reason, heap_str *buf, const char *format,...); + +/*! Exit the program on a fatal parsing error with a diagnostic message. + * \param reason The reason code for the error. + * \param format A \c printf format from which to compose the diagnostic + * together with subsequent arguments. + */ +extern void +parse_error(int reason, const char *format,...); + +/*! Write a diagnostic on \c stderr when the same symbol occurs twice + * as an argument among the \c --define and \c --undefine options. + * + * \param sym The start of symbol that occurs twice. + * \param symend The end of the symbol that occurs twice. + * \param symind The index of the symbol in the symbol table. + * + * If the argument occurs only for more than one \c --define or for more than + * one \c --undefine, then these options are merely duplicated and the + * diagnostic is a warning. + * + * If the argument occurs for a \c --define and also an \c --undefine, + * then these options are contradictory and the diagnostic is fatal. + * + * If contradictory options are detected the function calls \c exit(). + */ +extern void +bad_args_error(char const *sym, char const *symend, int symind); + +/*! Exit the program on an internal logic error with an aplogetic message. + * The function is called if the program recognises that it + * it has lost its bearings. + */ +extern void +give_up_confused(void); + +/*! Exit the program with a specified return code and diagnostic + * message. + * The function interface is the same as that of \c bail(), with + * the exception that the parameter va_list argp is a + * pointer that the caller has initialised with \c va_start() to + * address a list of unspecified arguments. + * + * All functions that terminate the program do so by calling this function + */ +extern void +vbail(int reason, const char *msg, va_list argp); + + +/*! Exit the program out with a specified return code and + * diagnostic message. + * \param retcode The code to be returned by \c exit(). + * \param format A \c printf format from which to compose the diagnostic + * together with subsequent arguments. + */ +extern void +bail(int retcode, const char *format,...); + +/*! Turn debugging output on or off + * \param on If \em true, debugging output is enabled; otherwise disabled. + */ +extern void +debugging(bool on); + +/*! Write debugging info on \c stderr. + * \param how A code that selects how the function will compose + * debugging output from the subsequent arguments. + */ +extern void +debug(dbg_code_t how,...); + +/*! Write summary diagnostics on \c stderr at exit. + * The summary diagnostics will be output unless \c --gag \c summary + * is in force, which it is by default. + */ +extern void +exit_diagnostics(void); + +/*! Diagnose an input orphan\c #elif on \c stderr */ +extern void +orphan_elif(void); + +/*! Diagnose an input orphan \c #else on \c stderr */ +extern void +orphan_else(void); + +/*! Diagnose an input orphan \c #endif on \c stderr */ +extern void +orphan_endif(void); + +/*! Diagnose unexpected end of input on \c stderr */ +extern void +early_eof(void); + +/*! Diagnose an input obfuscated \c # directive on \c stderr */ +extern void +obfuscation(void); + +/*! Report processing an input file \c stderr */ +extern void +processing_file(char const *filename); + +/*! Report entering a directory file \c stderr */ +extern void +entering_dir(char const *dirname); + +/*! Report leaving a directory file \c stderr */ +extern void +leaving_dir(char const *dirname); + + +/*! Compose an output message. + * + * \param dest Depending on \c buflen, either a pointer to + a \c FILE to which the formatted output shall be + written, or else a pointer to the address of a + heap buffer in which to format the output. + \param buflen If \c *buflen < 0 then \c dest is a + \c FILE*. Otherwise \c *buflen is current length + of the buffer at \c *dest. + \param startoff If \c *buflen >= 0, \c *startoff is the + offset into the buffer at which to format the + message; otherwise ignored. + \param format The \c printf() format with which to + compose the message using subsequent arguments. + * \return The length of the formatted message, excluding + any terminal nul. + + If \c *buflen < 0 then the function writes output to the + \c FILE at \c dest composed from \c format and subsequent + arguments. + + Otherwise function attempts to compose output within the + spare \c *buflen - \c *startoff bytes of the buffer. + As long as the output will not fit the function reallocates + the buffer to twice its current size and tries again. The + final address of the buffer will be stored at \c dest. The + final length of the buffer will be stored at \c buflen, and + the address of the terminal nul of the formatted message + with be stored at \c startoff. + + It is the caller's responsibility to free storage allocated + at \c *dest. + */ +extern size_t +format_output(void *dest, int *buflen, int *startoff, char const *format,...); + +/*! + Concatenate strings. + + \param count The number of strings to concatenate, + \param str The array of strings to concatenate. + \param punctch Optional character with which to + punctuate the concatenated strings, -1 == none. + \return Pointer to heap storage in which the concatenation + is stored. It is the caller's responsibility to + free this storage. +*/ +extern heap_str +concatenate(size_t count, char *strs[], int punctch); +/*@}*/ + +/*! \addtogroup report_interface_state_utils */ +/*@{*/ +IMPORT_INITOR(diagnostic); +IMPORT_FINITOR(diagnostic); +/*@}*/ + +#endif /* EOF */ diff --git a/src/state_utils.c b/src/state_utils.c new file mode 100755 index 0000000..b9b3441 --- /dev/null +++ b/src/state_utils.c @@ -0,0 +1,104 @@ +/*************************************************************************** + * Copyright (C) 2004, 2006 Symbian Software Ltd. * + * All rights reserved. * + * Copyright (C) 2007, 2008 Mike Kinghan, imk@strudl.org * + * All rights reserved. * + * * + * Contributed originally by Mike Kinghan, imk@strudl.org * + * * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * Redistributions of source code must retain the above copyright * + * notice, this list of conditions and the following disclaimer. * + * * + * Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * * + * Neither the name of Symbian Software Ltd. nor the names of its * + * contributors may be used to endorse or promote products derived from * + * this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,* + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * + * DAMAGE. * + * * + ***************************************************************************/ + +/*! Use allocate() to allocate dynamic state storage */ +#ifdef STATE_ALLOCATOR +#undef STATE_ALLOCATOR +/*!\ingroup state_utils_infrastructure + * Use allocate() instead of malloc() + */ +#define STATE_ALLOCATOR (allocate) +#endif +#include "opts.h" +#include "memory.h" + +/*! \ingroup state_utils_infrastructure + * \file state_utils.c + * The file implements the State Utilities module. + */ + +/*! \addtogroup state_utils_infrastructure */ +/*@{*/ + +void +module_initor( + bool is_static, + bool is_zero_initable, + void **state, + void **public_state, + void const *initialiser, + size_t size, + void (*user_init)()) +{ + if (!is_static) { + assert(*state == NULL); + *state = allocate(size); + *public_state = *state; + } + if (is_zero_initable) { + memset(*state,0,size); + } + else if (initialiser) { + memcpy(*state,initialiser,size); + } + else { + assert(user_init); + user_init(*state); + } +} + +void +module_finitor( + bool is_static, + void **state, + void **public_state, + void (*user_finis)()) +{ + if (user_finis) { + assert(*state); + user_finis(*state); + } + if (!is_static) { + assert(*state); + release(state); + *public_state = NULL; + } +} +/*@}*/ + +/* EOF */ diff --git a/src/state_utils.h b/src/state_utils.h new file mode 100755 index 0000000..da5b948 --- /dev/null +++ b/src/state_utils.h @@ -0,0 +1,921 @@ +#ifndef STATE_UTILS_H +#define STATE_UTILS_H +/*************************************************************************** + * Copyright (C) 2004, 2006 Symbian Software Ltd. * + * All rights reserved. * + * Copyright (C) 2007, 2008 Mike Kinghan, imk@strudl.org * + * All rights reserved. * + * * + * Contributed originally by Mike Kinghan, imk@strudl.org * + * * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * Redistributions of source code must retain the above copyright * + * notice, this list of conditions and the following disclaimer. * + * * + * Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * * + * Neither the name of Symbian Software Ltd. nor the names of its * + * contributors may be used to endorse or promote products derived from * + * this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,* + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * + * DAMAGE. * + * * + ***************************************************************************/ + +#include "opts.h" +#include "bool.h" +#include "memory.h" +#include +#include +#include + +/*! \ingroup state_utils_interface, state_utils_infrastructure + * \file state_utils.h + * The file provides the State Utils interface + */ + +/*! \ingroup state_utils_infrastructure + * + * These items that are imported by state_utils.h to implement + * the user macros but are inessential to client code. + */ +/*@{*/ + +#ifndef STATE_ALLOCATOR +/*! Define malloc-like function for allocating dynamic state storage */ +#define STATE_ALLOCATOR (malloc) +#endif + +/*! Generated name for module global state instance */ +#define STATE(module) module##_state +/*! Generated name for module public state instance */ +#define PUBLIC_STATE(module) module##_public_state +/*! Generated name for pointer to module global state instance */ +#define HANDLE(module) module##_h +/*! Generated name for pointer to module public state instance */ +#define PUBLIC_HANDLE(module) module##_public_h +/*! Mandatory name user defined module initialiser */ +#define USER_INIT(module) module##_init +/*! Mandatory name user defined module finaliser */ +#define USER_FINIS(module) module##_finis +/*! Mandatory name for pointer to user defined module initialiser */ +#define USER_INIT_HANDLE(module) module##_init_h +/*! Mandatory name for pointer to user defined module finaliser */ +#define USER_FINIS_HANDLE(module) module##_finis_h +/*! Generated name for module initialising function */ +#define INITOR(module) module##_initor +/*! Generated name for module finalising function */ +#define FINITOR(module) module##_finitor +/*! Generated name for module static initialiser */ +#define STATIC_INITIALISER(module) module##_static_initialiser +/*! Generated name for pointer to module static initialiser */ +#define STATIC_INITIALISER_HANDLE(module) module##_static_initialiser_h +/*! enum tag name for module storage type, static or dynamic */ +#define STORAGE_TYPE_TAG(module) module##_storage_type +/*! enum tag name for module's initialisation type */ +#define INITIALISATION_TYPE_TAG(module) module##_initialisation_type +/*! Declare user-defined module initialising function */ +#define DECL_USER_INIT(module)\ + void USER_INIT(module)(STATE_T(module) *) +/*! Declare user-defined module finalising function */ +#define DECL_USER_FINIS(module)\ + void USER_FINIS(module)(STATE_T(module) *) +/*! Declare pointer to user-defined module initialising function */ +#define DECL_USER_INIT_HANDLE(module)\ + void (*USER_INIT_HANDLE(module))(STATE_T(module) *) +/*! Declare pointer to user-defined finalising function */ +#define DECL_USER_FINIS_HANDLE(module)\ + void (*USER_FINIS_HANDLE(module))(STATE_T(module) *) +/*! Declare generated module initialising function */ +#define DECL_INITOR(module) void INITOR(module)(void) +/*! Declare generated module finalising function */ +#define DECL_FINITOR(module) void FINITOR(module)(void) +/*! Declare a static initialiser for the module */ +#define DECL_STATIC_INITIALISER(module)\ + static const STATE_T(module) STATIC_INITIALISER(module) +/*! Declare pointer to module const initialiser. Can be null if none */ +#define DECL_STATIC_INITIALISER_HANDLE(module)\ + static const STATE_T(module) * const STATIC_INITIALISER_HANDLE(module) +/*! Select static storage for module state instance */ +#define SELECT_STATIC(module)\ + enum module##_storage_type { STORAGE_TYPE_TAG(module) = STATE_STATIC } +/*! Select dynamic storage for module state instance */ +#define SELECT_DYNAMIC(module)\ + enum module##_storage_type { STORAGE_TYPE_TAG(module) = STATE_DYNAMIC } +/*! Select the module's initialisation type */ +#define SELECT_INITIALISATION_TYPE(module,init_type)\ + enum module##_init_type { INITIALISATION_TYPE_TAG(module) = init_type } +/*! Select 0-fill initialisation for module state instance */ +#define SELECT_ZERO_INITABLE(module)\ + SELECT_INITIALISATION_TYPE(module,ZERO_INITABLE) +/*! Select static initialisation for the module's state instance */ +#define SELECT_STATIC_INITABLE(module)\ + SELECT_INITIALISATION_TYPE(module,STATIC_INITABLE) +/*! Select user-defined initialisation for the module's state instance */ +#define SELECT_USER_INITABLE(module)\ + SELECT_INITIALISATION_TYPE(module,USER_INITABLE) +/*! Is module state in static storage ? */ +#define IS_STATIC(module) (STORAGE_TYPE_TAG(module) == STATE_STATIC) +/*! Is module zero-initialisable? */ +#define IS_ZERO_INITABLE(module)\ + (INITIALISATION_TYPE_TAG(module) == ZERO_INITABLE) +/*! Has module a static initialiser? */ +#define HAS_STATIC_INITIALISER(module)\ + (INITIALISATION_TYPE_TAG(module) == STATIC_INITABLE) +/*! Has module user-defined initialisation and finalisation? */ +#define HAS_USER_INIT(module) (INITIALISATION_TYPE_TAG(module) == USER_INITABLE) +/*! Declare handles to module's global and public state + * when state is in dynamic storage + */ +#define DECL_DYNAMIC_STATE(module)\ + STATE_T(module) * HANDLE(module) = NULL;\ + PUBLIC_STATE_T(module) * PUBLIC_HANDLE(module) = NULL + +/*! Declare module's state in static storage, with handles to global and + * public state. + */ +#define DECL_STATIC_STATE(module)\ + static STATE_T(module) STATE(module);\ + STATE_T(module) * HANDLE(module) = &STATE(module);\ + PUBLIC_STATE_T(module) * PUBLIC_HANDLE(module) =\ + (PUBLIC_STATE_T(module) *)&STATE(module) + +/*! Extern declaration of generated module initialising function */ +#define IMPORT_INITOR(module) extern DECL_INITOR(module) +/*! Extern declaration of generated module finalsing function */ +#define IMPORT_FINITOR(module) extern DECL_FINITOR(module) + +/*! Extern declaration of handle to module's public state */ +#define IMPORT_STATE(module)\ +extern PUBLIC_STATE_T(module) * PUBLIC_HANDLE(module) + +/*! Get the value of a field from the module's global state, accessed through + * the module's handle. + */ +#define GET_STATE_BY_HANDLE(module,field)\ + (assert(true),HANDLE(module)->field) + +/*! Reference a field in the module's global state, accessed through the the + * the module's handle. + */ +#define SET_STATE_BY_HANDLE(module,field) (HANDLE(module)->field) + +/*! Get the value of a field from the module's global static state. + * Quicker than \c GET_STATE_BY_HANDLE for a statically implemented module. + */ +#define GET_STATIC_STATE(module,field) (assert(true),STATE(module).field) + +/*! Reference a field in the module's global static state. + * Quicker than \c SET_STATE_BY_HANDLE for a statically implemented mdoule + */ +#define SET_STATIC_STATE(module,field) (STATE(module).field) + +/*! Define the generated module initialisation function \c INITOR(module) */ +#define DEFINE_INITOR(module)\ +DECL_INITOR(module) {\ + module_initor(\ + IS_STATIC(module),\ + IS_ZERO_INITABLE(module),\ + (void **)(char *)&HANDLE(module),\ + (void **)(char *)&PUBLIC_HANDLE(module),\ + STATIC_INITIALISER_HANDLE(module),\ + sizeof(STATE_T(module)),\ + USER_INIT_HANDLE(module));\ +} + +/*! Define the generated module finalisation function \c FINITOR(module) */ +#define DEFINE_FINITOR(module)\ +DECL_FINITOR(module) {\ + module_finitor(\ + IS_STATIC(module),\ + (void **)(char *)&HANDLE(module),\ + (void **)(char *)&PUBLIC_HANDLE(module),\ + USER_INIT_HANDLE(module));\ +} + +/*! Initialise a module's global state + * \param is_static Is the module's global state in static storage? + * \param is_zero_initable Is the module's global state zero-initialisable? + * \param state Pointer to a pointer to the module's global state. + * \param public_state Pointer to a pointer to the module's public + * state. + * \param initialiser \c NULL, otherwise a pointer to a constant + * initialiser for the module's global state. + * \param size The size of the module's global state. + * \param user_init \c NULL, otherwise a pointer to a user-supplied + * function to initialise the module's global + * state. + * If \c is_static is false, the function asserts that *state == NULL + * and then assigns to \c *state a heap block of \c size bytes. + * + * Otherwise, \c state is assumed to address the module's global state in + * static storage. + * + * Then, if \c is_zero_initable is true, the module's state is 0-filled. + * + * Otherwise, if initialiser != NULL, the \c size bytes at + * \c initialiser are copied to \c *state. + * + * Otherwise, the function asserts that user_init != NULL, and + * then calls \c user_init(*state) + */ +extern void +module_initor( + bool is_static, + bool is_zero_initable, + void **state, + void **public_state, + void const *initialiser, + size_t size, + void (*user_init)()); + +/*! Finalise a module's global state + * \param is_static Is the module's global state in static storage? + * \param state Pointer to a pointer to the module's global state. + * \param public_state Pointer to a pointer to the module's public + * state. + * \param user_finis \c NULL, otherwise a pointer to a user-supplied + * function to finalise the module's global + * state. + * If user_init != NULL, the function asserts that + * *state != NULL and then calls \c user_init(*state) + * + * Otherwise, \c state is assumed to address the module's global state in + * static storage. + * + * Then, if \c is_static is false, the function again asserts that + * *state != NULL, then calls \c free(*state), and sets + * *public_state = *state = NULL + * + */ +extern void +module_finitor( + bool is_static, + void **state, + void **public_state, + void (*user_finis)()); + +/*@}*/ + +/*! \addtogroup state_utils_user_macros + +

The State Utils macros

+ + Macros are provided to define a module's global state structure, and + optionally create a public state structure as part of the global + state, for exporting to the module's clients. + + Macros are provided to create the module's state structure + statically or dynamically (on the heap). Options are provided to specify + that the structure is zero-initialisable, or has a constant static + initialiser, or is to be initialised and finalised by + user-defined functions. + + Using the macros: + +
    +
  • +

    In my_module.h:

    +
      +
    • +

      Define the module's public state:

      + + +
      +
      +PUBLIC_STATE_DEF(my_module) {
      +	int field1;
      +	int field2;
      +	...
      +} PUBLIC_STATE_T(my_module);
      +
      +
    • +
      +
    • +

      Import the module's extern declarations:

      + + +
      + IMPORT(my_module); +
      +
    • +
    • +

      Or, where the module has no state:

      + + +
      +
      +IMPORT_INITOR(my_module);
      +IMPORT_FINITOR(my_module);
      +
      +
    • +
    +
  • +
    +
  • +

    In my_module.c:

    +
      +
    • +

      Define the module's gobal state:

      + + +
      +
      +STATE_DEF(my_module) {
      +	INCLUDE_PUBLIC(my_module); // Must be first
      +	int field3;
      +	int field4;
      +	...
      +STATE_T(my_module);
      +
      +
    • +
      +
    • +

      + If the module has no public state then the + \c STATE_DEF will instead be: +

      + + +
      +
      +STATE_DEF(my_module) {
      +	int field1;
      +	int field2;
      +	...
      +STATE_T(my_module);
      +NO_PUBLIC_STATE(my_module);
      +
      +
    • +
      +
    • +

      + If the module has no private state then instead of + the \c STATE_DEF you need: +

      + + +
      + NO_PRIVATE_STATE(my_module); +
      +
    • +
      +
    • +

      + Define my_module's state as static and + zero-initialisable: +

      + + +
      + + IMPLEMENT_STATIC(my_module,ZERO_INITABLE); + +
      +
    • +
      +
    • +

      Or static with constant initialiser:

      + + +
      +
      +IMPLEMENT_STATIC(my_module,STATIC_INITABLE);
      +USE_STATIC_INITIALISER(my_module) = { { 1, 2,...}, 3, 4... };
      +
      +
    • +
      +
    • +

      Or static with initialising and finalising functions:

      + + +
      +
      +IMPLEMENT_STATIC(my_module,USER_INITABLE);
      +
      +DEFINE_USER_INIT(my_module)(STATE_T(my_mdoule) * statep)
      +{
      +	...
      +}
      +
      +DEFINE_USER_FINIS(my_module)(STATE_T(my_module) * statep)
      +{
      +	...
      +}
      +
      +
    • +
      +
    • +

      + If you implement \c my_module with the + \c USER_INITABLE option, you must define functions to + intialise and finalise the state structure with + \c DEFINE_USER_INIT and \c DEFINE_USER_FINIS. +

      +
    • +
      +
    • +

      + Instead of \c IMPLEMENT_STATIC you may use + \c IMPLEMENT_DYNAMIC to have the module's state structure + allocated on the heap. +

      +
    • +
      +
    • +

      + Alternatively you can just use \c IMPLEMENT. + If you define \c DEFAULT_STATIC_STATE to the compiler, + \c IMPLEMENT is short for \c IMPLEMENT_STATIC; otherwise + it is short for \c IMPLEMENT_DYNAMIC. +

      +
    • +
    +
  • +

    Initialising and cleaning up module state:

    +
      +
    • +

      + Before you can safely access any fields in the module's + state structure you must call: +

      + + +
      + INITIALISE(my_module); +
      +
    • +
    • +

      + If you every need to dispose of the state structure you + must call: +

      + + +
      + FINALISE(my_module); +
      +
    • +
    • +

      You can reinitialise the state structure by calling:

      + + +
      + REINITIALISE(my_module); +
      +
    • +
    +
  • +
    +
  • +

    Accessing module state:

    +
      +
    • +

      + Wherever the module's public state is visible, a field + can be referenced like this: +

      + + +
      + val = GET_PUBLIC(my_module,field); +
      +
      +

      and can be set like this:

      + + +
      + SET_PUBLIC(my_module,field) = val; +
      +
    • +
      +
    • +

      + Wherever the module's global state is visible, a field + can be referenced like this: +

      + + +
      + val = GET_STATE(my_module,field); +
      +
      +

      and set like this:

      + + +
      + SET_STATE(my_module,field) = val; +
      +
    • +
    +
  • +
+ + Generated symbols (for debugging): + + Symbols that can be generated by the + macros for a module \c my_module are: + + - struct my_module_state_s + - my_module_state + - The module's global state structure. + - \b Note: This symbol will exist if the module is implemented + statically. + + - typedef struct my_module_state_s + - my_module_state_t + + - struct my_module_public_state_s + - my_module_public_state + - The module's public state structure. + - \b Note: This symbol will exist if the module is implemented statically. + + - typedef struct my_module_public_state_s + - my_module_public_state_t + + - struct my_module_state_s * + - my_module_h + - Pointer to the module's global state. + - \b Note: This symbol will \em always address the module's global + state, if it has any. + + - struct my_module_public_state_s * + - my_module_public_h + - Pointer to the module's public state. + - \b Note: This symbol will \em always address the module's public + state, if it has any. + + - void my_module_init(my_module_state_s *statep) + - Mandatory name of user-supplied module initialising function, if any. + You must define this function if you specify the module with the + \c \b USER_INITABLE attribute. You can use the macro \c \b + DEFINE_USER_INIT(my_module) to compose the mandatory signature + for this function. + + - void my_module_finis(my_module_state_s *statep) + - Mandatory name of user-supplied module finalising function, if any. + You must define this function if you specify the module with the + \c \b USER_INITABLE attribute. You can use the macro \c \b + DEFINE_USER_FINIS(my_module) to compose the mandatory signature + for this function. + - \b Note: \c my_module_init() and \c my_module_finis() do not need to + control storage for the module's state structure. They can + the assume the argument \c statep addresses that structure and need only + initialise and finalise the elements of the structure. + + - void (*my_module_init_h)(my_module_state_s *) + - If you specify the module with the \c \b USER_INITABLE attribute, + this function pointer will be set to the address of \c my_module_init() + and will otherwise be \c NULL. + + - void (*my_module_finis_h)(my_module_state_s *) + - If you specify the module with \c \b USER_INITABLE, this function + pointer will be set to the address of \c my_module_finis() + and will otherwise be \c NULL. + + - const struct my_module_state_s + - my_module_static_initialiser + - Mandatory name of the module's constant static initialiser, + if any. You can use the macro \c USE_STATIC_INITIALISER(my_module) + to compose the mandatory declaration. + + - const struct my_module_state_s * + - const my_module_static_initialiser_h + - If you specify the module with \c \b HAS_STATIC_INITIALISER, this + pointer will be set to the address of \c my_module_static_initialiser + and will otherwise be \c NULL. + +*/ + + +/*! \addtogroup state_utils_impl_macros */ +/*@{*/ + +/*! The storage type of the module's state */ +enum module_storage_type { + STATE_STATIC, + /*!< Module's state is in static storage */ + STATE_DYNAMIC + /*!< Module's state is in dynamic storage */ +}; + +/*! The initialisation type of the module's state */ +enum module_initialisation_type { + ZERO_INITABLE, + /*!< Module is zero-initialisable */ + STATIC_INITABLE, + /*!< Module has a constant static initialiser */ + USER_INITABLE + /*!< Module has user-defined initialisation and finalisation + functions */ +}; + + +/*! Implement the module's state in static storage + * \param module Name of the module + * \param init_type Type of module initialisation. One of: + * - \c ZERO_INITABLE + * - \c STATIC_INITABLE + * - \c USER_INITABLE + */ +#define IMPLEMENT_STATIC(module,init_type)\ + DECL_STATIC_STATE(module);\ + SELECT_STATIC(module);\ + SELECT_INITIALISATION_TYPE(module,init_type);\ + DECL_STATIC_INITIALISER_HANDLE(module);\ + DECL_USER_INIT_HANDLE(module);\ + DECL_USER_FINIS_HANDLE(module);\ + DEFINE_INITOR(module)\ + DEFINE_FINITOR(module) + +/*! Implement the module's state in dynamic storage + * \param module Name of the module + * \param init_type Type of module initialisation. One of: + * - \c ZERO_INITABLE + * - \c STATIC_INITABLE + * - \c USER_INITABLE + */ +#define IMPLEMENT_DYNAMIC(module,init_type)\ + DECL_DYNAMIC_STATE(module);\ + SELECT_DYNAMIC(module);\ + SELECT_INITIALISATION_TYPE(module,init_type);\ + DECL_STATIC_INITIALISER_HANDLE(module);\ + DECL_USER_INIT_HANDLE(module);\ + DECL_USER_FINIS_HANDLE(module);\ + DEFINE_INITOR(module)\ + DEFINE_FINITOR(module) + /* Implement the module's state dynamically */ + +#ifdef DEFAULT_STATIC_STATE +/*! Abbreviate \c IMPLEMENT_STATIC as \c IMPLEMENT when \c DEFAULT_STATIC_STATE + * is defined. + */ +#define IMPLEMENT(module,init_type) IMPLEMENT_STATIC(module,init_type) +#else +/*! Abbreviate \c IMPLEMENT_DYNAMIC as \c IMPLEMENT when \c DEFAULT_STATIC_STATE + * is not defined. + */ +#define IMPLEMENT(module,init_type) IMPLEMENT_DYNAMIC(module,init_type) +#endif + +/*! Declare a static initialiser for the module. + * \param module The name of the module. + * The macro invocation should be immediately followed by the + * specification of the static initialiser: + * + * - USE_STATIC_INITIALISER(module) = {...}; + * + * The static initialiser will be copied into the module's global + * state instance whenever \c INITIALISE(module) is invoked. + */ +#define USE_STATIC_INITIALISER(module)\ + DECL_STATIC_INITIALISER(module);\ + DECL_STATIC_INITIALISER_HANDLE(module) = &STATIC_INITIALISER(module);\ + DECL_STATIC_INITIALISER(module) + +/*! Define a user initialisation function for module. + * \param module Name of the module. + * The function body should be written immediately after the macro invocation: + * + * - DEFINE_USER_INIT(module){...}; + * + * The macro generates the function signature: + * + * - void USER_INIT(module)(STATE_T(module) *) + * + * A user initialisation function must be defined if the module is implemented + * with initialisation type \c USER_INITABLE. The user initialisation + * function \c USER_INIT(module) should not be confused with the + * generated module initialisation function \c INITOR(module). + * \c USER_INIT(module) does not need to provide storage for the module's + * state. It can assume that storage is addressed by the + * STATE_T(module) * argument and need only initialise the + * the elements of the state structure. + */ +#define DEFINE_USER_INIT(module)\ + DECL_USER_INIT(module);\ + DECL_USER_INIT_HANDLE(module) = &USER_INIT(module);\ + void USER_INIT(module) /* ...user_init function body here */ + +/*! Define a user finalisation function for module. + * \param module Name of the module. + * The function body should be written immediately after the macro invocation: + * + * - DEFINE_USER_FINIS(module){...}; + * + * The macro generates the function signature: + * + * - void USER_FINIS(module)(STATE_T(module) *) + * + * A user finalisation function must be defined if the module is implemented + * with initialisation type \c USER_INITABLE. The user finalisation + * function \c USER_FINIS(module) should not be confused with the + * generated module finalisation function \c FINITOR(module). + * \c USER_FINIS(module) does not need to destroy storage for the module's + * state, even if the module is implemented dynamically. That dynamic + * storage will be disposed of by \c FINITOR(module). \c USER_FINIS(module) + * need only finalise the elements of the state structure. + */ +#define DEFINE_USER_FINIS(module)\ + DECL_USER_FINIS(module);\ + DECL_USER_FINIS_HANDLE(module) = &USER_FINIS(module);\ + void USER_FINIS(module) /* ... user_finis function body here */ + +/*! Invoke this macro immediately after opening \c STATE_DEF(module) to place + * the public state instance at the start of the state instance. It must be + * invoked at that position if the module has public as well as private + * state. + * \param module Name of the module + */ +#define INCLUDE_PUBLIC(module) PUBLIC_STATE_T(module) PUBLIC_STATE(module) + +/*! Invoke this macro in a module's implementation file to open the definition + * of the module's global state structure: + * + * - STATE_DEF(module) {...} + * + * \param module Name of the module + */ +#define STATE_DEF(module) typedef struct module##_state_s + +/*! Invoke this macro in a module's implementation file to close the definition + * of the module's global state: + * + * - STATE_DEF(module){...} STATE_T(module); + * + * \param module Name of the module + */ +#define STATE_T(module) module##_state_t + +/*! Invoke this macro in a module's implementation file in place of + * \c STATE_DEF(module) to say that the module's global state is simply its + * public state (if any ). + * \param module Name of the module + */ +#define NO_PRIVATE_STATE(module)\ + typedef PUBLIC_STATE_T(module) STATE_T(module) + +#ifdef DEFAULT_STATIC_STATE + /*! Abbreviate \c GET_STATIC_STATE as \c GET_STATE when + * \c DEFAULT_STATIC_STATE is defined. + * + * Invoke this macro in the module's implementation file to + * evaluate a field in the module's global state. If the + * field also belongs to the module's public state, then + * prefer \c GET_PUBLIC. + */ + #define GET_STATE(module,field) GET_STATIC_STATE(module,field) + /*! Abbreviate \c SET_STATIC_STATE as \c SET_STATE when + * \c DEFAULT_STATE_STATIC is defined. + * + * Invoke this macro in the module's implementation file to + * code an assignable reference to a field in the module's global state. + * + * - SET_STATE(module,field) = value; + * + * \param module Name of the module + * \param field Name of the field to be evaluated in the module's state. + * + * If the field also belongs to the module's public state, then + * prefer \c SET_PUBLIC. + */ + #define SET_STATE(module,field) SET_STATIC_STATE(module,field) +#else + /*! Abbreviate \c GET_STATE_BY_HANDLE_ as \c GET_STATE when + * \c DEFAULT_STATIC_STATE is not defined. + * + * Invoke this macro in the module's implementation file to + * evaluate a field in the module's global state. + * + * \param module Name of the module + * \param field Name of the field to be evaluated in the module's state. + * + * If the field also belongs to the module's public state, then + * prefer \c GET_PUBLIC. + */ + #define GET_STATE(module,field) GET_STATE_BY_HANDLE(module,field) + /*! Abbreviate \c SET_STATE_BY_HANDLE as \c SET_STATE when + * \c DEFAULT_STATIC_STATE is not defined. + * + * Invoke this macro in the module's implementation file to + * code an assignable reference to a field in the module's global state. + * + * - SET_STATE(module,field) = value; + * + * \param module Name of the module + * \param field Name of the field to be evaluated in the module's state. + * + * If the field also belongs to the module's public state, then + * prefer \c SET_PUBLIC. + */ + #define SET_STATE(module,field) SET_STATE_BY_HANDLE(module,field) +#endif + + +/*@}*/ + +/*! \addtogroup state_utils_hdr_macros */ +/*@{*/ + +/*! Invoke this macro in a module's header file to open the definition + * of the module's public state structure: + * + * - PUBLIC_STATE_DEF(module) {...} + * + * \param module Name of the module + */ +#define PUBLIC_STATE_DEF(module) typedef struct module##_public_state_s + +/*! Invoke this macro in a module's header file to close the definition + * of the module's public state: + * + * - PUBLIC_STATE_DEF(module){...} PUBLIC_STATE_T(module); + * + * \param module Name of the module + */ +#define PUBLIC_STATE_T(module) module##_public_state_t + +/*! Invoke this macro in a module's header file in place of + * \c PUBLIC_STATE_DEF(module) to say that the module's global state is simply + * its private state (if any ). + * + * \param module Name of the module + */ +#define NO_PUBLIC_STATE(module)\ +typedef STATE_T(module) PUBLIC_STATE_T(module) + +/*! Invoke this macro in a module's header file to expose the module's public + * state and its generated initialisation and finalisation functions. + * + * \param module Name of the module + */ +#define IMPORT(module)\ + IMPORT_STATE(module);\ + IMPORT_INITOR(module);\ + IMPORT_FINITOR(module) + +/*@}*/ + +/*! \ingroup state_utils_user_macros + * \name Macros for module client code. + */ +/*@{*/ + +/*! Initialise the module's state - appropriately whether static or dynamic, + * zero-initialisable, static-initialisable, user-initialisable. + * \param module Name of the module + */ +#define INITIALISE(module) INITOR(module)() + +/*! Finalise the module's state - appropriately whether static or dynamic, + * user-finalised or not. + * \param module Name of the module + */ +#define FINALISE(module) INITOR(module)() + +/*! Finalise and then initialise the module's state appropriately + * \param module Name of the module + */ +#define REINITIALISE(module)\ + (void)(FINALISE(module),INITIALISE(module)) + +/*! Invoke this macro in client code file to evaluate a field in the + * module's public state. + * \param module Name of the module + * \param field Name of the field to be evaluated in the module's state. + */ +#define GET_PUBLIC(module,field)\ + (assert(true),(PUBLIC_HANDLE(module)->field)) + +/*! Invoke this macro in client code file to code an assignable + * reference to a field in the module's public state: + * + * - SET_PUBLIC(module,field) = value; + * + * \param module Name of the module + * \param field Name of the field to be evaluated in the module's state. + */ +#define SET_PUBLIC(module,field) (PUBLIC_HANDLE(module)->field) + + +#endif + +/*@}*/ + +/* EOF */ diff --git a/src/symbol_table.c b/src/symbol_table.c new file mode 100755 index 0000000..973d08c --- /dev/null +++ b/src/symbol_table.c @@ -0,0 +1,164 @@ +/*************************************************************************** + * Copyright (C) 2004, 2006 Symbian Software Ltd. * + * All rights reserved. * + * Copyright (C) 2007, 2008 Mike Kinghan, imk@strudl.org * + * All rights reserved. * + * * + * Contributed originally by Mike Kinghan, imk@strudl.org * + * * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * Redistributions of source code must retain the above copyright * + * notice, this list of conditions and the following disclaimer. * + * * + * Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * * + * Neither the name of Symbian Software Ltd. nor the names of its * + * contributors may be used to endorse or promote products derived from * + * this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,* + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * + * DAMAGE. * + * * + ***************************************************************************/ +#include "symbol_table.h" +#include "chew.h" +#include "args.h" +#include "report.h" +#include +#include + +/*!\ingroup symbol_table_module, symbol_table_interface, symbol_table_internals + *\file symbol_table.c + * This file implements the Symbol Table module + */ + +/*!\ingroup symbol_table_internals_state_utils */ +/*@{*/ +NO_PRIVATE_STATE(symbol_table); +/*@}*/ + +/*!\addtogroup symbol_table_internals_state_utils */ +/*@{*/ +IMPLEMENT(symbol_table,USER_INITABLE); + +DEFINE_USER_INIT(symbol_table)(STATE_T(symbol_table) * sym_state) +{ + sym_state->sym_tab = ptr_vector_new(); +} + +DEFINE_USER_FINIS(symbol_table)(STATE_T(symbol_table) * sym_state) +{ + ptr_vector_dispose(&(sym_state->sym_tab)); +} +/*@}*/ + +/* API ***************************************************************/ + +int +find_sym(char *str, char ** end) +{ + char *cp; + const char *name = NULL; + const char *def = NULL; + size_t symind; + int comp; + size_t symbols = ptr_vector_count(GET_STATE(symbol_table,sym_tab)); + + cp = chew_sym(str); + if (end) { + *end = cp; + } + if (cp == str) { + bail( GRIPE_NOT_IDENTIFIER, + "Identifier needed instead of \"%s\"", + str); + } + for (comp = 1, symind = 0; symind < symbols; ++symind) { + ptrdiff_t len; + eval_result_t * pos = SYMBOL(symind); + name = pos->sym_name; + def = pos->sym_def; + len = cp - str; + comp = strncmp(str,name,len); + if (comp <= 0) { + if (comp == 0) { /* Initial match */ + if (name[len] != '\0') { + /* Symbol in table is longer than `str' */ + comp = -1; + } + /* Otherwise full match */ + } + break; + } + } + if (comp == 0) { + debug(DBG_18, name, (def ? def : "")); + return (int)symind; + } + return (int)~symind; +} + +void +add_specified_symbol(bool definethis, char *sym) +{ + char *val; + eval_result_t *symbol; + int ind = find_sym(sym,&val); + if (ind < 0) { + symbol = allocate(sizeof(eval_result_t)); + symbol->sym_name = allocate((val - sym) + 1); + memcpy(symbol->sym_name,sym,val-sym); + if (definethis) { /* -D */ + if (*val == '=') { + size_t val_len = strlen(val + 1); + symbol->sym_def = allocate(val_len + 1); + memcpy(symbol->sym_def,val + 1,val_len); + } + else if (*val == '\0') { + symbol->sym_def = ""; + } + else { /* Invalid */ + bail(GRIPE_GARBAGE_ARG,"Garbage in argument \"%s\"",sym - 2); + } + } + else { /* -U */ + if (*val != '\0') { /* Invalid */ + bail(GRIPE_GARBAGE_ARG,"Garbage in argument \"%s\"",sym - 2); + } + symbol->sym_def = NULL; + } + ptr_vector_insert(GET_STATE(symbol_table,sym_tab),~ind,symbol); + } + else { + /* Duplicate arg */ + bad_args_error(sym,val,ind); + } +} + +extern void +add_unknown_symbol(int at, char const *name, size_t namelen) +{ + eval_result_t *elem; + elem = allocate(sizeof(eval_result_t)); + elem->sym_name = allocate(namelen + 1); + memcpy(elem->sym_name,name,namelen); + ptr_vector_insert(GET_STATE(symbol_table,sym_tab),at,elem); +} + + +/* EOF */ diff --git a/src/symbol_table.h b/src/symbol_table.h new file mode 100755 index 0000000..0b592f1 --- /dev/null +++ b/src/symbol_table.h @@ -0,0 +1,118 @@ +#ifndef SYMBOL_TABLE_H +#define SYMBOL_TABLE_H + +/*************************************************************************** + * Copyright (C) 2004, 2006 Symbian Software Ltd. * + * All rights reserved. * + * Copyright (C) 2007, 2008 Mike Kinghan, imk@strudl.org * + * All rights reserved. * + * * + * Contributed originally by Mike Kinghan, imk@strudl.org * + * * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * Redistributions of source code must retain the above copyright * + * notice, this list of conditions and the following disclaimer. * + * * + * Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * * + * Neither the name of Symbian Software Ltd. nor the names of its * + * contributors may be used to endorse or promote products derived from * + * this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,* + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF * + * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * + * DAMAGE. * + * * + ***************************************************************************/ + +#include "opts.h" +#include "ptr_vector.h" +#include "evaluator.h" +#include + +/*!\ingroup symbol_table_interface + *\file symbol_table.h + * This file provides the Symbol Table module interface + */ + +/*!\addtogroup symbol_table_interface */ +/*@{*/ + +/*! Get a pointer the symbol with a given index in the symbol table. + * \param ind Index into the symbol table. + */ +#define SYMBOL(ind)\ + ((eval_result_t *)ptr_vector_at(GET_PUBLIC(symbol_table,sym_tab),ind)) + +/*! Test whether a character can occur in a symbol + * \param ch The character to test. + */ +#define symchar(ch) \ + (isalnum((unsigned)ch) || (ch) == '_') + +/*! Lookup an identifier in the symbol table. + * \param str Start of the identifier to match with symbols in the table. + * \param end Either null or a pointer at which the address just past + * the end of the identifier will be stored. + * \return The index of the symbol in the symbol table, if + found. Otherwise the value ~N, where N is the + index at which the unmatched symbol should be + inserted. + */ +extern int +find_sym(char *str, char ** end); + +/*! Add a symbol with specified attributes to the symbol table. + \param definethis Is this symbol deemed to be defined, or undefined? + \param sym Null-terminated symbol to be added. + + This function is called to add symbols that are specified + as defined or undefined. +*/ +extern void +add_specified_symbol(bool definethis, char *sym); + +/*! Add a symbol without specified attributes to the symbol table. + \param at The position at which the symbol is to be + inserted in the symbol table. + \param name The start of the symbol/ + \param namelen The length of the symbol. + + This function is called to add symbols that are parsed + from \c #if expressions and found to be unknown. +*/ +extern void +add_unknown_symbol(int at, char const *name, size_t namelen); + +/*@}*/ + +/*!\ingroup symbol_table_interface_state_utils */ +/*@{*/ +/*! The public state of the Symbol Table module */ +PUBLIC_STATE_DEF(symbol_table) { + ptr_vector_h sym_tab; + /*!< Handle to the symbol table */ +} PUBLIC_STATE_T(symbol_table); +/*@}*/ + +/*!\addtogroup symbol_table_interface_state_utils */ +/*@{*/ +IMPORT(symbol_table); +/*@}*/ + + +#endif /* EOF */ diff --git a/test_sunifdef/Makefile.am b/test_sunifdef/Makefile.am new file mode 100644 index 0000000..dc793c7 --- /dev/null +++ b/test_sunifdef/Makefile.am @@ -0,0 +1,2 @@ +TESTS_ENVIRONMENT = SUNIFDEF_PKGDIR=$(top_srcdir) perl -Mstrict -I $(top_srcdir)/perl -w +TESTS = sunifdef_case_tester.pl sunifdef_bulk_tester.pl sunifdef_softlink_tester.pl \ No newline at end of file diff --git a/test_sunifdef/Makefile.in b/test_sunifdef/Makefile.in new file mode 100644 index 0000000..9d96da6 --- /dev/null +++ b/test_sunifdef/Makefile.in @@ -0,0 +1,397 @@ +# Makefile.in generated by automake 1.10 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006 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@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = test_sunifdef +DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +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@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_F77 = @ac_ct_F77@ +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@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +TESTS_ENVIRONMENT = SUNIFDEF_PKGDIR=$(top_srcdir) perl -Mstrict -I $(top_srcdir)/perl -w +TESTS = sunifdef_case_tester.pl sunifdef_bulk_tester.pl sunifdef_softlink_tester.pl +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test_sunifdef/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign test_sunifdef/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +check-TESTS: $(TESTS) + @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \ + srcdir=$(srcdir); export srcdir; \ + list=' $(TESTS) '; \ + if test -n "$$list"; then \ + for tst in $$list; do \ + if test -f ./$$tst; then dir=./; \ + elif test -f $$tst; then dir=; \ + else dir="$(srcdir)/"; fi; \ + if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *$$ws$$tst$$ws*) \ + xpass=`expr $$xpass + 1`; \ + failed=`expr $$failed + 1`; \ + echo "XPASS: $$tst"; \ + ;; \ + *) \ + echo "PASS: $$tst"; \ + ;; \ + esac; \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *$$ws$$tst$$ws*) \ + xfail=`expr $$xfail + 1`; \ + echo "XFAIL: $$tst"; \ + ;; \ + *) \ + failed=`expr $$failed + 1`; \ + echo "FAIL: $$tst"; \ + ;; \ + esac; \ + else \ + skip=`expr $$skip + 1`; \ + echo "SKIP: $$tst"; \ + fi; \ + done; \ + if test "$$failed" -eq 0; then \ + if test "$$xfail" -eq 0; then \ + banner="All $$all tests passed"; \ + else \ + banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ + fi; \ + else \ + if test "$$xpass" -eq 0; then \ + banner="$$failed of $$all tests failed"; \ + else \ + banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ + fi; \ + fi; \ + dashes="$$banner"; \ + skipped=""; \ + if test "$$skip" -ne 0; then \ + skipped="($$skip tests were not run)"; \ + test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$skipped"; \ + fi; \ + report=""; \ + if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ + report="Please report to $(PACKAGE_BUGREPORT)"; \ + test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$report"; \ + fi; \ + dashes=`echo "$$dashes" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + test -z "$$skipped" || echo "$$skipped"; \ + test -z "$$report" || echo "$$report"; \ + echo "$$dashes"; \ + test "$$failed" -eq 0; \ + else :; fi + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-exec-am: + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-TESTS check-am clean clean-generic \ + clean-libtool distclean distclean-generic distclean-libtool \ + distdir dvi dvi-am html html-am info info-am install \ + install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + uninstall uninstall-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/test_sunifdef/README b/test_sunifdef/README new file mode 100644 index 0000000..69ad36c --- /dev/null +++ b/test_sunifdef/README @@ -0,0 +1,20 @@ +Testing Sunidef +=============== + +By running `make check' or `make test_sunifdef' in this directory you can +build the program test_sunifdef. + +You can use test_sunifdef to supply a test case to sunifdef and compare the +output with what you expect. + +Run `test_sunifdef --help' to see the usage of test_sunifdef. + +The subdirectory test_cases contains test cases represented by pairs of files: +testNNNN.c (the test file) and testNNNN.c.expect (the expected output file) + +The script test_set_1.sh will run test_sunifdef for all the test cases in the +test_cases directory. Run `test_set_1.sh -h' to see the usage of the script. + +The script collate_tests.sh will collate all the test cases into a single file, +sunifdef_test_cases.c, for easier inspection. Each test file testNNNN.c is +listed followed by the expected file testNNNN.c.expect. diff --git a/test_sunifdef/scrap_dir_tree.pl b/test_sunifdef/scrap_dir_tree.pl new file mode 100755 index 0000000..365a25f --- /dev/null +++ b/test_sunifdef/scrap_dir_tree.pl @@ -0,0 +1,155 @@ +#!/usr/bin/perl + +use strict; +use Getopt::Long; +use File::Path; +use File::Spec; +use File::Copy; +use SunifdefLib; + +my $depth; +my $breadth; +my $rootname = 'scrap'; +my $wipe, +my $seed; +my $help; +my $verbosity; +my %optmap = ( 'depth' => \$depth, + 'breadth' => \$breadth, + 'rootname' => \$rootname, + 'wipe' => \$wipe, + 'seed' => \$seed, + 'help' => \$help, + 'verbosity' => \$verbosity); +my $prog = "scrap_dir_tree"; +my @alphabet = ( 'a'..'z','A'..'Z','0'..'9','_' ); + +set_prog($prog); +set_usage( "$prog: - Create a random structure of randomly named directories\n" . + "Usage:\n" . + "$prog --depth NUMBER --breadth] NUMBER " . + "[--rootname DIRNAME] [--wipe] [--seed NUMBER] [--verbosity=LEVEL] [FILE...]\n" . + "$prog --help\n" . + "Arguments:\n" . + "-h | --help Display this information on stdout.\n" . + "created in any directory.\n" . + "-r | rootname The name of the root directory of the tree. " . + "Default \"scrap\". Must not already exist unless --wipe is specified.\n" . + "-w | --wipe Remove the tree if it already exists.\n" . + "-b | --breadth NUMBER There will be at most NUMBER subdirectories in a directory\n" . + "-d | --depth NUMBER The structure will contain at most NUMBER levels.\n" . + "-s | --seed NUMBER Seed the pseudo random number generator with " . + "NUMBER. If not specified use implementation default.\n" . + "-v | --verbosity LEVEL Display diagnostics with severity >= LEVEL, where " . + "LEVEL = 'progress', 'info', 'warning', 'error' or 'fatal'. Default = 'progress'\n" . + "FILE... Any specified files will be copied into each created directory.\n" . + "NUMBER must in all cases be > 0.\n"); + +sub gen_dirs($$$); +sub gen_scrap_name($); + +GetOptions( \%optmap, + 'depth=i', + 'breadth=i', + 'rootname=s', + 'wipe!', + 'seed=i', + 'help!', + 'verbosity=s') or usage_error(); + +set_verbosity($verbosity); + +my @scrapfiles = <@ARGV>; + +if ($help) { + help(); + exit(0); +} + +if (defined($depth)) { + bail(1,"--depth must be > 0") unless ($depth > 0); + progress("Make max $depth levels of directories"); +} +else { + usage_error("No --depth specified"); +} +if (defined($breadth)) { + bail(1,"--breadth must be > 0") unless ($breadth > 0); + progress("Make max $depth directories per level"); +} +else { + usage_error("No --breadth specified"); +} + +if (defined($seed)) { + srand($seed); +} +else { + progress("No pseudo-random seed given: using implementation default."); +} + +if ( -d "$rootname") { + if ($wipe) { + rmtree("$rootname"); + } + else { + bail(1,"Root directory \"$rootname\" already exists"); + } +} + +progress("Creating scrap directories"); +my ($dirs_made,$files_made) = gen_dirs("$rootname",$breadth,$depth); +progress("Made $dirs_made directories, $files_made files"); +exit 0; + +sub gen_scrap_name($) +{ + my $maxlen = shift; + my $len = rand($maxlen) + 1; + $len = 26 if ($len > 26); + + my $scrap_name = ""; + foreach (1..$len) { + $scrap_name .= $alphabet[rand(@alphabet)]; + } + return $scrap_name; +} + +sub gen_dirs($$$) +{ + my ($path, $breadth, $maxdepth) = @_; + $path = File::Spec->rel2abs($path) unless File::Spec->file_name_is_absolute($path); + my $dirs_made = 0; + my $files_made = 0; + if ($breadth && $maxdepth) { + my $maxlen = 256 - length($path); + for (my $dir = 0; $dir < $breadth; ++$dir) { + my $next_path = $path; + $next_path .= '/'; + last if ($maxlen < 1); + my $dirname = gen_scrap_name($maxlen); + $next_path .= $dirname; + if (scalar(mkpath($next_path))) { + ++$dirs_made; + progress("Made directory: \"$next_path\""); + foreach my $scrapfile (@scrapfiles) { + my $file = (File::Spec->splitpath($scrapfile))[2]; + my $destfile = "$next_path/$file"; + copy($scrapfile,$destfile) or fatal("$!"); + ++$files_made; + + } + if ($maxdepth > 0) { + my ($new_dirs,$new_files) = + gen_dirs($next_path,$breadth - 1,$maxdepth - 1); + $dirs_made += $new_dirs; + $files_made += $new_files; + } + } + else { + bail(1,"Could not create directory \"$next_path\""); + } + } + } + return ($dirs_made,$files_made); +} diff --git a/test_sunifdef/sunifdef_bulk_tester.pl b/test_sunifdef/sunifdef_bulk_tester.pl new file mode 100755 index 0000000..207e0be --- /dev/null +++ b/test_sunifdef/sunifdef_bulk_tester.pl @@ -0,0 +1,326 @@ +#!/usr/bin/perl + +use strict; +use Getopt::Long; +use File::Path; +use File::Spec; +use File::Find; +use Cwd 'abs_path'; +use SunifdefLib; + +my $pkgdir; +my $execdir = "../src"; +my $depth = 4; +my $breadth = 5; +my $keep = 0, +my $seed = 987654321; +my $help; +my $verbosity = 'progress'; +my $windows_exe; +my $bail; + +my $scrapdir; +my $arg_scrapdir; +my $infiles = 0; +my @scrap_files = (); +my $sabotaged_files = 0; +my @infiles_list = (); +my $fails = 0; +my $undefs = ""; +my $stderr_file = "stderr.temp.txt"; +my $stdout_file = "stdout.temp.txt"; +my $infiles_file = "infiles.temp.txt"; +my $undefs_file = "undefs.temp.txt"; + +sub gather_scrap_file(); +sub tally_source_file(); +sub restore_backed_up_file(); +sub append_to_infile_list(); +sub run(@); +sub run_noerr(@); +sub slurp($); +sub check_test_result(@); + +my %optmap = ( 'pkgdir' => \$pkgdir, + 'execdir' => \$execdir, + 'depth' => \$depth, + 'breadth' => \$breadth, + 'keep' => \$keep, + 'seed' => \$seed, + 'help' => \$help, + 'verbosity' => \$verbosity, + 'bail' => \$bail, + 'winexe' => \$windows_exe); + +my $prog = "sunifdef_bulk_tester"; + +END { + if ( -d "$scrapdir") { + rmtree("$scrapdir") unless $keep; + } + unless($fails) { + unlink("$stderr_file") if ( -f "$stderr_file"); + unlink("$stdout_file") if ( -f "$stdout_file"); + unlink("$infiles_file") if ( -f "$infiles_file"); + unlink("$undefs_file") if ( -f "$undefs_file"); + } +} + +set_prog($prog); + +set_usage( + "$prog: Exercise sunifdef in traversing a directory tree. " . + "A roughly random tree of directories is created in PKGDIR/test_sunifdef/scrap " . + "and each directory is populated with the sunifdef source files from PKGDIR/src. " . + "The directory tree is passed into a number of sunifdef tests.\n" . + "Usage:\n" . + "$prog [--verbosity=LEVEL] [--pkgdir PKGDIR] [--execdir EXECDIR] " . + "[--breadth BREADTH] [--depth DEPTH] [--seed SEED] [--keep]\n" . + "$prog --help\n" . + "Arguments:\n" . + "-v | --verbosity LEVEL Display diagnostics with severity >= LEVEL, where " . + "LEVEL = 'progress', 'info', 'warning', 'error' or 'fatal. Default = 'progress'\n" . + "-h | --help Display this information on stdout.\n" . + "-p | --pkgdir PKGDIR The sunifdef package directory. Default '..'\n" . + "-e | --execdir EXECDIR Directory beneath PKGDIR from which to run sunidef: Default 'src'.\n " . + "-b | --breadth NUMBER There will be at most NUMBER subdirectories in a directory. Default 5.\n" . + "-d | --depth NUMBER A directory will have at most NUMBER levels of subdirectories. Default 4.\n" . + "-s | --seed NUMBER Seed the pseudo random number generator with " . + "NUMBER. Default 987654321.\n" . + "-k | --keep Do not delete the directory tree at exit.\n" . + "-b | --bail Quit at the first test failure.\n" . + "-w | --winexe The sunifdef executable is a native windows executable" . + "NUMBER must in all cases be > 0.\n" . + "BEWARE!: The size of the hierarchy grows exponentially with BREADTH and DEPTH. " . + "BREADTH = 20, DEPTH = 10 is likely to create in the order of a million files.\n"); + + +GetOptions( \%optmap, + 'pkgdir=s', + 'execdir=s', + 'depth=i', + 'breadth=i', + 'keep!', + 'seed=i', + 'help!', + 'verbosity=s', + 'bail!', + 'winexe!') or usage_error(); + +set_verbosity($verbosity); + +if ($help) { + help(); + exit(0); +} + +unless (defined($pkgdir)) { + if (defined($ENV{'SUNIFDEF_PKGDIR'})) { + $pkgdir = "$ENV{'SUNIFDEF_PKGDIR'}"; + } + else { + $pkgdir = File::Spec->updir(); + } +} + +$execdir = "$pkgdir/src" unless (defined($execdir)); + +$pkgdir = abs_path($pkgdir); +$execdir = abs_path($execdir); + +system("chmod -R +w $pkgdir") unless windows(); + +$scrapdir = "$pkgdir/test_sunifdef/scrap"; +if ($windows_exe && cygwin()) { + $arg_scrapdir = cyg2win($scrapdir); +} +else { + $arg_scrapdir = $scrapdir; +} + +# Create and populate directory structure for bulk tests +progress("*** Generating data for bulk tests. Patience! ***"); +find(\&gather_scrap_file,("$pkgdir/src")); +run_noerr("perl -Mstrict -I $pkgdir/perl -w $pkgdir/test_sunifdef/scrap_dir_tree.pl --verbosity=fatal --wipe --seed=$seed --depth=$depth --rootname=$scrapdir " . + "--breadth=$breadth @scrap_files"); + +# Count the *.c and *.h files created. +find(\&tally_source_file,($scrapdir)); +bail(1,"*** No test data found! Bailing out confused ***") if $infiles == 0; + +progress("*** Bulk Test 1: to process $infiles files ***"); +# Run sunifdef with --recurse to list all preprocessor +# symbols in .c and .h files, passing the scrap tree _twice_ +# Test that the number of files processed is the number +# of .c and .h files +run("$execdir/sunifdef --symbols first --verbose --recurse --filter c,h $arg_scrapdir $arg_scrapdir " . + "2> $stderr_file 1> $stdout_file"); +progress("*** Done ***"); +check_test_result(1); + +progress("*** Bulk Test 2: to process $infiles files ***"); +# Run sunifdef with --recurse on the scrap tree again, to +# apply --undef SYM to all .c and .h files, for symbol SYM +# that was found by the first test. + +# Build list of -U-macros for all symbols found +open IN,"<$stdout_file" or die("Cannot open file \"$stdout_file\" for reading\n"); +my $line; +while($line = ) { + chomp($line); + $undefs .= "-U$line "; +} +close(IN); +if ($windows_exe && cygwin()) { + $undefs =~ s/\r//g; +} + +run("$execdir/sunifdef $undefs --verbose --recurse --filter c,h --backup \"~\" $arg_scrapdir 2> $stderr_file"); +progress("*** Done ***"); +check_test_result(2); + +progress("*** Bulk Test 3: to process $infiles files ***"); +# Run sunifdef as per the 2nd test, but this time read all the +# file and directory names in the scrap tree from stdin. + +# Restore all the files backed up by the last test. +find(\&restore_backed_up_file,($scrapdir)); +# Push all input files onto @infile_list. +find(\&append_to_infile_list,($scrapdir)); +# List all input files to $infiles_file +open OUT,">$infiles_file" or die("Cannot open \"$infiles_file\" for writing\n"); +foreach (@infiles_list) { + print OUT "$_\n"; +} +close(OUT); +run("$execdir/sunifdef $undefs --verbose --recurse --filter c,h --backup \"~\" 2> $stderr_file < $infiles_file"); +progress("*** Done ***"); +check_test_result(3); + +progress("*** Bulk Test 4: to process $infiles files ***"); +# Run sunifdef with --recurse on the scrap tree again, this time +# reading all the --undef options of test 2 from a file. + +# Restore all the files backed up by the last test. +find(\&restore_backed_up_file,($scrapdir)); +open OUT,">$undefs_file" or die("Cannot open \"$undefs_file\" for writing\n"); +print OUT "$undefs\n"; +close(OUT); +run("$execdir/sunifdef --file $undefs_file --verbose --recurse --filter c,h --backup \"~\" $arg_scrapdir 2> $stderr_file"); +progress("*** Done ***"); +check_test_result(4); + +progress("*** Bulk Test 5: to process $infiles files ***"); +# Run sunifdef with --recurse on the scrap tree again, this time +# reading all the --undef options of test 2 from a file. + +# Restore all the files backed up by the last test. +find(\&restore_backed_up_file,($scrapdir)); + +# Sabotage many source files in the scrap tree by deleting +# all occurrences of the #endif directive. Then run sunifdef +# to traverse the scrap tree and determine that it drops all +# the sabotaged files. +# +find(\&sabotage_source_file,($scrapdir)); +progress("*** Generated $sabotaged_files invalid input files ***"); +run("$execdir/sunifdef --symbols first --verbose --keepgoing --recurse --filter c,h $arg_scrapdir 2> $stderr_file"); +progress("*** Done ***"); +check_test_result(5,"$sabotaged_files were abandoned due to parse errors"); + +exit($fails); + +sub check_test_result(@) +{ + my $fail = 0; + my ($test,$pattern) = @_; + my $stderr_text = slurp("$stderr_file"); + if ($stderr_text !~ m/info 0x11370: $infiles out of $infiles input files were reached/) { + $fail = 1; + } + if (!$fail && defined($pattern)) { + $fail = 1 if ($stderr_text !~ m/$pattern/); + } + if ($fail) { + ++$fails; + error("*** Bulk test $test: Failed! See $stderr_file ****"); + if ($bail) { + exit($fails); + } + } +} + +sub tally_source_file() +{ + my $file = $File::Find::name; + ++$infiles if ($file =~ m/\.c$/ or $file =~ m/\.h$/); +} + +sub gather_scrap_file() +{ + my $file = $File::Find::name; + push(@scrap_files,"\"$file\"") if ($file =~ m/\.h$/ or $file =~ m/\.c$/); +} + +sub restore_backed_up_file() +{ + my $file = $_; + if ($file =~ m/(.+)~$/) { + unlink ($1) or die("Cannot delete file \"$1\"\n"); + rename($file,$1) or die("Can't rename \"$file\" as \"$1\"\n"); + } +} + +sub append_to_infile_list() +{ + my $file = $File::Find::name; + $file = cyg2win($file) if ($windows_exe && cygwin()); + push(@infiles_list,"\"$file\""); +} + +sub sabotage_source_file() +{ + my $file = $_; + my $sabotaged = 0; + if ($file =~ m/\.c$/ or $file =~ m/\.h$/) { + open IN,"<$file" or die("Cannot open file \"$file\" for reading\n"); + my @lines = ; + foreach (@lines) { + if ($_ =~ m/^#endif(.*$)/) { + $_ = $1; + $sabotaged = 1; + } + } + close(IN); + open OUT,">$file" or die("Cannot open file \"$file\" for writing\n"); + print OUT @lines; + close(OUT); + $sabotaged_files += $sabotaged; + } +} + +sub run(@) +{ + my @cmd = @_; + progress("@cmd"); + my $ret = system(@cmd); + return $ret >> 8; +} + +sub run_noerr(@) +{ + my $ret = run(@_); + die("Command failed: \"@_\": $!\n") if ($ret); +} + +sub slurp($) +{ + my $terminator = $/; + open IN,"<$_[0]" or die("Cannot open file \"$_[0]\" for reading\n"); + undef $/; + my $text = ; + close(IN); + $/ = $terminator; + return $text; +} + diff --git a/test_sunifdef/sunifdef_case_tester.pl b/test_sunifdef/sunifdef_case_tester.pl new file mode 100755 index 0000000..e26c31e --- /dev/null +++ b/test_sunifdef/sunifdef_case_tester.pl @@ -0,0 +1,306 @@ +#!/usr/bin/perl + +use strict; +use Getopt::Long; +use SunifdefLib; +use File::Path; +use File::Spec; +use Cwd 'abs_path'; + +my $verbosity; +my $pkgdir; +my $execdir = "../src"; +my $help = 0; +my $bail = 0; +my $windows_exe; +my $testdir = "test_cases"; +my %optmap = ( 'verbosity' => \$verbosity, + 'pkgdir' => \$pkgdir, + 'execdir' => \$execdir, + 'help' => \$help, + 'bail' => \$bail, + 'winexe' => \$windows_exe); + +my $prog = "sunifdef_case_tester"; +my $tests = 0; +my $fails = 0; +my $passes = 0; +my @testfiles; + +sub parse_testfile($); +sub compose_test_command($$$); +sub run_test($$$$$); +sub parse_syscode_from_stderr($); +sub verify_output($$); +sub match_words($$); + +set_prog($prog); +set_usage( + "$prog: - Run a sunifdef test case\n" . + "Usage:\n" . + "$prog [--pkgdir PKGDIR] [--execdir DIR] [--verbosity=LEVEL] [--bail ] [TESTFILE...]\n" . + "$prog --help\n" . + "Arguments:\n" . + "-h | --help Display this information on stdout.\n" . + "-p | --pkgdir PKGDIR The sunifdef package directory. Default '..'\n" . + "-e | --execdir EXECDIR Directory from which to run sunidef: Default '../src'.\n " . + "-v | --verbosity LEVEL Display diagnostics with severity >= LEVEL, where " . + "LEVEL = 'progress', 'info', 'warning', 'error' or 'fatal. Default = 'progress'\n" . + "-b | --bail Bail at the first error. " . + "-w | --winexe The sunifdef executable is a native windows executable" . + "Default: Keep going through errors.\n" . + "TESTFILE\t\tThe test case specification file.\n" . + "If TESTFILE... is absent then PKGDIR/test_sunifdef/test_cases/*.c is assumed\n" . + "\tTESTFILE contains sample code on which sunifdef is to be tested. " . + "If there exists a file called TESTFILE.expect then that file contains " . + "the code that sunifdef is expected to emit from the test case. " . + "Surplus whitespace is ignored for the purpose of " . + "comparing TESTFILE with TESTFILE.expect.\n" . + "\tTESTFILE has a mandatory header comment of the form:\n" . + "\t\t/**ARGS:\n" . + "\t\t\tARGS_BODY\n" . + "\t\t*/\n" . + "where ARGS_BODY comprises the commandline options to be passed to " . + "sunifdef.\n" . + "\tOptionally, TESTFILE also has a header comment of the form:\n" . + "\t\t/**ALTFILES:\n" . + "\t\t\tFILENAME1 [FILENAME2...]\n" . + "\t\t*/\n" . + "The listed files will be input to sunifdef with the arguments " . + "ARGS_BODY instead of TESTFILE itself.\n" . + "If FILEENAMEn is relative then it is assumed to be relative to PKGDIR/test_sunifdef.\n" . + "\tOptionally, TESTFILE also has a header comment of the form:\n" . + "\t\t/**SYSCODE:\n" . + "\t\t\t[=]FLAGS\n" . + "\t\t*/\n" . + "where FLAGS is a bitset to be satisfied by the sunifdef return code " . + "from running the test case. If the prefix `=' is present then the " . + "return code must exactly match FLAGS. Otherwise the bitset " . + "is satisfied provided that all bits set in FLAGS are set in the " . + "return code. FLAGS may be a decimal numeral or an |-combination " . + "of decimal numerals.\n"); + +GetOptions(\%optmap, 'verbosity=s', 'pkgdir=s', 'execdir=s', 'help!', 'bail!', 'winexe!') or usage_error(); + +if ($help) { + help(); + exit(0); +} + +unless (defined($pkgdir)) { + if (defined($ENV{'SUNIFDEF_PKGDIR'})) { + $pkgdir = "$ENV{'SUNIFDEF_PKGDIR'}"; + } + else { + $pkgdir = File::Spec->updir(); + } +} + +$execdir = "$pkgdir/src" unless (defined($execdir)); + +$pkgdir = abs_path($pkgdir); +$execdir = abs_path($execdir); + +system("chmod -R +w $pkgdir") unless windows(); + +if (@ARGV != 0) { + @testfiles = <@ARGV>; +} +else { + @testfiles = <$pkgdir/test_sunifdef/test_cases/*.c>; +} + +$tests = @testfiles; +bail(1,"*** No tests found! ***") unless($tests); + +my $executable = "$execdir/sunifdef"; + +foreach my $testfile (@testfiles) { + my ($test_args,$test_syscode,$test_exact,$test_altfiles) = + parse_testfile($testfile); + if (!run_test( $testfile, + $test_args, + $test_syscode, + $test_exact, + $test_altfiles)) { + last if (++$fails && $bail); + } +} + +print "$fails out of $tests failed\n"; + +exit($fails); + +sub import_test_cases() +{ + my $curfile = $_; + +} + +sub parse_syscode_from_stderr($) +{ + my $stderr = shift; + my $syscode = ""; + open IN,"<$stderr" or bail(1,"*** Cannot open \"$stderr\" for reading ***"); + my $line = ""; + while ($line = ) { + chomp $line; + if ($line =~ m/exit code (0x[a-fA-F0-9]+)/) { + $syscode = $1; + last; + } + } + close(IN); + return $syscode; +} + +sub match_words($$) +{ + my ($actual_word,$expected_word) = @_; + return 1 if ($actual_word eq $expected_word); + return 0 unless ($expected_word =~ m#^\./(test_cases/(altfiles/)?test\d{4}(-\d)?\.c)(\(\d+\))$#); + my $filename = $1; + my $lineno = $4; + my $expected_len = length($expected_word) - 2; + my $actual_len = length($actual_word); + $filename =~ s#/#\\#g if ($windows_exe); + my $substring = substr($actual_word,$actual_len - $expected_len); + if (substr($actual_word,$actual_len - $expected_len) eq "$filename$lineno") { + $filename = "$pkgdir/test_sunifdef/$filename"; + if ($windows_exe) { + $filename =~ s#/#\\#g; + $filename =~ s#\\cygdrive\\(\w)\\#$1:\\#g if cygwin(); + } + return 1 if ($actual_word eq "$filename$lineno"); + } + return 0; +} + +sub verify_output($$) +{ + my ($expected_output,$output) = @_; + local $/; + open IN, "<$expected_output" or + bail(1,"*** Cannot open \"$expected_output\"for reading ***"); + my $expected_text = ; + close(IN); + open IN, "<$output" or + bail(1,"*** Cannot open \"$output\" for reading***"); + my $actual_text = ; + close(IN); + my @expected_words = split(/\s+/,"$expected_text"); + my @actual_words = split(/\s+/,"$actual_text"); + my $awords = @actual_words; + my $ewords = @expected_words; + return 0 if (@actual_words != @expected_words); + for (my $word = 0; $word < @actual_words; ++$word) { + return 0 unless + match_words($actual_words[$word],$expected_words[$word]); + } + return 1; +} + +sub run_test($$$$$) +{ + my ( $testfile, + $test_args, + $test_syscode, + $test_exact, + $test_altfiles) = @_; + + my $test_command = compose_test_command($test_args, + $testfile, + $test_altfiles); + my $syscode_correct = 0; + my $output_correct = 0; + + progress("*** Running test file \"$testfile\""); + progress("*** ARGS: $test_args"); + if ($test_altfiles) { + progress("*** ALTFILES: $test_altfiles"); + } + if ($test_exact) { + progress("*** SYSCODE: = 0x%04x",$test_syscode); + } + else { + progress("*** SYSCODE: match 0x%04x",$test_syscode); + } + + system($test_command); + my $actual_syscode = parse_syscode_from_stderr("$testfile.stderr"); + bail(1,"*** Could not parse system code from $testfile.stderr ***") unless ($actual_syscode); + $actual_syscode = hex($actual_syscode); + if ($test_exact) { + $syscode_correct = ($actual_syscode == $test_syscode); + } + else { + $syscode_correct = (($actual_syscode & $test_syscode) == $actual_syscode); + } + $output_correct = verify_output("$testfile.expect","$testfile.output"); + error("*** FAILED test file \"%s\". Unexpected system code 0x%04x", + $testfile,$actual_syscode) + unless $syscode_correct; + error( "*** FAILED test file \"$testfile\". Unexpected output") + unless $output_correct; + if ($syscode_correct && $output_correct) { + progress("*** PASSED"); + return 1; + } + return 0; +} + +sub compose_test_command($$$) +{ + my ($test_args,$testfile,$test_altfiles) = @_; + my $testfiles = $testfile; + if ($test_altfiles) { + my @altfiles = split(/\s/,$test_altfiles); + print "@altfiles\n"; + foreach (@altfiles) { + $_ = File::Spec->rel2abs($_,"$pkgdir/test_sunifdef") unless (File::Spec->file_name_is_absolute($_)); + } + $testfiles = join(' ',@altfiles); + } + if ($windows_exe) { + $testfiles =~ s#/#\\\\#g; + $testfiles =~ s#\\\\cygdrive\\\\(\w)\\\\#$1:\\\\#g; + } + my $test_command = "\"$executable\" $test_args --verbose $testfiles " . + "1>$testfile.output 2>$testfile.stderr"; + return $test_command; +} + +sub parse_testfile($) +{ + my $testfile = shift; + + my $test_args = ""; + my $test_syscode = 0; + my $test_exact = 0; + my $test_altfiles = ""; + my $line_end = $/; + + open (TESTFILE, "<$testfile") or + bail(1, "*** Cannot open file \"$testfile\" for reading ***"); + undef $/; + my $text = ; + close TESTFILE; + $/ = $line_end; + + if ($text =~ m#\/\*\*ARGS:\s*(.+?)\s*\*\/#) { + $test_args = $1; + } + if ($text =~ m#\/\*\*SYSCODE:\s*(.+?)\s*\*\/#) { + $test_syscode = $1; + if ($test_syscode =~ m/^\s*(=)\s*(.+)$/) { + $test_exact = 1; + $test_syscode = $2; + } + $test_syscode = eval($test_syscode); + } + if ($text =~ m#\/\*\*ALTFILES:\s*(.+?)\s*\*\/#) { + $test_altfiles = $1; + } + return ($test_args,$test_syscode,$test_exact,$test_altfiles); +} + diff --git a/test_sunifdef/sunifdef_softlink_tester.pl b/test_sunifdef/sunifdef_softlink_tester.pl new file mode 100755 index 0000000..1b24fff --- /dev/null +++ b/test_sunifdef/sunifdef_softlink_tester.pl @@ -0,0 +1,187 @@ +#!/usr/bin/perl + +use strict; +use Getopt::Long; +use File::Find; +use File::Copy; +use File::Path; +use File::Spec; +use Cwd qw(realpath); +use SunifdefLib; + +my $verbosity = 0; +my $help; +my $pkgdir; +my $execdir = "../src"; +my $rootname = 'scrap'; +my $stderr_file = "stderr.temp.txt"; +my $stdout_file = "stdout.temp.txt"; +my $keep = 0; +my $fails = 0; +my $windows_exe = 0; +my %optmap = ( 'pkgdir' => \$pkgdir, + 'execdir' => \$execdir, + 'rootname' => \$rootname, + 'keep' => \$keep, + 'help' => \$help); + +my $prog = "sunifdef_softlink_tester"; +my $infiles = 0; + +sub copy_test_file_to_scrap(); +sub make_softlink($$); +sub softlink_testfile(); +sub check_test_result(); +sub run(@); +sub slurp($); + +END { + unless($keep) { + unlink("link2args.h"); + rmtree("link2scrap"); + rmtree($rootname); + } + unless($fails) { + unlink("$stderr_file") if ( -f "$stderr_file"); + unlink("$stdout_file") if ( -f "$stdout_file"); + } +} + +set_prog($prog); + +set_usage( + "$prog: Exercise sunifdef in traversing a directory tree containing softlinks " . + "to verify that sunifdef follows them correctly\n". + "Usage:\n" . + "$prog [--verbosity=LEVEL] [--pkgdir PKGDIR] [--execdir EXECDIR] [--rootname DIRNAME] [--keep]\n" . + "$prog --help\n" . + "Arguments:\n" . + "-v | --verbosity LEVEL Display diagnostics with severity >= LEVEL, where " . + "LEVEL = 'progress', 'info', 'warning', 'error' or 'fatal. Default = 'progress'\n" . + "-h | --help Display this information on stdout.\n" . + "-p | --pkgdir PKGDIR The sunifdef package directory. Default '..'\n" . + "-e | --execdir EXECDIR Directory beneath PKGDIR from which to run sunidef: Default 'src'.\n" . + "-r | rootname The name of the root directory of the test tree.\n" . + "-k | --keep Do not delete the directory tree at exit.\n"); + +GetOptions( \%optmap, + 'pkdir=s', + 'execdir=s', + 'help!', + 'verbosity=s', + 'rootname=s', + 'keep!', + 'winexe!') or usage_error(); + +set_verbosity($verbosity); + +if ($help) { + help(); + exit(0); +} + +if ("$^O" =~ m/MSWin/ || cygwin()) { + info("This test is not applicable on Windows or Cygwin"); + exit(0); +} + +unless (defined($pkgdir)) { + if (defined($ENV{'SUNIFDEF_PKGDIR'})) { + $pkgdir = "$ENV{'SUNIFDEF_PKGDIR'}"; + } + else { + $pkgdir = ".."; + } +} + + + +$pkgdir = realpath($pkgdir); +$execdir = realpath($execdir); +$rootname = File::Spec->rel2abs($rootname); + +system("chmod -R +w $pkgdir") unless windows(); + +if ( -l "link2args.h") { + unlink("link2args.h"); +} +if ( -l "link2scrap") { + unlink("link2scrap"); +} +if ( -d "$rootname") { + rmtree("$rootname"); +} + +mkdir($rootname); +mkdir("$rootname/subdir1"); +make_softlink($rootname,"link2scrap"); + +find(\©_test_file_to_scrap,("$pkgdir/src")); + +bail(1,"*** No test data found! Bailing out confused ***") if $infiles == 0; + +find(\&softlink_testfile,("$rootname")); +make_softlink("$rootname/subdir1","$rootname/link2subdir1"); +make_softlink("$rootname/subdir1","$rootname/subdir1/self_including_link"); +make_softlink("$rootname/args.h","link2args.h"); +progress("*** Symlink Test: to process $infiles files ***"); + +# Run sunifdef recursively on a dataset in which numerous +# members are symbolic links to other members, to ensure +# that symbolic links are resolved. +run("$execdir/sunifdef --symbols first --verbose --recurse --filter c,h $rootname link2scrap link2args.h 2> $stderr_file"); +progress("*** Done ***"); +check_test_result(); + +exit($fails); + +sub slurp($) +{ + my $terminator = $/; + open IN,"<$_[0]" or die("Cannot open file \"$_[0]\" for reading\n"); + undef $/; + my $text = ; + close(IN); + $/ = $terminator; + return $text; +} + +sub run(@) +{ + my @cmd = @_; + progress("@cmd"); + my $ret = system(@cmd); + return $ret >> 8; +} + +sub check_test_result() +{ + my $fail = 0; + my $stderr_text = slurp("$stderr_file"); + if ($stderr_text !~ m/info 0x11370: $infiles out of $infiles input files were reached/) { + ++$fails; + error("*** Test Failed! See $stderr_file ****"); + } +} + +sub make_softlink($$) +{ + my ($target,$link) = @_; + system("ln -s $target $link") && + die("Failed to make softlink \"$target\" -> \"$link\""); +} + +sub copy_test_file_to_scrap() +{ + if ($_ =~ m/\.c$/ or $_ =~ m/\.h$/) { + copy($_,"$rootname/$_"); + ++$infiles; + } +} + +sub softlink_testfile() +{ + if (($_ =~ m/\.c$/ or $_ =~ m/\.h$/) && $File::Find::dir ne "$rootname/subdir1") { + make_softlink($File::Find::name,"$rootname/subdir1/link2$_"); + } +} diff --git a/test_sunifdef/test_cases/altfiles/scratch.temp.txt b/test_sunifdef/test_cases/altfiles/scratch.temp.txt new file mode 100644 index 0000000..e69de29 diff --git a/test_sunifdef/test_cases/altfiles/test0173-1.c b/test_sunifdef/test_cases/altfiles/test0173-1.c new file mode 100644 index 0000000..41b8a5e --- /dev/null +++ b/test_sunifdef/test_cases/altfiles/test0173-1.c @@ -0,0 +1,10 @@ +#ifdef FOO1 +KEEP ME +#endif +#if defined(FOO2) && defined(FOO2) +KEEP ME +#elif defined FOO3 || defined FOO4 +KEEP ME +#elif FOO5 +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/altfiles/test0173-2.c b/test_sunifdef/test_cases/altfiles/test0173-2.c new file mode 100644 index 0000000..66a975a --- /dev/null +++ b/test_sunifdef/test_cases/altfiles/test0173-2.c @@ -0,0 +1,10 @@ +#ifdef FOO1 +KEEP ME +#endif +#if defined(FOO2) && defined(FOO2) +KEEP ME +#elif defined FOO3 || defined FOO4 +KEEP ME +#elif FOO6 +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0001.c b/test_sunifdef/test_cases/test0001.c new file mode 100644 index 0000000..25f60c2 --- /dev/null +++ b/test_sunifdef/test_cases/test0001.c @@ -0,0 +1,5 @@ +/**ARGS: -DFOO */ +/**SYSCODE: = 0 */ +#ifdef UNKNOWN +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0001.c.expect b/test_sunifdef/test_cases/test0001.c.expect new file mode 100644 index 0000000..085e032 --- /dev/null +++ b/test_sunifdef/test_cases/test0001.c.expect @@ -0,0 +1,5 @@ +/**ARGS: -DFOO */ +/**SYSCODE: = 0 */ +#ifdef UNKNOWN +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0002.c b/test_sunifdef/test_cases/test0002.c new file mode 100644 index 0000000..37262b8 --- /dev/null +++ b/test_sunifdef/test_cases/test0002.c @@ -0,0 +1,3 @@ +/**ARGS: -DFOO */ +/**SYSCODE: = 0 */ +Bare word FOO diff --git a/test_sunifdef/test_cases/test0002.c.expect b/test_sunifdef/test_cases/test0002.c.expect new file mode 100644 index 0000000..afad8e1 --- /dev/null +++ b/test_sunifdef/test_cases/test0002.c.expect @@ -0,0 +1,3 @@ +/**ARGS: -DFOO */ +/**SYSCODE: = 0 */ +Bare word FOO diff --git a/test_sunifdef/test_cases/test0003.c b/test_sunifdef/test_cases/test0003.c new file mode 100644 index 0000000..f139322 --- /dev/null +++ b/test_sunifdef/test_cases/test0003.c @@ -0,0 +1,3 @@ +/**ARGS: -DFOO */ +/**SYSCODE: = 0 */ +String literal "FOO" diff --git a/test_sunifdef/test_cases/test0003.c.expect b/test_sunifdef/test_cases/test0003.c.expect new file mode 100644 index 0000000..a19c65b --- /dev/null +++ b/test_sunifdef/test_cases/test0003.c.expect @@ -0,0 +1,3 @@ +/**ARGS: -DFOO */ +/**SYSCODE: = 0 */ +String literal "FOO" diff --git a/test_sunifdef/test_cases/test0004.c b/test_sunifdef/test_cases/test0004.c new file mode 100644 index 0000000..646287b --- /dev/null +++ b/test_sunifdef/test_cases/test0004.c @@ -0,0 +1,7 @@ +/**ARGS: -DFOO */ +/**SYSCODE: = 0 */ +/* +#ifdef F00 +C Comment - KEEP ME +*/ + diff --git a/test_sunifdef/test_cases/test0004.c.expect b/test_sunifdef/test_cases/test0004.c.expect new file mode 100644 index 0000000..2f04b4b --- /dev/null +++ b/test_sunifdef/test_cases/test0004.c.expect @@ -0,0 +1,7 @@ +/**ARGS: -DFOO */ +/**SYSCODE: = 0 */ +/* +#ifdef F00 +C Comment - KEEP ME +*/ + diff --git a/test_sunifdef/test_cases/test0005.c b/test_sunifdef/test_cases/test0005.c new file mode 100644 index 0000000..fe95a09 --- /dev/null +++ b/test_sunifdef/test_cases/test0005.c @@ -0,0 +1,5 @@ +/**ARGS: -DFOO */ +/**SYSCODE: = 0 */ +=L +No newline on last +line of the file \ No newline at end of file diff --git a/test_sunifdef/test_cases/test0005.c.expect b/test_sunifdef/test_cases/test0005.c.expect new file mode 100644 index 0000000..e631419 --- /dev/null +++ b/test_sunifdef/test_cases/test0005.c.expect @@ -0,0 +1,5 @@ +/**ARGS: -DFOO */ +/**SYSCODE: = 0 */ +=L +No newline on last +line of the file \ No newline at end of file diff --git a/test_sunifdef/test_cases/test0006.c b/test_sunifdef/test_cases/test0006.c new file mode 100644 index 0000000..eeb541d --- /dev/null +++ b/test_sunifdef/test_cases/test0006.c @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +#ifdef FOO1 +KEEP ME +#else +DELETE ME +#endif + diff --git a/test_sunifdef/test_cases/test0006.c.expect b/test_sunifdef/test_cases/test0006.c.expect new file mode 100644 index 0000000..5090282 --- /dev/null +++ b/test_sunifdef/test_cases/test0006.c.expect @@ -0,0 +1,4 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +KEEP ME + diff --git a/test_sunifdef/test_cases/test0007.c b/test_sunifdef/test_cases/test0007.c new file mode 100644 index 0000000..b16c5d1 --- /dev/null +++ b/test_sunifdef/test_cases/test0007.c @@ -0,0 +1,8 @@ +/**ARGS: -UFOO1 -DFOO2 */ +/**SYSCODE: = 1 | 16 */ +#ifdef FOO1 +DELETE ME +#else +KEEP ME +#endif + diff --git a/test_sunifdef/test_cases/test0007.c.expect b/test_sunifdef/test_cases/test0007.c.expect new file mode 100644 index 0000000..4652988 --- /dev/null +++ b/test_sunifdef/test_cases/test0007.c.expect @@ -0,0 +1,4 @@ +/**ARGS: -UFOO1 -DFOO2 */ +/**SYSCODE: = 1 | 16 */ +KEEP ME + diff --git a/test_sunifdef/test_cases/test0008.c b/test_sunifdef/test_cases/test0008.c new file mode 100644 index 0000000..b6d22fe --- /dev/null +++ b/test_sunifdef/test_cases/test0008.c @@ -0,0 +1,5 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +#ifndef FOO1 +DELETE ME +#endif diff --git a/test_sunifdef/test_cases/test0008.c.expect b/test_sunifdef/test_cases/test0008.c.expect new file mode 100644 index 0000000..a0cbc0e --- /dev/null +++ b/test_sunifdef/test_cases/test0008.c.expect @@ -0,0 +1,2 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ diff --git a/test_sunifdef/test_cases/test0009.c b/test_sunifdef/test_cases/test0009.c new file mode 100644 index 0000000..9f95904 --- /dev/null +++ b/test_sunifdef/test_cases/test0009.c @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +#ifndef FOO1 +DELETE ME +#else +KEEP ME +#endif + diff --git a/test_sunifdef/test_cases/test0009.c.expect b/test_sunifdef/test_cases/test0009.c.expect new file mode 100644 index 0000000..2af595c --- /dev/null +++ b/test_sunifdef/test_cases/test0009.c.expect @@ -0,0 +1,4 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +KEEP ME + diff --git a/test_sunifdef/test_cases/test0010.c b/test_sunifdef/test_cases/test0010.c new file mode 100644 index 0000000..6bd21a9 --- /dev/null +++ b/test_sunifdef/test_cases/test0010.c @@ -0,0 +1,6 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +#if defined(FOO1) +KEEP ME +#endif + diff --git a/test_sunifdef/test_cases/test0010.c.expect b/test_sunifdef/test_cases/test0010.c.expect new file mode 100644 index 0000000..2af595c --- /dev/null +++ b/test_sunifdef/test_cases/test0010.c.expect @@ -0,0 +1,4 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +KEEP ME + diff --git a/test_sunifdef/test_cases/test0011.c b/test_sunifdef/test_cases/test0011.c new file mode 100644 index 0000000..fda5908 --- /dev/null +++ b/test_sunifdef/test_cases/test0011.c @@ -0,0 +1,7 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +#if defined(FOO1) +KEEP ME +#else +DELETE ME +#endif diff --git a/test_sunifdef/test_cases/test0011.c.expect b/test_sunifdef/test_cases/test0011.c.expect new file mode 100644 index 0000000..f50900f --- /dev/null +++ b/test_sunifdef/test_cases/test0011.c.expect @@ -0,0 +1,3 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +KEEP ME diff --git a/test_sunifdef/test_cases/test0012.c b/test_sunifdef/test_cases/test0012.c new file mode 100644 index 0000000..f2e547b --- /dev/null +++ b/test_sunifdef/test_cases/test0012.c @@ -0,0 +1,6 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +#if !defined(FOO1) +DELETE ME +#endif + diff --git a/test_sunifdef/test_cases/test0012.c.expect b/test_sunifdef/test_cases/test0012.c.expect new file mode 100644 index 0000000..b42b1df --- /dev/null +++ b/test_sunifdef/test_cases/test0012.c.expect @@ -0,0 +1,3 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ + diff --git a/test_sunifdef/test_cases/test0013.c b/test_sunifdef/test_cases/test0013.c new file mode 100644 index 0000000..25c7df1 --- /dev/null +++ b/test_sunifdef/test_cases/test0013.c @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +#if !defined(FOO1) +DELETE ME +#else +KEEP ME +#endif + diff --git a/test_sunifdef/test_cases/test0013.c.expect b/test_sunifdef/test_cases/test0013.c.expect new file mode 100644 index 0000000..2af595c --- /dev/null +++ b/test_sunifdef/test_cases/test0013.c.expect @@ -0,0 +1,4 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +KEEP ME + diff --git a/test_sunifdef/test_cases/test0014.c b/test_sunifdef/test_cases/test0014.c new file mode 100644 index 0000000..0eb26bd --- /dev/null +++ b/test_sunifdef/test_cases/test0014.c @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +#ifdef UNKNOWN +KEEP ME +#elif defined(FOO1) +KEEP ME +#endif + diff --git a/test_sunifdef/test_cases/test0014.c.expect b/test_sunifdef/test_cases/test0014.c.expect new file mode 100644 index 0000000..c125d17 --- /dev/null +++ b/test_sunifdef/test_cases/test0014.c.expect @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +#ifdef UNKNOWN +KEEP ME +#else +KEEP ME +#endif + diff --git a/test_sunifdef/test_cases/test0015.c b/test_sunifdef/test_cases/test0015.c new file mode 100644 index 0000000..449a646 --- /dev/null +++ b/test_sunifdef/test_cases/test0015.c @@ -0,0 +1,9 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 | 16 */ +#ifdef UNKNOWN +KEEP ME +#elif defined(FOO1) +KEEP ME +#else +DELETE ME +#endif diff --git a/test_sunifdef/test_cases/test0015.c.expect b/test_sunifdef/test_cases/test0015.c.expect new file mode 100644 index 0000000..e262230 --- /dev/null +++ b/test_sunifdef/test_cases/test0015.c.expect @@ -0,0 +1,7 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 | 16 */ +#ifdef UNKNOWN +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0016.c b/test_sunifdef/test_cases/test0016.c new file mode 100644 index 0000000..3753fb7 --- /dev/null +++ b/test_sunifdef/test_cases/test0016.c @@ -0,0 +1,7 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +#ifdef UNKNOWN +KEEP ME +#elif !defined(FOO1) +DELETE ME +#endif diff --git a/test_sunifdef/test_cases/test0016.c.expect b/test_sunifdef/test_cases/test0016.c.expect new file mode 100644 index 0000000..dc72ab9 --- /dev/null +++ b/test_sunifdef/test_cases/test0016.c.expect @@ -0,0 +1,5 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +#ifdef UNKNOWN +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0017.c b/test_sunifdef/test_cases/test0017.c new file mode 100644 index 0000000..c77ae65 --- /dev/null +++ b/test_sunifdef/test_cases/test0017.c @@ -0,0 +1,10 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +#ifdef UNKNOWN +KEEP ME +#elif !defined(FOO1) +DELETE ME +#else +KEEP ME +#endif + diff --git a/test_sunifdef/test_cases/test0017.c.expect b/test_sunifdef/test_cases/test0017.c.expect new file mode 100644 index 0000000..2324760 --- /dev/null +++ b/test_sunifdef/test_cases/test0017.c.expect @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +#ifdef UNKNOWN +KEEP ME +#else +KEEP ME +#endif + diff --git a/test_sunifdef/test_cases/test0018.c b/test_sunifdef/test_cases/test0018.c new file mode 100644 index 0000000..9f4c77a --- /dev/null +++ b/test_sunifdef/test_cases/test0018.c @@ -0,0 +1,6 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +#if defined FOO1 +KEEP ME +#endif + diff --git a/test_sunifdef/test_cases/test0018.c.expect b/test_sunifdef/test_cases/test0018.c.expect new file mode 100644 index 0000000..2af595c --- /dev/null +++ b/test_sunifdef/test_cases/test0018.c.expect @@ -0,0 +1,4 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +KEEP ME + diff --git a/test_sunifdef/test_cases/test0019.c b/test_sunifdef/test_cases/test0019.c new file mode 100644 index 0000000..33fdec7 --- /dev/null +++ b/test_sunifdef/test_cases/test0019.c @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +#if defined FOO1 +KEEP ME +#else +DELETE ME +#endif + diff --git a/test_sunifdef/test_cases/test0019.c.expect b/test_sunifdef/test_cases/test0019.c.expect new file mode 100644 index 0000000..2af595c --- /dev/null +++ b/test_sunifdef/test_cases/test0019.c.expect @@ -0,0 +1,4 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +KEEP ME + diff --git a/test_sunifdef/test_cases/test0020.c b/test_sunifdef/test_cases/test0020.c new file mode 100644 index 0000000..eda5500 --- /dev/null +++ b/test_sunifdef/test_cases/test0020.c @@ -0,0 +1,6 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +#if !defined FOO1 +DELETE ME +#endif + diff --git a/test_sunifdef/test_cases/test0020.c.expect b/test_sunifdef/test_cases/test0020.c.expect new file mode 100644 index 0000000..b42b1df --- /dev/null +++ b/test_sunifdef/test_cases/test0020.c.expect @@ -0,0 +1,3 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ + diff --git a/test_sunifdef/test_cases/test0021.c b/test_sunifdef/test_cases/test0021.c new file mode 100644 index 0000000..90a7baf --- /dev/null +++ b/test_sunifdef/test_cases/test0021.c @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +#if !defined FOO1 +DELETE ME +#else +KEEP ME +#endif + diff --git a/test_sunifdef/test_cases/test0021.c.expect b/test_sunifdef/test_cases/test0021.c.expect new file mode 100644 index 0000000..2af595c --- /dev/null +++ b/test_sunifdef/test_cases/test0021.c.expect @@ -0,0 +1,4 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +KEEP ME + diff --git a/test_sunifdef/test_cases/test0022.c b/test_sunifdef/test_cases/test0022.c new file mode 100644 index 0000000..fb48eee --- /dev/null +++ b/test_sunifdef/test_cases/test0022.c @@ -0,0 +1,6 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +# if defined FOO1 +KEEP ME +# endif + diff --git a/test_sunifdef/test_cases/test0022.c.expect b/test_sunifdef/test_cases/test0022.c.expect new file mode 100644 index 0000000..2af595c --- /dev/null +++ b/test_sunifdef/test_cases/test0022.c.expect @@ -0,0 +1,4 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +KEEP ME + diff --git a/test_sunifdef/test_cases/test0023.c b/test_sunifdef/test_cases/test0023.c new file mode 100644 index 0000000..f7f67b3 --- /dev/null +++ b/test_sunifdef/test_cases/test0023.c @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +# if defined FOO1 +KEEP ME +# else +DELETE ME +# endif + diff --git a/test_sunifdef/test_cases/test0023.c.expect b/test_sunifdef/test_cases/test0023.c.expect new file mode 100644 index 0000000..2af595c --- /dev/null +++ b/test_sunifdef/test_cases/test0023.c.expect @@ -0,0 +1,4 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +KEEP ME + diff --git a/test_sunifdef/test_cases/test0024.c b/test_sunifdef/test_cases/test0024.c new file mode 100644 index 0000000..436cb09 --- /dev/null +++ b/test_sunifdef/test_cases/test0024.c @@ -0,0 +1,6 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +# if !defined FOO1 +DELETE ME +# endif + diff --git a/test_sunifdef/test_cases/test0024.c.expect b/test_sunifdef/test_cases/test0024.c.expect new file mode 100644 index 0000000..b42b1df --- /dev/null +++ b/test_sunifdef/test_cases/test0024.c.expect @@ -0,0 +1,3 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ + diff --git a/test_sunifdef/test_cases/test0025.c b/test_sunifdef/test_cases/test0025.c new file mode 100644 index 0000000..9b1ea97 --- /dev/null +++ b/test_sunifdef/test_cases/test0025.c @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +# if !defined FOO1 +DELETE ME +# else +KEEP ME +# endif + diff --git a/test_sunifdef/test_cases/test0025.c.expect b/test_sunifdef/test_cases/test0025.c.expect new file mode 100644 index 0000000..2af595c --- /dev/null +++ b/test_sunifdef/test_cases/test0025.c.expect @@ -0,0 +1,4 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +KEEP ME + diff --git a/test_sunifdef/test_cases/test0026.c b/test_sunifdef/test_cases/test0026.c new file mode 100644 index 0000000..1d3cfef --- /dev/null +++ b/test_sunifdef/test_cases/test0026.c @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +#ifdef UNKNOWN +KEEP ME +#elif defined FOO1 +KEEP ME +#endif + diff --git a/test_sunifdef/test_cases/test0026.c.expect b/test_sunifdef/test_cases/test0026.c.expect new file mode 100644 index 0000000..c125d17 --- /dev/null +++ b/test_sunifdef/test_cases/test0026.c.expect @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +#ifdef UNKNOWN +KEEP ME +#else +KEEP ME +#endif + diff --git a/test_sunifdef/test_cases/test0027.c b/test_sunifdef/test_cases/test0027.c new file mode 100644 index 0000000..5aa9e80 --- /dev/null +++ b/test_sunifdef/test_cases/test0027.c @@ -0,0 +1,10 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 | 32 */ +#ifdef UNKNOWN +KEEP ME +#elif defined FOO1 +KEEP ME +#else +DELETE ME +#endif + diff --git a/test_sunifdef/test_cases/test0027.c.expect b/test_sunifdef/test_cases/test0027.c.expect new file mode 100644 index 0000000..e2261b2 --- /dev/null +++ b/test_sunifdef/test_cases/test0027.c.expect @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 | 32 */ +#ifdef UNKNOWN +KEEP ME +#else +KEEP ME +#endif + diff --git a/test_sunifdef/test_cases/test0028.c b/test_sunifdef/test_cases/test0028.c new file mode 100644 index 0000000..5fcd0a3 --- /dev/null +++ b/test_sunifdef/test_cases/test0028.c @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +#ifdef UNKNOWN +KEEP ME +#elif !defined FOO1 +DELETE ME +#endif + diff --git a/test_sunifdef/test_cases/test0028.c.expect b/test_sunifdef/test_cases/test0028.c.expect new file mode 100644 index 0000000..d7ba231 --- /dev/null +++ b/test_sunifdef/test_cases/test0028.c.expect @@ -0,0 +1,6 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +#ifdef UNKNOWN +KEEP ME +#endif + diff --git a/test_sunifdef/test_cases/test0029.c b/test_sunifdef/test_cases/test0029.c new file mode 100644 index 0000000..72bbcdb --- /dev/null +++ b/test_sunifdef/test_cases/test0029.c @@ -0,0 +1,10 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +#ifdef UNKNOWN +KEEP ME +#elif !defined FOO1 +DELETE ME +#else +KEEP ME +#endif + diff --git a/test_sunifdef/test_cases/test0029.c.expect b/test_sunifdef/test_cases/test0029.c.expect new file mode 100644 index 0000000..2324760 --- /dev/null +++ b/test_sunifdef/test_cases/test0029.c.expect @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +#ifdef UNKNOWN +KEEP ME +#else +KEEP ME +#endif + diff --git a/test_sunifdef/test_cases/test0030.c b/test_sunifdef/test_cases/test0030.c new file mode 100644 index 0000000..a8560af --- /dev/null +++ b/test_sunifdef/test_cases/test0030.c @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +#if defined(FOO1) && defined(UNKNOWN) +KEEP ME +#else +KEEP ME +#endif + diff --git a/test_sunifdef/test_cases/test0030.c.expect b/test_sunifdef/test_cases/test0030.c.expect new file mode 100644 index 0000000..73ae4a4 --- /dev/null +++ b/test_sunifdef/test_cases/test0030.c.expect @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +#if defined(UNKNOWN) +KEEP ME +#else +KEEP ME +#endif + diff --git a/test_sunifdef/test_cases/test0031.c b/test_sunifdef/test_cases/test0031.c new file mode 100644 index 0000000..c378ef3 --- /dev/null +++ b/test_sunifdef/test_cases/test0031.c @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +#if defined(FOO1) && !defined(UNKNOWN) +KEEP ME +#else +KEEP ME +#endif + diff --git a/test_sunifdef/test_cases/test0031.c.expect b/test_sunifdef/test_cases/test0031.c.expect new file mode 100644 index 0000000..e94a662 --- /dev/null +++ b/test_sunifdef/test_cases/test0031.c.expect @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +#if !defined(UNKNOWN) +KEEP ME +#else +KEEP ME +#endif + diff --git a/test_sunifdef/test_cases/test0032.c b/test_sunifdef/test_cases/test0032.c new file mode 100644 index 0000000..777e505 --- /dev/null +++ b/test_sunifdef/test_cases/test0032.c @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +#if defined(FOO1) || defined(UNKNOWN) +KEEP ME +#else +DELETE ME +#endif + diff --git a/test_sunifdef/test_cases/test0032.c.expect b/test_sunifdef/test_cases/test0032.c.expect new file mode 100644 index 0000000..2af595c --- /dev/null +++ b/test_sunifdef/test_cases/test0032.c.expect @@ -0,0 +1,4 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +KEEP ME + diff --git a/test_sunifdef/test_cases/test0033.c b/test_sunifdef/test_cases/test0033.c new file mode 100644 index 0000000..495c898 --- /dev/null +++ b/test_sunifdef/test_cases/test0033.c @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +#if !defined(FOO1) || defined(UNKNOWN) +KEEP ME +#else +KEEP ME +#endif + diff --git a/test_sunifdef/test_cases/test0033.c.expect b/test_sunifdef/test_cases/test0033.c.expect new file mode 100644 index 0000000..73ae4a4 --- /dev/null +++ b/test_sunifdef/test_cases/test0033.c.expect @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +#if defined(UNKNOWN) +KEEP ME +#else +KEEP ME +#endif + diff --git a/test_sunifdef/test_cases/test0034.c b/test_sunifdef/test_cases/test0034.c new file mode 100644 index 0000000..412e2cc --- /dev/null +++ b/test_sunifdef/test_cases/test0034.c @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +#if defined(UNKNOWN) || defined(FOO1) +KEEP ME +#else +DELETE ME +#endif + diff --git a/test_sunifdef/test_cases/test0034.c.expect b/test_sunifdef/test_cases/test0034.c.expect new file mode 100644 index 0000000..2af595c --- /dev/null +++ b/test_sunifdef/test_cases/test0034.c.expect @@ -0,0 +1,4 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +KEEP ME + diff --git a/test_sunifdef/test_cases/test0035.c b/test_sunifdef/test_cases/test0035.c new file mode 100644 index 0000000..7a490e0 --- /dev/null +++ b/test_sunifdef/test_cases/test0035.c @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +#if defined(UNKNOWN) || !defined(FOO1) +KEEP ME +#else +KEEP ME +#endif + diff --git a/test_sunifdef/test_cases/test0035.c.expect b/test_sunifdef/test_cases/test0035.c.expect new file mode 100644 index 0000000..4e544de --- /dev/null +++ b/test_sunifdef/test_cases/test0035.c.expect @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +#if defined(UNKNOWN) +KEEP ME +#else +KEEP ME +#endif + diff --git a/test_sunifdef/test_cases/test0036.c b/test_sunifdef/test_cases/test0036.c new file mode 100644 index 0000000..f48b64d --- /dev/null +++ b/test_sunifdef/test_cases/test0036.c @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +#if defined(FOO1) || !defined(FOO1) +KEEP ME +#else +DELETE ME +#endif + diff --git a/test_sunifdef/test_cases/test0036.c.expect b/test_sunifdef/test_cases/test0036.c.expect new file mode 100644 index 0000000..2af595c --- /dev/null +++ b/test_sunifdef/test_cases/test0036.c.expect @@ -0,0 +1,4 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +KEEP ME + diff --git a/test_sunifdef/test_cases/test0037.c b/test_sunifdef/test_cases/test0037.c new file mode 100644 index 0000000..c62d8ff --- /dev/null +++ b/test_sunifdef/test_cases/test0037.c @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +#if defined(FOO1) && !defined(FOO1) +DELETE ME +#else +KEEP ME +#endif + diff --git a/test_sunifdef/test_cases/test0037.c.expect b/test_sunifdef/test_cases/test0037.c.expect new file mode 100644 index 0000000..2af595c --- /dev/null +++ b/test_sunifdef/test_cases/test0037.c.expect @@ -0,0 +1,4 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +KEEP ME + diff --git a/test_sunifdef/test_cases/test0038.c b/test_sunifdef/test_cases/test0038.c new file mode 100644 index 0000000..1878c80 --- /dev/null +++ b/test_sunifdef/test_cases/test0038.c @@ -0,0 +1,9 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +#if defined \ + FOO1 +KEEP ME +#else +DELETE ME +#endif + diff --git a/test_sunifdef/test_cases/test0038.c.expect b/test_sunifdef/test_cases/test0038.c.expect new file mode 100644 index 0000000..2af595c --- /dev/null +++ b/test_sunifdef/test_cases/test0038.c.expect @@ -0,0 +1,4 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +KEEP ME + diff --git a/test_sunifdef/test_cases/test0039.c b/test_sunifdef/test_cases/test0039.c new file mode 100644 index 0000000..5808e6b --- /dev/null +++ b/test_sunifdef/test_cases/test0039.c @@ -0,0 +1,9 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +#if defined \ + (FOO1) && defined(UNKNOWN) +KEEP ME +#else +KEEP ME +#endif + diff --git a/test_sunifdef/test_cases/test0039.c.expect b/test_sunifdef/test_cases/test0039.c.expect new file mode 100644 index 0000000..73ae4a4 --- /dev/null +++ b/test_sunifdef/test_cases/test0039.c.expect @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +#if defined(UNKNOWN) +KEEP ME +#else +KEEP ME +#endif + diff --git a/test_sunifdef/test_cases/test0040.c b/test_sunifdef/test_cases/test0040.c new file mode 100644 index 0000000..a7ca783 --- /dev/null +++ b/test_sunifdef/test_cases/test0040.c @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +#if (defined FOO1 && defined UNKNOWN) || (!defined FOO1 && !defined UNKNOWN) +KEEP ME +#else +KEEP ME +#endif + diff --git a/test_sunifdef/test_cases/test0040.c.expect b/test_sunifdef/test_cases/test0040.c.expect new file mode 100644 index 0000000..f08188a --- /dev/null +++ b/test_sunifdef/test_cases/test0040.c.expect @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +#if defined UNKNOWN +KEEP ME +#else +KEEP ME +#endif + diff --git a/test_sunifdef/test_cases/test0041.c b/test_sunifdef/test_cases/test0041.c new file mode 100644 index 0000000..85206cd --- /dev/null +++ b/test_sunifdef/test_cases/test0041.c @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +#if (defined FOO1) +KEEP ME +#else +DELETE ME +#endif + diff --git a/test_sunifdef/test_cases/test0041.c.expect b/test_sunifdef/test_cases/test0041.c.expect new file mode 100644 index 0000000..2af595c --- /dev/null +++ b/test_sunifdef/test_cases/test0041.c.expect @@ -0,0 +1,4 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +KEEP ME + diff --git a/test_sunifdef/test_cases/test0042.c b/test_sunifdef/test_cases/test0042.c new file mode 100644 index 0000000..e75bf8e --- /dev/null +++ b/test_sunifdef/test_cases/test0042.c @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +#if !(defined FOO1) +DELETE ME +#else +KEEP ME +#endif + diff --git a/test_sunifdef/test_cases/test0042.c.expect b/test_sunifdef/test_cases/test0042.c.expect new file mode 100644 index 0000000..2af595c --- /dev/null +++ b/test_sunifdef/test_cases/test0042.c.expect @@ -0,0 +1,4 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +KEEP ME + diff --git a/test_sunifdef/test_cases/test0043.c b/test_sunifdef/test_cases/test0043.c new file mode 100644 index 0000000..437a5a0 --- /dev/null +++ b/test_sunifdef/test_cases/test0043.c @@ -0,0 +1,12 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +#ifdef FOO1 +KEEP ME +#define OTHER +#endif +#ifdef OTHER +KEEP ME +#else +KEEP ME +#endif + diff --git a/test_sunifdef/test_cases/test0043.c.expect b/test_sunifdef/test_cases/test0043.c.expect new file mode 100644 index 0000000..b185381 --- /dev/null +++ b/test_sunifdef/test_cases/test0043.c.expect @@ -0,0 +1,10 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +KEEP ME +#define OTHER +#ifdef OTHER +KEEP ME +#else +KEEP ME +#endif + diff --git a/test_sunifdef/test_cases/test0044.c b/test_sunifdef/test_cases/test0044.c new file mode 100644 index 0000000..6113f24 --- /dev/null +++ b/test_sunifdef/test_cases/test0044.c @@ -0,0 +1,9 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +#define FOO1 +#ifdef FOO1 +KEEP ME +#else +DELETE ME +#endif + diff --git a/test_sunifdef/test_cases/test0044.c.expect b/test_sunifdef/test_cases/test0044.c.expect new file mode 100644 index 0000000..2af595c --- /dev/null +++ b/test_sunifdef/test_cases/test0044.c.expect @@ -0,0 +1,4 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +KEEP ME + diff --git a/test_sunifdef/test_cases/test0045.c b/test_sunifdef/test_cases/test0045.c new file mode 100644 index 0000000..0745cab --- /dev/null +++ b/test_sunifdef/test_cases/test0045.c @@ -0,0 +1,9 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 2 | 16 | 32 */ +#undef FOO1 +#ifdef FOO1 +KEEP ME +#else +DELETE ME +#endif + diff --git a/test_sunifdef/test_cases/test0045.c.expect b/test_sunifdef/test_cases/test0045.c.expect new file mode 100644 index 0000000..094eb98 --- /dev/null +++ b/test_sunifdef/test_cases/test0045.c.expect @@ -0,0 +1,5 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 2 | 16 | 32 */ +//error : inserted by sunifdef: "#undef FOO1" contradicts -D symbol at ./test_cases/test0045.c(3) +KEEP ME + diff --git a/test_sunifdef/test_cases/test0046.c b/test_sunifdef/test_cases/test0046.c new file mode 100644 index 0000000..4f13474 --- /dev/null +++ b/test_sunifdef/test_cases/test0046.c @@ -0,0 +1,9 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +#undef FOO2 +#ifdef FOO2 +DELETE ME +#else +KEEP ME +#endif + diff --git a/test_sunifdef/test_cases/test0046.c.expect b/test_sunifdef/test_cases/test0046.c.expect new file mode 100644 index 0000000..2af595c --- /dev/null +++ b/test_sunifdef/test_cases/test0046.c.expect @@ -0,0 +1,4 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +KEEP ME + diff --git a/test_sunifdef/test_cases/test0047.c b/test_sunifdef/test_cases/test0047.c new file mode 100644 index 0000000..8faa399 --- /dev/null +++ b/test_sunifdef/test_cases/test0047.c @@ -0,0 +1,11 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 2 | 16 | 32 */ +#ifdef FOO1 +#undef FOO1 +KEEP ME +#endif +#ifdef FOO1 +KEEP ME +#else +DELETE ME +#endif diff --git a/test_sunifdef/test_cases/test0047.c.expect b/test_sunifdef/test_cases/test0047.c.expect new file mode 100644 index 0000000..7a0ff9d --- /dev/null +++ b/test_sunifdef/test_cases/test0047.c.expect @@ -0,0 +1,5 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 2 | 16 | 32 */ +//error : inserted by sunifdef: "#undef FOO1" contradicts -D symbol at ./test_cases/test0047.c(4) +KEEP ME +KEEP ME diff --git a/test_sunifdef/test_cases/test0048.c b/test_sunifdef/test_cases/test0048.c new file mode 100644 index 0000000..abefac3 --- /dev/null +++ b/test_sunifdef/test_cases/test0048.c @@ -0,0 +1,12 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +#ifdef FOO2 +#undef FOO2 +DELETE ME +#endif +#ifdef FOO2 +DELETE ME +#else +KEEP ME +#endif + diff --git a/test_sunifdef/test_cases/test0048.c.expect b/test_sunifdef/test_cases/test0048.c.expect new file mode 100644 index 0000000..2af595c --- /dev/null +++ b/test_sunifdef/test_cases/test0048.c.expect @@ -0,0 +1,4 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +KEEP ME + diff --git a/test_sunifdef/test_cases/test0049.c b/test_sunifdef/test_cases/test0049.c new file mode 100644 index 0000000..771270f --- /dev/null +++ b/test_sunifdef/test_cases/test0049.c @@ -0,0 +1,11 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +#ifndef FOO1 +#define FOO1 +DELETE ME +#endif +#ifdef FOO1 +KEEP ME +#else +DELETE ME +#endif diff --git a/test_sunifdef/test_cases/test0049.c.expect b/test_sunifdef/test_cases/test0049.c.expect new file mode 100644 index 0000000..f50900f --- /dev/null +++ b/test_sunifdef/test_cases/test0049.c.expect @@ -0,0 +1,3 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +KEEP ME diff --git a/test_sunifdef/test_cases/test0050.c b/test_sunifdef/test_cases/test0050.c new file mode 100644 index 0000000..c74e095 --- /dev/null +++ b/test_sunifdef/test_cases/test0050.c @@ -0,0 +1,12 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 2 | 16 | 32 */ +#ifndef FOO2 +#define FOO2 +KEEP ME +#endif +#ifdef FOO2 +DELETE ME +#else +KEEP ME +#endif + diff --git a/test_sunifdef/test_cases/test0050.c.expect b/test_sunifdef/test_cases/test0050.c.expect new file mode 100644 index 0000000..a4fd032 --- /dev/null +++ b/test_sunifdef/test_cases/test0050.c.expect @@ -0,0 +1,6 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 2 | 16 | 32 */ +//error : inserted by sunifdef: "#define FOO2" contradicts -U at ./test_cases/test0050.c(4) +KEEP ME +KEEP ME + diff --git a/test_sunifdef/test_cases/test0051.c b/test_sunifdef/test_cases/test0051.c new file mode 100644 index 0000000..20a2ebd --- /dev/null +++ b/test_sunifdef/test_cases/test0051.c @@ -0,0 +1,4 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 2 | 32 */ +#define FOO2 + diff --git a/test_sunifdef/test_cases/test0051.c.expect b/test_sunifdef/test_cases/test0051.c.expect new file mode 100644 index 0000000..574ee03 --- /dev/null +++ b/test_sunifdef/test_cases/test0051.c.expect @@ -0,0 +1,4 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 2 | 32 */ +//error : inserted by sunifdef: "#define FOO2" contradicts -U at ./test_cases/test0051.c(3) + diff --git a/test_sunifdef/test_cases/test0052.c b/test_sunifdef/test_cases/test0052.c new file mode 100644 index 0000000..3b849cc --- /dev/null +++ b/test_sunifdef/test_cases/test0052.c @@ -0,0 +1,4 @@ +/**ARGS: --conflict delete -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 2 | 16 */ +#define FOO2 + diff --git a/test_sunifdef/test_cases/test0052.c.expect b/test_sunifdef/test_cases/test0052.c.expect new file mode 100644 index 0000000..0e76042 --- /dev/null +++ b/test_sunifdef/test_cases/test0052.c.expect @@ -0,0 +1,3 @@ +/**ARGS: --conflict delete -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 2 | 16 */ + diff --git a/test_sunifdef/test_cases/test0053.c b/test_sunifdef/test_cases/test0053.c new file mode 100644 index 0000000..5dbf8bb --- /dev/null +++ b/test_sunifdef/test_cases/test0053.c @@ -0,0 +1,4 @@ +/**ARGS: --conflict comment -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 2 | 32 */ +#define FOO2 + diff --git a/test_sunifdef/test_cases/test0053.c.expect b/test_sunifdef/test_cases/test0053.c.expect new file mode 100644 index 0000000..9f31a32 --- /dev/null +++ b/test_sunifdef/test_cases/test0053.c.expect @@ -0,0 +1,4 @@ +/**ARGS: --conflict comment -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 2 | 32 */ +//error : inserted by sunifdef: "#define FOO2" contradicts -U at ./test_cases/test0053.c(3) + diff --git a/test_sunifdef/test_cases/test0054.c b/test_sunifdef/test_cases/test0054.c new file mode 100644 index 0000000..e89498f --- /dev/null +++ b/test_sunifdef/test_cases/test0054.c @@ -0,0 +1,3 @@ +/**ARGS: --conflict error -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 2 | 32 | 64 | 128 */ +#define FOO2 diff --git a/test_sunifdef/test_cases/test0054.c.expect b/test_sunifdef/test_cases/test0054.c.expect new file mode 100644 index 0000000..bfb203a --- /dev/null +++ b/test_sunifdef/test_cases/test0054.c.expect @@ -0,0 +1,3 @@ +/**ARGS: --conflict error -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 2 | 32 | 64 | 128 */ +#error : inserted by sunifdef: "#define FOO2" contradicts -U at ./test_cases/test0054.c(3) diff --git a/test_sunifdef/test_cases/test0055.c b/test_sunifdef/test_cases/test0055.c new file mode 100644 index 0000000..ea3acc7 --- /dev/null +++ b/test_sunifdef/test_cases/test0055.c @@ -0,0 +1,5 @@ +/**ARGS: --conflict error -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 2 | 32 | 64 */ +#ifdef UNKNOWN +#define FOO2 +#endif diff --git a/test_sunifdef/test_cases/test0055.c.expect b/test_sunifdef/test_cases/test0055.c.expect new file mode 100644 index 0000000..a3ba085 --- /dev/null +++ b/test_sunifdef/test_cases/test0055.c.expect @@ -0,0 +1,5 @@ +/**ARGS: --conflict error -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 2 | 32 | 64 */ +#ifdef UNKNOWN +#error : inserted by sunifdef: "#define FOO2" contradicts -U at ./test_cases/test0055.c(4) +#endif diff --git a/test_sunifdef/test_cases/test0056.c b/test_sunifdef/test_cases/test0056.c new file mode 100644 index 0000000..d0454f6 --- /dev/null +++ b/test_sunifdef/test_cases/test0056.c @@ -0,0 +1,12 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +#ifdef UNKNOWN +KEEP ME +#define FOO1 +#endif +#ifdef FOO1 +KEEP ME +#else +DELETE ME +#endif + diff --git a/test_sunifdef/test_cases/test0056.c.expect b/test_sunifdef/test_cases/test0056.c.expect new file mode 100644 index 0000000..c22cb4c --- /dev/null +++ b/test_sunifdef/test_cases/test0056.c.expect @@ -0,0 +1,7 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +#ifdef UNKNOWN +KEEP ME +#endif +KEEP ME + diff --git a/test_sunifdef/test_cases/test0057.c b/test_sunifdef/test_cases/test0057.c new file mode 100644 index 0000000..5de719b --- /dev/null +++ b/test_sunifdef/test_cases/test0057.c @@ -0,0 +1,11 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 2 | 16 | 32 */ +#ifdef UNKNOWN +KEEP ME +#define FOO2 +#endif +#ifdef FOO2 +DELETE ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0057.c.expect b/test_sunifdef/test_cases/test0057.c.expect new file mode 100644 index 0000000..64c36e1 --- /dev/null +++ b/test_sunifdef/test_cases/test0057.c.expect @@ -0,0 +1,7 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 2 | 16 | 32 */ +#ifdef UNKNOWN +KEEP ME +//error : inserted by sunifdef: "#define FOO2" contradicts -U at ./test_cases/test0057.c(5) +#endif +KEEP ME diff --git a/test_sunifdef/test_cases/test0058.c b/test_sunifdef/test_cases/test0058.c new file mode 100644 index 0000000..4d4dc40 --- /dev/null +++ b/test_sunifdef/test_cases/test0058.c @@ -0,0 +1,11 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 2 | 16 | 32 */ +#ifdef UNKNOWN +KEEP ME +#undef FOO1 +#endif +#ifdef FOO1 +KEEP ME +#else +DELETE ME +#endif diff --git a/test_sunifdef/test_cases/test0058.c.expect b/test_sunifdef/test_cases/test0058.c.expect new file mode 100644 index 0000000..b06bd72 --- /dev/null +++ b/test_sunifdef/test_cases/test0058.c.expect @@ -0,0 +1,7 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 2 | 16 | 32 */ +#ifdef UNKNOWN +KEEP ME +//error : inserted by sunifdef: "#undef FOO1" contradicts -D symbol at ./test_cases/test0058.c(5) +#endif +KEEP ME diff --git a/test_sunifdef/test_cases/test0059.c b/test_sunifdef/test_cases/test0059.c new file mode 100644 index 0000000..a8bb991 --- /dev/null +++ b/test_sunifdef/test_cases/test0059.c @@ -0,0 +1,7 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +#if (!defined(FOO1) && !defined(UNKNOWN)) || (defined(UNKNOWN) && defined(FOO1)) +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0059.c.expect b/test_sunifdef/test_cases/test0059.c.expect new file mode 100644 index 0000000..f2e1f97 --- /dev/null +++ b/test_sunifdef/test_cases/test0059.c.expect @@ -0,0 +1,7 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +#if defined(UNKNOWN) +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0060.c b/test_sunifdef/test_cases/test0060.c new file mode 100644 index 0000000..7988d0b --- /dev/null +++ b/test_sunifdef/test_cases/test0060.c @@ -0,0 +1,7 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +#if !defined(FOO1) && !defined(UNKNOWN) || defined(UNKNOWN) && defined(FOO1) +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0060.c.expect b/test_sunifdef/test_cases/test0060.c.expect new file mode 100644 index 0000000..f2e1f97 --- /dev/null +++ b/test_sunifdef/test_cases/test0060.c.expect @@ -0,0 +1,7 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +#if defined(UNKNOWN) +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0061.c b/test_sunifdef/test_cases/test0061.c new file mode 100644 index 0000000..8f4906e --- /dev/null +++ b/test_sunifdef/test_cases/test0061.c @@ -0,0 +1,7 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +#if (!defined(FOO1) || !defined(UNKNOWN)) && (defined(UNKNOWN) || defined(FOO1)) +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0061.c.expect b/test_sunifdef/test_cases/test0061.c.expect new file mode 100644 index 0000000..6496aee --- /dev/null +++ b/test_sunifdef/test_cases/test0061.c.expect @@ -0,0 +1,7 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +#if !defined(UNKNOWN) +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0062.c b/test_sunifdef/test_cases/test0062.c new file mode 100644 index 0000000..3d199a7 --- /dev/null +++ b/test_sunifdef/test_cases/test0062.c @@ -0,0 +1,7 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +#if !defined(FOO1) || !defined(UNKNOWN) && defined(UNKNOWN) || defined(FOO1) +KEEP ME +#else +DELETE ME +#endif diff --git a/test_sunifdef/test_cases/test0062.c.expect b/test_sunifdef/test_cases/test0062.c.expect new file mode 100644 index 0000000..f50900f --- /dev/null +++ b/test_sunifdef/test_cases/test0062.c.expect @@ -0,0 +1,3 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +KEEP ME diff --git a/test_sunifdef/test_cases/test0063.c b/test_sunifdef/test_cases/test0063.c new file mode 100644 index 0000000..e8df0dd --- /dev/null +++ b/test_sunifdef/test_cases/test0063.c @@ -0,0 +1,7 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +#if (!defined(FOO1) && defined(UNKNOWN)) || defined(UNKNOWN) +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0063.c.expect b/test_sunifdef/test_cases/test0063.c.expect new file mode 100644 index 0000000..5554cde --- /dev/null +++ b/test_sunifdef/test_cases/test0063.c.expect @@ -0,0 +1,7 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +#if defined(UNKNOWN) +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0064.c b/test_sunifdef/test_cases/test0064.c new file mode 100644 index 0000000..1db8b44 --- /dev/null +++ b/test_sunifdef/test_cases/test0064.c @@ -0,0 +1,7 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +#if !defined(FOO1) && (defined(UNKNOWN) || defined(UNKNOWN)) +DELETE ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0064.c.expect b/test_sunifdef/test_cases/test0064.c.expect new file mode 100644 index 0000000..f50900f --- /dev/null +++ b/test_sunifdef/test_cases/test0064.c.expect @@ -0,0 +1,3 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +KEEP ME diff --git a/test_sunifdef/test_cases/test0065.c b/test_sunifdef/test_cases/test0065.c new file mode 100644 index 0000000..9ce6798 --- /dev/null +++ b/test_sunifdef/test_cases/test0065.c @@ -0,0 +1,7 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +#if !defined(FOO1) && defined(UNKNOWN) || defined(UNKNOWN) +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0065.c.expect b/test_sunifdef/test_cases/test0065.c.expect new file mode 100644 index 0000000..5554cde --- /dev/null +++ b/test_sunifdef/test_cases/test0065.c.expect @@ -0,0 +1,7 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +#if defined(UNKNOWN) +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0066.c b/test_sunifdef/test_cases/test0066.c new file mode 100644 index 0000000..8489edd --- /dev/null +++ b/test_sunifdef/test_cases/test0066.c @@ -0,0 +1,7 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 0 */ +#if 1 && 2 +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0066.c.expect b/test_sunifdef/test_cases/test0066.c.expect new file mode 100644 index 0000000..5bdb47c --- /dev/null +++ b/test_sunifdef/test_cases/test0066.c.expect @@ -0,0 +1,7 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 0 */ +#if 1 && 2 +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0067.c b/test_sunifdef/test_cases/test0067.c new file mode 100644 index 0000000..5c3c1aa --- /dev/null +++ b/test_sunifdef/test_cases/test0067.c @@ -0,0 +1,7 @@ +/**ARGS: --constant eval,del -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +#if 1 && 2 +KEEP ME +#else +DELETE ME +#endif diff --git a/test_sunifdef/test_cases/test0067.c.expect b/test_sunifdef/test_cases/test0067.c.expect new file mode 100644 index 0000000..6bd3fc6 --- /dev/null +++ b/test_sunifdef/test_cases/test0067.c.expect @@ -0,0 +1,3 @@ +/**ARGS: --constant eval,del -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +KEEP ME diff --git a/test_sunifdef/test_cases/test0068.c b/test_sunifdef/test_cases/test0068.c new file mode 100644 index 0000000..e283254 --- /dev/null +++ b/test_sunifdef/test_cases/test0068.c @@ -0,0 +1,7 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 0 */ +#if 1 || 2 +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0068.c.expect b/test_sunifdef/test_cases/test0068.c.expect new file mode 100644 index 0000000..35b384c --- /dev/null +++ b/test_sunifdef/test_cases/test0068.c.expect @@ -0,0 +1,7 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 0 */ +#if 1 || 2 +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0069.c b/test_sunifdef/test_cases/test0069.c new file mode 100644 index 0000000..c22a3d7 --- /dev/null +++ b/test_sunifdef/test_cases/test0069.c @@ -0,0 +1,7 @@ +/**ARGS: --constant eval -DFOO1 -UFOO2 */ +/**SYSCODE: = 0 */ +#if 1 || 2 +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0069.c.expect b/test_sunifdef/test_cases/test0069.c.expect new file mode 100644 index 0000000..a1d8f4a --- /dev/null +++ b/test_sunifdef/test_cases/test0069.c.expect @@ -0,0 +1,7 @@ +/**ARGS: --constant eval -DFOO1 -UFOO2 */ +/**SYSCODE: = 0 */ +#if 1 || 2 +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0070.c b/test_sunifdef/test_cases/test0070.c new file mode 100644 index 0000000..a73c973 --- /dev/null +++ b/test_sunifdef/test_cases/test0070.c @@ -0,0 +1,5 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 0 */ +#if (((defined(UNKNOWN)))) +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0070.c.expect b/test_sunifdef/test_cases/test0070.c.expect new file mode 100644 index 0000000..6b6e936 --- /dev/null +++ b/test_sunifdef/test_cases/test0070.c.expect @@ -0,0 +1,5 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 0 */ +#if (((defined(UNKNOWN)))) +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0071.c b/test_sunifdef/test_cases/test0071.c new file mode 100644 index 0000000..0c8428e --- /dev/null +++ b/test_sunifdef/test_cases/test0071.c @@ -0,0 +1,7 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +#undef FOO1 +#define FOO1 +#ifdef FOO1 +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0071.c.expect b/test_sunifdef/test_cases/test0071.c.expect new file mode 100644 index 0000000..f50900f --- /dev/null +++ b/test_sunifdef/test_cases/test0071.c.expect @@ -0,0 +1,3 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +KEEP ME diff --git a/test_sunifdef/test_cases/test0072.c b/test_sunifdef/test_cases/test0072.c new file mode 100644 index 0000000..db68852 --- /dev/null +++ b/test_sunifdef/test_cases/test0072.c @@ -0,0 +1,7 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +#ifndef FOO1 +#undef FOO1 +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0072.c.expect b/test_sunifdef/test_cases/test0072.c.expect new file mode 100644 index 0000000..f50900f --- /dev/null +++ b/test_sunifdef/test_cases/test0072.c.expect @@ -0,0 +1,3 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +KEEP ME diff --git a/test_sunifdef/test_cases/test0073.c b/test_sunifdef/test_cases/test0073.c new file mode 100644 index 0000000..94a72eb --- /dev/null +++ b/test_sunifdef/test_cases/test0073.c @@ -0,0 +1,7 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +#ifdef FOO1 +KEEPME +#else +#undef FOO1 +#endif diff --git a/test_sunifdef/test_cases/test0073.c.expect b/test_sunifdef/test_cases/test0073.c.expect new file mode 100644 index 0000000..55bf729 --- /dev/null +++ b/test_sunifdef/test_cases/test0073.c.expect @@ -0,0 +1,3 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +KEEPME diff --git a/test_sunifdef/test_cases/test0074.c b/test_sunifdef/test_cases/test0074.c new file mode 100644 index 0000000..81c6afb --- /dev/null +++ b/test_sunifdef/test_cases/test0074.c @@ -0,0 +1,3 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 0 */ +#undef UNKNOWN diff --git a/test_sunifdef/test_cases/test0074.c.expect b/test_sunifdef/test_cases/test0074.c.expect new file mode 100644 index 0000000..fb1a819 --- /dev/null +++ b/test_sunifdef/test_cases/test0074.c.expect @@ -0,0 +1,3 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 0 */ +#undef UNKNOWN diff --git a/test_sunifdef/test_cases/test0075.c b/test_sunifdef/test_cases/test0075.c new file mode 100644 index 0000000..44bb89b --- /dev/null +++ b/test_sunifdef/test_cases/test0075.c @@ -0,0 +1,16 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 0 */ +// None of these literals should an unbalanced quote or unbalanced +// comment error +static const char * str1 = "'"; +static const char * str2 = "\'"; +static const char ch1 = '"'; +static const char ch2 = '\"'; +static const char *str3 = "//"; +static const char *str4 = "/*"; +static const char str5 = "*/"; +static const char str6 ="\ +text\ +"; +static const char *str7 = "\ +/* This is not a comment */"; diff --git a/test_sunifdef/test_cases/test0075.c.expect b/test_sunifdef/test_cases/test0075.c.expect new file mode 100644 index 0000000..49ffb64 --- /dev/null +++ b/test_sunifdef/test_cases/test0075.c.expect @@ -0,0 +1,16 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 0 */ +// None of these literals should an unbalanced quote or unbalanced +// comment error +static const char * str1 = "'"; +static const char * str2 = "\'"; +static const char ch1 = '"'; +static const char ch2 = '\"'; +static const char *str3 = "//"; +static const char *str4 = "/*"; +static const char str5 = "*/"; +static const char str6 ="\ +text\ +"; +static const char *str7 = "\ +/* This is not a comment */"; diff --git a/test_sunifdef/test_cases/test0076.c b/test_sunifdef/test_cases/test0076.c new file mode 100644 index 0000000..bd7a462 --- /dev/null +++ b/test_sunifdef/test_cases/test0076.c @@ -0,0 +1,6 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 0 */ +// None of these comments should cause an unbalanced quote error +// This comment has contains an unclosed "-character. +// This comment doesn't but it contains an unclosed single quote. +/* The following comment terminator isn't quoted by the previous apostrophe. */ diff --git a/test_sunifdef/test_cases/test0076.c.expect b/test_sunifdef/test_cases/test0076.c.expect new file mode 100644 index 0000000..b170f01 --- /dev/null +++ b/test_sunifdef/test_cases/test0076.c.expect @@ -0,0 +1,6 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 0 */ +// None of these comments should cause an unbalanced quote error +// This comment has contains an unclosed "-character. +// This comment doesn't but it contains an unclosed single quote. +/* The following comment terminator isn't quoted by the previous apostrophe. */ diff --git a/test_sunifdef/test_cases/test0077.c b/test_sunifdef/test_cases/test0077.c new file mode 100644 index 0000000..27c7a53 --- /dev/null +++ b/test_sunifdef/test_cases/test0077.c @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 0 */ +// Error directive should not cause an unbalanced quote error +#ifdef TESTVAR +#error With a ' and a " a /* Comment */ and a // Comment +#else +DELETE ME +#endif diff --git a/test_sunifdef/test_cases/test0077.c.expect b/test_sunifdef/test_cases/test0077.c.expect new file mode 100644 index 0000000..2587c17 --- /dev/null +++ b/test_sunifdef/test_cases/test0077.c.expect @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 0 */ +// Error directive should not cause an unbalanced quote error +#ifdef TESTVAR +#error With a ' and a " a /* Comment */ and a // Comment +#else +DELETE ME +#endif diff --git a/test_sunifdef/test_cases/test0078.c b/test_sunifdef/test_cases/test0078.c new file mode 100644 index 0000000..6855408 --- /dev/null +++ b/test_sunifdef/test_cases/test0078.c @@ -0,0 +1,15 @@ +/**ARGS: -DFOO1 -UFOO2 -DBAR1 -UBAR2 */ +/**SYSCODE: = 1 | 16 */ +#ifdef FOO1 + #ifndef FOO2 + KEEP ME + #else + DELETE ME + #endif +#else + #ifdef BAR1 + DELETE ME + #else + DELETE ME + #endif +#endif diff --git a/test_sunifdef/test_cases/test0078.c.expect b/test_sunifdef/test_cases/test0078.c.expect new file mode 100644 index 0000000..5b92ce3 --- /dev/null +++ b/test_sunifdef/test_cases/test0078.c.expect @@ -0,0 +1,3 @@ +/**ARGS: -DFOO1 -UFOO2 -DBAR1 -UBAR2 */ +/**SYSCODE: = 1 | 16 */ + KEEP ME diff --git a/test_sunifdef/test_cases/test0079.c b/test_sunifdef/test_cases/test0079.c new file mode 100644 index 0000000..ca71afb --- /dev/null +++ b/test_sunifdef/test_cases/test0079.c @@ -0,0 +1,21 @@ +/**ARGS: -DFOO1 -UFOO2 -DBAR1 -UBAR2 */ +/**SYSCODE: = 1 | 16 | 32 */ +#if defined UNKNOWN + #ifndef FOO2 + KEEP ME + #else + DELETE ME + #endif +#elif defined FOO1 + #ifndef BAR2 + KEEP ME + #else + DELETE ME + #endif +#elif !defined(BAR1) + #if defined BAR1 + DELETE ME + #elif !defined(BAR2) + DELETE ME + #endif +#endif diff --git a/test_sunifdef/test_cases/test0079.c.expect b/test_sunifdef/test_cases/test0079.c.expect new file mode 100644 index 0000000..d95bd76 --- /dev/null +++ b/test_sunifdef/test_cases/test0079.c.expect @@ -0,0 +1,7 @@ +/**ARGS: -DFOO1 -UFOO2 -DBAR1 -UBAR2 */ +/**SYSCODE: = 1 | 16 | 32 */ +#if defined UNKNOWN + KEEP ME +#else + KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0080.c b/test_sunifdef/test_cases/test0080.c new file mode 100644 index 0000000..ca7c0b8 --- /dev/null +++ b/test_sunifdef/test_cases/test0080.c @@ -0,0 +1,5 @@ +/**ARGS: -DFOO1 -UFOO2 -DBAR1 -UBAR2 */ +/**SYSCODE: = 0 */ +#if FOO1 +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0080.c.expect b/test_sunifdef/test_cases/test0080.c.expect new file mode 100644 index 0000000..0ab6fdb --- /dev/null +++ b/test_sunifdef/test_cases/test0080.c.expect @@ -0,0 +1,5 @@ +/**ARGS: -DFOO1 -UFOO2 -DBAR1 -UBAR2 */ +/**SYSCODE: = 0 */ +#if FOO1 +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0081.c b/test_sunifdef/test_cases/test0081.c new file mode 100644 index 0000000..86ede5b --- /dev/null +++ b/test_sunifdef/test_cases/test0081.c @@ -0,0 +1,5 @@ +/**ARGS: -DFOO1=1 -UFOO2 -DBAR1 -UBAR2 */ +/**SYSCODE: = 1 | 16 */ +#if FOO1 +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0081.c.expect b/test_sunifdef/test_cases/test0081.c.expect new file mode 100644 index 0000000..daead69 --- /dev/null +++ b/test_sunifdef/test_cases/test0081.c.expect @@ -0,0 +1,3 @@ +/**ARGS: -DFOO1=1 -UFOO2 -DBAR1 -UBAR2 */ +/**SYSCODE: = 1 | 16 */ +KEEP ME diff --git a/test_sunifdef/test_cases/test0082.c b/test_sunifdef/test_cases/test0082.c new file mode 100644 index 0000000..f0c8182 --- /dev/null +++ b/test_sunifdef/test_cases/test0082.c @@ -0,0 +1,5 @@ +/**ARGS: -DFOO1=0 -UFOO2 -DBAR1 -UBAR2 */ +/**SYSCODE: = 1 | 16 */ +#if FOO1 +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0082.c.expect b/test_sunifdef/test_cases/test0082.c.expect new file mode 100644 index 0000000..233194c --- /dev/null +++ b/test_sunifdef/test_cases/test0082.c.expect @@ -0,0 +1,2 @@ +/**ARGS: -DFOO1=0 -UFOO2 -DBAR1 -UBAR2 */ +/**SYSCODE: = 1 | 16 */ diff --git a/test_sunifdef/test_cases/test0083.c b/test_sunifdef/test_cases/test0083.c new file mode 100644 index 0000000..c600635 --- /dev/null +++ b/test_sunifdef/test_cases/test0083.c @@ -0,0 +1,5 @@ +/**ARGS: -DFOO1=1 -UFOO2 -DBAR1=1 -UBAR2 */ +/**SYSCODE: = 1 | 16 */ +#if FOO1 == BAR1 +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0083.c.expect b/test_sunifdef/test_cases/test0083.c.expect new file mode 100644 index 0000000..0deffa6 --- /dev/null +++ b/test_sunifdef/test_cases/test0083.c.expect @@ -0,0 +1,3 @@ +/**ARGS: -DFOO1=1 -UFOO2 -DBAR1=1 -UBAR2 */ +/**SYSCODE: = 1 | 16 */ +KEEP ME diff --git a/test_sunifdef/test_cases/test0084.c b/test_sunifdef/test_cases/test0084.c new file mode 100644 index 0000000..199b4d5 --- /dev/null +++ b/test_sunifdef/test_cases/test0084.c @@ -0,0 +1,5 @@ +/**ARGS: --constant eval -DFOO1=1 -UFOO2 -DBAR1=1 -UBAR2 */ +/**SYSCODE: = 1 | 16 */ +#if 1 == BAR1 +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0084.c.expect b/test_sunifdef/test_cases/test0084.c.expect new file mode 100644 index 0000000..4a1b431 --- /dev/null +++ b/test_sunifdef/test_cases/test0084.c.expect @@ -0,0 +1,3 @@ +/**ARGS: --constant eval -DFOO1=1 -UFOO2 -DBAR1=1 -UBAR2 */ +/**SYSCODE: = 1 | 16 */ +KEEP ME diff --git a/test_sunifdef/test_cases/test0085.c b/test_sunifdef/test_cases/test0085.c new file mode 100644 index 0000000..c90442e --- /dev/null +++ b/test_sunifdef/test_cases/test0085.c @@ -0,0 +1,5 @@ +/**ARGS: -DFOO1=1 -UFOO2 -DBAR1=1 -UBAR2 */ +/**SYSCODE: = 1 | 16 */ +#if 1 == BAR1 +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0085.c.expect b/test_sunifdef/test_cases/test0085.c.expect new file mode 100644 index 0000000..59256c2 --- /dev/null +++ b/test_sunifdef/test_cases/test0085.c.expect @@ -0,0 +1,4 @@ +/**ARGS: -DFOO1=1 -UFOO2 -DBAR1=1 -UBAR2 */ +/**SYSCODE: = 1 | 16 */ +KEEP ME + diff --git a/test_sunifdef/test_cases/test0086.c b/test_sunifdef/test_cases/test0086.c new file mode 100644 index 0000000..1fa9b00 --- /dev/null +++ b/test_sunifdef/test_cases/test0086.c @@ -0,0 +1,5 @@ +/**ARGS: -DFOO1=1 -UFOO2 -DBAR1=1 -UBAR2 */ +/**SYSCODE: = 1 | 16 */ +#if 1 < 2 +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0086.c.expect b/test_sunifdef/test_cases/test0086.c.expect new file mode 100644 index 0000000..59256c2 --- /dev/null +++ b/test_sunifdef/test_cases/test0086.c.expect @@ -0,0 +1,4 @@ +/**ARGS: -DFOO1=1 -UFOO2 -DBAR1=1 -UBAR2 */ +/**SYSCODE: = 1 | 16 */ +KEEP ME + diff --git a/test_sunifdef/test_cases/test0087.c b/test_sunifdef/test_cases/test0087.c new file mode 100644 index 0000000..6da72cb --- /dev/null +++ b/test_sunifdef/test_cases/test0087.c @@ -0,0 +1,5 @@ +/**ARGS: --constant eval -DFOO1=1 -UFOO2 -DBAR1=1 -UBAR2 */ +/**SYSCODE: = 1 | 16 */ +#if 1 < 2 +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0087.c.expect b/test_sunifdef/test_cases/test0087.c.expect new file mode 100644 index 0000000..4a1b431 --- /dev/null +++ b/test_sunifdef/test_cases/test0087.c.expect @@ -0,0 +1,3 @@ +/**ARGS: --constant eval -DFOO1=1 -UFOO2 -DBAR1=1 -UBAR2 */ +/**SYSCODE: = 1 | 16 */ +KEEP ME diff --git a/test_sunifdef/test_cases/test0088.c b/test_sunifdef/test_cases/test0088.c new file mode 100644 index 0000000..e75fd09 --- /dev/null +++ b/test_sunifdef/test_cases/test0088.c @@ -0,0 +1,17 @@ +/**ARGS: --symbols all */ +/**SYSCODE: = 0 */ +#ifdef FOO1 +KEEP ME +#endif +#if defined(FOO2) && defined(FOO2) +KEEP ME +#elif defined FOO3 || defined FOO4 +KEEP ME +#elif FOO5 +KEEP ME +#endif +#ifndef FOO1 +DELETE ME +#endif + + diff --git a/test_sunifdef/test_cases/test0088.c.expect b/test_sunifdef/test_cases/test0088.c.expect new file mode 100644 index 0000000..8b227c6 --- /dev/null +++ b/test_sunifdef/test_cases/test0088.c.expect @@ -0,0 +1,7 @@ +FOO1 +FOO2 +FOO2 +FOO3 +FOO4 +FOO5 +FOO1 diff --git a/test_sunifdef/test_cases/test0089.c b/test_sunifdef/test_cases/test0089.c new file mode 100644 index 0000000..d32efc4 --- /dev/null +++ b/test_sunifdef/test_cases/test0089.c @@ -0,0 +1,12 @@ +/**ARGS: -sa */ +/**SYSCODE: = 0 */ +#ifdef FOO1 +KEEP ME +#endif +#if defined(FOO2) && defined(FOO2) +KEEP ME +#elif defined FOO3 || defined FOO4 +KEEP ME +#elif FOO5 +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0089.c.expect b/test_sunifdef/test_cases/test0089.c.expect new file mode 100644 index 0000000..b46c6c3 --- /dev/null +++ b/test_sunifdef/test_cases/test0089.c.expect @@ -0,0 +1,6 @@ +FOO1 +FOO2 +FOO2 +FOO3 +FOO4 +FOO5 diff --git a/test_sunifdef/test_cases/test0090.c b/test_sunifdef/test_cases/test0090.c new file mode 100644 index 0000000..de6c99a --- /dev/null +++ b/test_sunifdef/test_cases/test0090.c @@ -0,0 +1,7 @@ +/**ARGS: -UFOO1 */ +/**SYSCODE: = 1 | 16 */ +#if 1 && defined(FOO1) +DELETE ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0090.c.expect b/test_sunifdef/test_cases/test0090.c.expect new file mode 100644 index 0000000..708f098 --- /dev/null +++ b/test_sunifdef/test_cases/test0090.c.expect @@ -0,0 +1,3 @@ +/**ARGS: -UFOO1 */ +/**SYSCODE: = 1 | 16 */ +KEEP ME diff --git a/test_sunifdef/test_cases/test0091.c b/test_sunifdef/test_cases/test0091.c new file mode 100644 index 0000000..eae7e2a --- /dev/null +++ b/test_sunifdef/test_cases/test0091.c @@ -0,0 +1,5 @@ +/**ARGS: -UFOO1 */ +/**SYSCODE: = 1 | 32 */ +#if 1 || defined(FOO1) +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0091.c.expect b/test_sunifdef/test_cases/test0091.c.expect new file mode 100644 index 0000000..0f41ff6 --- /dev/null +++ b/test_sunifdef/test_cases/test0091.c.expect @@ -0,0 +1,5 @@ +/**ARGS: -UFOO1 */ +/**SYSCODE: = 1 | 32 */ +#if 1 +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0092.c b/test_sunifdef/test_cases/test0092.c new file mode 100644 index 0000000..60cdc77 --- /dev/null +++ b/test_sunifdef/test_cases/test0092.c @@ -0,0 +1,7 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 0 */ +#if 1 +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0092.c.expect b/test_sunifdef/test_cases/test0092.c.expect new file mode 100644 index 0000000..5b3ca54 --- /dev/null +++ b/test_sunifdef/test_cases/test0092.c.expect @@ -0,0 +1,7 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 0 */ +#if 1 +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0093.c b/test_sunifdef/test_cases/test0093.c new file mode 100644 index 0000000..b390a2b --- /dev/null +++ b/test_sunifdef/test_cases/test0093.c @@ -0,0 +1,7 @@ +/**ARGS: --constant eval -DFOO1 -UFOO2 */ +/**SYSCODE: = 0 */ +#if 1 +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0093.c.expect b/test_sunifdef/test_cases/test0093.c.expect new file mode 100644 index 0000000..f1eb92b --- /dev/null +++ b/test_sunifdef/test_cases/test0093.c.expect @@ -0,0 +1,7 @@ +/**ARGS: --constant eval -DFOO1 -UFOO2 */ +/**SYSCODE: = 0 */ +#if 1 +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0094.c b/test_sunifdef/test_cases/test0094.c new file mode 100644 index 0000000..ebd3215 --- /dev/null +++ b/test_sunifdef/test_cases/test0094.c @@ -0,0 +1,7 @@ +/**ARGS: --constant eval,del -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +#if 1 +KEEP ME +#else +DELETE ME +#endif diff --git a/test_sunifdef/test_cases/test0094.c.expect b/test_sunifdef/test_cases/test0094.c.expect new file mode 100644 index 0000000..6bd3fc6 --- /dev/null +++ b/test_sunifdef/test_cases/test0094.c.expect @@ -0,0 +1,3 @@ +/**ARGS: --constant eval,del -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +KEEP ME diff --git a/test_sunifdef/test_cases/test0095.c b/test_sunifdef/test_cases/test0095.c new file mode 100644 index 0000000..8d433e3 --- /dev/null +++ b/test_sunifdef/test_cases/test0095.c @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +/* Left(unk) && Right(true,elim) := Left */ +#if 1 && defined(FOO1) +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0095.c.expect b/test_sunifdef/test_cases/test0095.c.expect new file mode 100644 index 0000000..d1f66fd --- /dev/null +++ b/test_sunifdef/test_cases/test0095.c.expect @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +/* Left(unk) && Right(true,elim) := Left */ +#if 1 +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0096.c b/test_sunifdef/test_cases/test0096.c new file mode 100644 index 0000000..a3a1594 --- /dev/null +++ b/test_sunifdef/test_cases/test0096.c @@ -0,0 +1,8 @@ +/**ARGS: --constant eval -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +/* Left(true,keep) && Right(true,elim) := Left */ +#if 1 && defined(FOO1) +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0096.c.expect b/test_sunifdef/test_cases/test0096.c.expect new file mode 100644 index 0000000..f382edf --- /dev/null +++ b/test_sunifdef/test_cases/test0096.c.expect @@ -0,0 +1,8 @@ +/**ARGS: --constant eval -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +/* Left(true,keep) && Right(true,elim) := Left */ +#if 1 +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0097.c b/test_sunifdef/test_cases/test0097.c new file mode 100644 index 0000000..944ed3e --- /dev/null +++ b/test_sunifdef/test_cases/test0097.c @@ -0,0 +1,8 @@ +/**ARGS: --constant eval -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +/* Left(true,elim) && Right(true,keep) := Right */ +#if defined(FOO1) && 1 +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0097.c.expect b/test_sunifdef/test_cases/test0097.c.expect new file mode 100644 index 0000000..e040d86 --- /dev/null +++ b/test_sunifdef/test_cases/test0097.c.expect @@ -0,0 +1,8 @@ +/**ARGS: --constant eval -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +/* Left(true,elim) && Right(true,keep) := Right */ +#if 1 +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0098.c b/test_sunifdef/test_cases/test0098.c new file mode 100644 index 0000000..4ce5318 --- /dev/null +++ b/test_sunifdef/test_cases/test0098.c @@ -0,0 +1,8 @@ +/**ARGS: --constant eval,del -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +/* Left(true,elim) && Right(true,elim) := Elim */ +#if 1 && defined(FOO1) +KEEP ME +#else +DELETE ME +#endif diff --git a/test_sunifdef/test_cases/test0098.c.expect b/test_sunifdef/test_cases/test0098.c.expect new file mode 100644 index 0000000..1c0438e --- /dev/null +++ b/test_sunifdef/test_cases/test0098.c.expect @@ -0,0 +1,4 @@ +/**ARGS: --constant eval,del -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +/* Left(true,elim) && Right(true,elim) := Elim */ +KEEP ME diff --git a/test_sunifdef/test_cases/test0099.c b/test_sunifdef/test_cases/test0099.c new file mode 100644 index 0000000..d382ff0 --- /dev/null +++ b/test_sunifdef/test_cases/test0099.c @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +/* Left(unk) && Right(false,elim) := Elim */ +#if 1 && defined(FOO2) +DELETE ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0099.c.expect b/test_sunifdef/test_cases/test0099.c.expect new file mode 100644 index 0000000..9692a09 --- /dev/null +++ b/test_sunifdef/test_cases/test0099.c.expect @@ -0,0 +1,4 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +/* Left(unk) && Right(false,elim) := Elim */ +KEEP ME diff --git a/test_sunifdef/test_cases/test0100.c b/test_sunifdef/test_cases/test0100.c new file mode 100644 index 0000000..78d65cd --- /dev/null +++ b/test_sunifdef/test_cases/test0100.c @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +/* Left(false,elim) && Right(unk) := Elim */ +#if defined(FOO2) && 1 +DELETE ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0100.c.expect b/test_sunifdef/test_cases/test0100.c.expect new file mode 100644 index 0000000..ba71f38 --- /dev/null +++ b/test_sunifdef/test_cases/test0100.c.expect @@ -0,0 +1,4 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +/* Left(false,elim) && Right(unk) := Elim */ +KEEP ME diff --git a/test_sunifdef/test_cases/test0101.c b/test_sunifdef/test_cases/test0101.c new file mode 100644 index 0000000..4b7a0e0 --- /dev/null +++ b/test_sunifdef/test_cases/test0101.c @@ -0,0 +1,8 @@ +/**ARGS: --constant eval -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +/* Left(true,keep) && Right(false,elim) := Elim */ +#if 1 && defined(FOO2) +DELETE ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0101.c.expect b/test_sunifdef/test_cases/test0101.c.expect new file mode 100644 index 0000000..f7a633f --- /dev/null +++ b/test_sunifdef/test_cases/test0101.c.expect @@ -0,0 +1,4 @@ +/**ARGS: --constant eval -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +/* Left(true,keep) && Right(false,elim) := Elim */ +KEEP ME diff --git a/test_sunifdef/test_cases/test0102.c b/test_sunifdef/test_cases/test0102.c new file mode 100644 index 0000000..fa1eb9b --- /dev/null +++ b/test_sunifdef/test_cases/test0102.c @@ -0,0 +1,8 @@ +/**ARGS: --constant eval,del -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +/* Left(true,elim) && Right(false,elim) := Elim */ +#if 1 && defined(FOO2) +DELETE ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0102.c.expect b/test_sunifdef/test_cases/test0102.c.expect new file mode 100644 index 0000000..1a65a8f --- /dev/null +++ b/test_sunifdef/test_cases/test0102.c.expect @@ -0,0 +1,4 @@ +/**ARGS: --constant eval,del -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +/* Left(true,elim) && Right(false,elim) := Elim */ +KEEP ME diff --git a/test_sunifdef/test_cases/test0103.c b/test_sunifdef/test_cases/test0103.c new file mode 100644 index 0000000..507b63e --- /dev/null +++ b/test_sunifdef/test_cases/test0103.c @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 0 */ +/* Left(unk) && Right(unk) := Keep */ +#if 1 && defined(UNKNOWN) +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0103.c.expect b/test_sunifdef/test_cases/test0103.c.expect new file mode 100644 index 0000000..a6f3b2f --- /dev/null +++ b/test_sunifdef/test_cases/test0103.c.expect @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 0 */ +/* Left(unk) && Right(unk) := Keep */ +#if 1 && defined(UNKNOWN) +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0104.c b/test_sunifdef/test_cases/test0104.c new file mode 100644 index 0000000..f66add4 --- /dev/null +++ b/test_sunifdef/test_cases/test0104.c @@ -0,0 +1,8 @@ +/**ARGS: --constant eval -DFOO1 -UFOO2 */ +/**SYSCODE: = 0 */ +/* Left(true,keep) && Left(unk) := Keep */ +#if 1 && defined(UNKNOWN) +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0104.c.expect b/test_sunifdef/test_cases/test0104.c.expect new file mode 100644 index 0000000..8785aac --- /dev/null +++ b/test_sunifdef/test_cases/test0104.c.expect @@ -0,0 +1,8 @@ +/**ARGS: --constant eval -DFOO1 -UFOO2 */ +/**SYSCODE: = 0 */ +/* Left(true,keep) && Left(unk) := Keep */ +#if 1 && defined(UNKNOWN) +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0105.c b/test_sunifdef/test_cases/test0105.c new file mode 100644 index 0000000..58cd7d9 --- /dev/null +++ b/test_sunifdef/test_cases/test0105.c @@ -0,0 +1,8 @@ +/**ARGS: --constant eval,del -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +/* Left(true,elim) && Right(unk) := Right */ +#if 1 && defined(UNKNOWN) +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0105.c.expect b/test_sunifdef/test_cases/test0105.c.expect new file mode 100644 index 0000000..25ca3be --- /dev/null +++ b/test_sunifdef/test_cases/test0105.c.expect @@ -0,0 +1,8 @@ +/**ARGS: --constant eval,del -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +/* Left(true,elim) && Right(unk) := Right */ +#if defined(UNKNOWN) +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0106.c b/test_sunifdef/test_cases/test0106.c new file mode 100644 index 0000000..2534882 --- /dev/null +++ b/test_sunifdef/test_cases/test0106.c @@ -0,0 +1,8 @@ +/**ARGS: --constant eval,del -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +/* Left(unk) && Left(true,elim) := Left */ +#if defined(UNKNOWN) && 1 +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0106.c.expect b/test_sunifdef/test_cases/test0106.c.expect new file mode 100644 index 0000000..76bee7e --- /dev/null +++ b/test_sunifdef/test_cases/test0106.c.expect @@ -0,0 +1,8 @@ +/**ARGS: --constant eval,del -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +/* Left(unk) && Left(true,elim) := Left */ +#if defined(UNKNOWN) +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0107.c b/test_sunifdef/test_cases/test0107.c new file mode 100644 index 0000000..b4b64c3 --- /dev/null +++ b/test_sunifdef/test_cases/test0107.c @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +/* Left(unk) || Right(true,elim) := Elim */ +#if 1 || defined(FOO1) +KEEP ME +#else +DELETE ME +#endif diff --git a/test_sunifdef/test_cases/test0107.c.expect b/test_sunifdef/test_cases/test0107.c.expect new file mode 100644 index 0000000..1afe764 --- /dev/null +++ b/test_sunifdef/test_cases/test0107.c.expect @@ -0,0 +1,4 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +/* Left(unk) || Right(true,elim) := Elim */ +KEEP ME diff --git a/test_sunifdef/test_cases/test0108.c b/test_sunifdef/test_cases/test0108.c new file mode 100644 index 0000000..1036f90 --- /dev/null +++ b/test_sunifdef/test_cases/test0108.c @@ -0,0 +1,8 @@ +/**ARGS: --constant eval -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +/* Left(true,keep) || Right(true,elim) := Left */ +#if 1 || defined(FOO1) +KEEP ME +#else +DELETE ME +#endif diff --git a/test_sunifdef/test_cases/test0108.c.expect b/test_sunifdef/test_cases/test0108.c.expect new file mode 100644 index 0000000..81b3adf --- /dev/null +++ b/test_sunifdef/test_cases/test0108.c.expect @@ -0,0 +1,9 @@ +/**ARGS: --constant eval -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +/* Left(true,keep) || Right(true,elim) := Left */ +#if 1 +KEEP ME +#else +DELETE ME +#endif + diff --git a/test_sunifdef/test_cases/test0109.c b/test_sunifdef/test_cases/test0109.c new file mode 100644 index 0000000..791517b --- /dev/null +++ b/test_sunifdef/test_cases/test0109.c @@ -0,0 +1,8 @@ +/**ARGS: --constant eval,del -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +/* Left(true,elim) || Right(true,elim) := Elim */ +#if 1 || defined(FOO1) +KEEP ME +#else +DELETE ME +#endif diff --git a/test_sunifdef/test_cases/test0109.c.expect b/test_sunifdef/test_cases/test0109.c.expect new file mode 100644 index 0000000..bc0cf86 --- /dev/null +++ b/test_sunifdef/test_cases/test0109.c.expect @@ -0,0 +1,4 @@ +/**ARGS: --constant eval,del -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +/* Left(true,elim) || Right(true,elim) := Elim */ +KEEP ME diff --git a/test_sunifdef/test_cases/test0110.c b/test_sunifdef/test_cases/test0110.c new file mode 100644 index 0000000..c906d04 --- /dev/null +++ b/test_sunifdef/test_cases/test0110.c @@ -0,0 +1,8 @@ +/**ARGS: --constant eval,del -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +/* Left(true,elim) || Right(true,elim) := Elim */ +#if defined(FOO1) || 1 +KEEP ME +#else +DELETE ME +#endif diff --git a/test_sunifdef/test_cases/test0110.c.expect b/test_sunifdef/test_cases/test0110.c.expect new file mode 100644 index 0000000..c07ef2e --- /dev/null +++ b/test_sunifdef/test_cases/test0110.c.expect @@ -0,0 +1,4 @@ +/**ARGS: --constant eval,del -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +/* Left(true,elim) || Right(true,elim) := Elim */ +KEEP ME diff --git a/test_sunifdef/test_cases/test0111.c b/test_sunifdef/test_cases/test0111.c new file mode 100644 index 0000000..d8bf631 --- /dev/null +++ b/test_sunifdef/test_cases/test0111.c @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +/* Left(unk) || Right(false,elim) := Left */ +#if 1 || defined(FOO2) +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0111.c.expect b/test_sunifdef/test_cases/test0111.c.expect new file mode 100644 index 0000000..4c7ccd5 --- /dev/null +++ b/test_sunifdef/test_cases/test0111.c.expect @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +/* Left(unk) || Right(false,elim) := Left */ +#if 1 +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0112.c b/test_sunifdef/test_cases/test0112.c new file mode 100644 index 0000000..1ddda32 --- /dev/null +++ b/test_sunifdef/test_cases/test0112.c @@ -0,0 +1,8 @@ +/**ARGS: --constant eval -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +/* Left(true,keep) || Right(false,elim) := Left */ +#if 1 || defined(FOO2) +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0112.c.expect b/test_sunifdef/test_cases/test0112.c.expect new file mode 100644 index 0000000..ee1b642 --- /dev/null +++ b/test_sunifdef/test_cases/test0112.c.expect @@ -0,0 +1,8 @@ +/**ARGS: --constant eval -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +/* Left(true,keep) || Right(false,elim) := Left */ +#if 1 +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0113.c b/test_sunifdef/test_cases/test0113.c new file mode 100644 index 0000000..5abe322 --- /dev/null +++ b/test_sunifdef/test_cases/test0113.c @@ -0,0 +1,8 @@ +/**ARGS: --constant eval -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +/* Left(false,elim) || Right(true,keep) := Right */ +#if defined(FOO2) || 1 +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0113.c.expect b/test_sunifdef/test_cases/test0113.c.expect new file mode 100644 index 0000000..5eb292d --- /dev/null +++ b/test_sunifdef/test_cases/test0113.c.expect @@ -0,0 +1,8 @@ +/**ARGS: --constant eval -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +/* Left(false,elim) || Right(true,keep) := Right */ +#if 1 +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0114.c b/test_sunifdef/test_cases/test0114.c new file mode 100644 index 0000000..5ae086c --- /dev/null +++ b/test_sunifdef/test_cases/test0114.c @@ -0,0 +1,8 @@ +/**ARGS: --constant eval,del -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +/* Left(true,elim) || Right(false,elim) := Elim */ +#if 1 || defined(FOO2) +KEEP ME +#else +DELETE ME +#endif diff --git a/test_sunifdef/test_cases/test0114.c.expect b/test_sunifdef/test_cases/test0114.c.expect new file mode 100644 index 0000000..bbf44fe --- /dev/null +++ b/test_sunifdef/test_cases/test0114.c.expect @@ -0,0 +1,4 @@ +/**ARGS: --constant eval,del -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +/* Left(true,elim) || Right(false,elim) := Elim */ +KEEP ME diff --git a/test_sunifdef/test_cases/test0115.c b/test_sunifdef/test_cases/test0115.c new file mode 100644 index 0000000..fcb409f --- /dev/null +++ b/test_sunifdef/test_cases/test0115.c @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 0 */ +/* Left(unk) || Right(unk) := Keep */ +#if 1 || defined(UNKNOWN) +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0115.c.expect b/test_sunifdef/test_cases/test0115.c.expect new file mode 100644 index 0000000..cdc99b1 --- /dev/null +++ b/test_sunifdef/test_cases/test0115.c.expect @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 0 */ +/* Left(unk) || Right(unk) := Keep */ +#if 1 || defined(UNKNOWN) +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0116.c b/test_sunifdef/test_cases/test0116.c new file mode 100644 index 0000000..bc07ece --- /dev/null +++ b/test_sunifdef/test_cases/test0116.c @@ -0,0 +1,8 @@ +/**ARGS: --constant eval -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +/* Left(true,keep) || Right(unk) := Left */ +#if 1 || defined(UNKNOWN) +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0116.c.expect b/test_sunifdef/test_cases/test0116.c.expect new file mode 100644 index 0000000..960895f --- /dev/null +++ b/test_sunifdef/test_cases/test0116.c.expect @@ -0,0 +1,8 @@ +/**ARGS: --constant eval -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +/* Left(true,keep) || Right(unk) := Left */ +#if 1 +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0117.c b/test_sunifdef/test_cases/test0117.c new file mode 100644 index 0000000..99803e7 --- /dev/null +++ b/test_sunifdef/test_cases/test0117.c @@ -0,0 +1,8 @@ +/**ARGS: --constant eval -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +/* Left(unk) || Right(true,keep) := Right */ +#if defined(UNKNOWN) || 1 +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0117.c.expect b/test_sunifdef/test_cases/test0117.c.expect new file mode 100644 index 0000000..ff37c4f --- /dev/null +++ b/test_sunifdef/test_cases/test0117.c.expect @@ -0,0 +1,8 @@ +/**ARGS: --constant eval -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +/* Left(unk) || Right(true,keep) := Right */ +#if 1 +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0118.c b/test_sunifdef/test_cases/test0118.c new file mode 100644 index 0000000..45dfce3 --- /dev/null +++ b/test_sunifdef/test_cases/test0118.c @@ -0,0 +1,8 @@ +/**ARGS: --constant eval,del -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +/* Left(true,elim) || Right(unk) := Elim */ +#if 1 || defined(UNKNOWN) +KEEP ME +#else +DELETE ME +#endif diff --git a/test_sunifdef/test_cases/test0118.c.expect b/test_sunifdef/test_cases/test0118.c.expect new file mode 100644 index 0000000..c769576 --- /dev/null +++ b/test_sunifdef/test_cases/test0118.c.expect @@ -0,0 +1,4 @@ +/**ARGS: --constant eval,del -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +/* Left(true,elim) || Right(unk) := Elim */ +KEEP ME diff --git a/test_sunifdef/test_cases/test0119.c b/test_sunifdef/test_cases/test0119.c new file mode 100644 index 0000000..edaa5ed --- /dev/null +++ b/test_sunifdef/test_cases/test0119.c @@ -0,0 +1,7 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 0 */ +#if 0 +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0119.c.expect b/test_sunifdef/test_cases/test0119.c.expect new file mode 100644 index 0000000..ad2fd41 --- /dev/null +++ b/test_sunifdef/test_cases/test0119.c.expect @@ -0,0 +1,7 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 0 */ +#if 0 +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0120.c b/test_sunifdef/test_cases/test0120.c new file mode 100644 index 0000000..373fec3 --- /dev/null +++ b/test_sunifdef/test_cases/test0120.c @@ -0,0 +1,7 @@ +/**ARGS: --constant eval -DFOO1 -UFOO2 */ +/**SYSCODE: = 0 */ +#if 0 +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0120.c.expect b/test_sunifdef/test_cases/test0120.c.expect new file mode 100644 index 0000000..c294863 --- /dev/null +++ b/test_sunifdef/test_cases/test0120.c.expect @@ -0,0 +1,7 @@ +/**ARGS: --constant eval -DFOO1 -UFOO2 */ +/**SYSCODE: = 0 */ +#if 0 +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0121.c b/test_sunifdef/test_cases/test0121.c new file mode 100644 index 0000000..b48ec87 --- /dev/null +++ b/test_sunifdef/test_cases/test0121.c @@ -0,0 +1,7 @@ +/**ARGS: --constant eval,del -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +#if 0 +DELETE ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0121.c.expect b/test_sunifdef/test_cases/test0121.c.expect new file mode 100644 index 0000000..6bd3fc6 --- /dev/null +++ b/test_sunifdef/test_cases/test0121.c.expect @@ -0,0 +1,3 @@ +/**ARGS: --constant eval,del -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +KEEP ME diff --git a/test_sunifdef/test_cases/test0122.c b/test_sunifdef/test_cases/test0122.c new file mode 100644 index 0000000..be8e2f4 --- /dev/null +++ b/test_sunifdef/test_cases/test0122.c @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +/* Left(unk) && Right(true,elim) := Left */ +#if 0 && defined(FOO1) +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0122.c.expect b/test_sunifdef/test_cases/test0122.c.expect new file mode 100644 index 0000000..a756818 --- /dev/null +++ b/test_sunifdef/test_cases/test0122.c.expect @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +/* Left(unk) && Right(true,elim) := Left */ +#if 0 +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0123.c b/test_sunifdef/test_cases/test0123.c new file mode 100644 index 0000000..57dbf8a --- /dev/null +++ b/test_sunifdef/test_cases/test0123.c @@ -0,0 +1,8 @@ +/**ARGS: --constant eval -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +/* Left(true,keep) && Right(true,elim) := Left */ +#if 0 && defined(FOO1) +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0123.c.expect b/test_sunifdef/test_cases/test0123.c.expect new file mode 100644 index 0000000..0032cdf --- /dev/null +++ b/test_sunifdef/test_cases/test0123.c.expect @@ -0,0 +1,8 @@ +/**ARGS: --constant eval -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +/* Left(true,keep) && Right(true,elim) := Left */ +#if 0 +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0124.c b/test_sunifdef/test_cases/test0124.c new file mode 100644 index 0000000..73b0476 --- /dev/null +++ b/test_sunifdef/test_cases/test0124.c @@ -0,0 +1,8 @@ +/**ARGS: --constant eval -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +/* Left(true,elim) && Right(true,keep) := Right */ +#if defined(FOO1) && 0 +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0124.c.expect b/test_sunifdef/test_cases/test0124.c.expect new file mode 100644 index 0000000..082136b --- /dev/null +++ b/test_sunifdef/test_cases/test0124.c.expect @@ -0,0 +1,8 @@ +/**ARGS: --constant eval -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +/* Left(true,elim) && Right(true,keep) := Right */ +#if 0 +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0125.c b/test_sunifdef/test_cases/test0125.c new file mode 100644 index 0000000..7c8afe9 --- /dev/null +++ b/test_sunifdef/test_cases/test0125.c @@ -0,0 +1,8 @@ +/**ARGS: --constant eval,del -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +/* Left(true,elim) && Right(true,elim) := Elim */ +#if 0 && defined(FOO1) +DELETE ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0125.c.expect b/test_sunifdef/test_cases/test0125.c.expect new file mode 100644 index 0000000..1c0438e --- /dev/null +++ b/test_sunifdef/test_cases/test0125.c.expect @@ -0,0 +1,4 @@ +/**ARGS: --constant eval,del -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +/* Left(true,elim) && Right(true,elim) := Elim */ +KEEP ME diff --git a/test_sunifdef/test_cases/test0126.c b/test_sunifdef/test_cases/test0126.c new file mode 100644 index 0000000..2d75204 --- /dev/null +++ b/test_sunifdef/test_cases/test0126.c @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +/* Left(unk) && Right(false,elim) := Elim */ +#if 0 && defined(FOO2) +DELETE ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0126.c.expect b/test_sunifdef/test_cases/test0126.c.expect new file mode 100644 index 0000000..9692a09 --- /dev/null +++ b/test_sunifdef/test_cases/test0126.c.expect @@ -0,0 +1,4 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +/* Left(unk) && Right(false,elim) := Elim */ +KEEP ME diff --git a/test_sunifdef/test_cases/test0127.c b/test_sunifdef/test_cases/test0127.c new file mode 100644 index 0000000..0640504 --- /dev/null +++ b/test_sunifdef/test_cases/test0127.c @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +/* Left(false,elim) && Right(unk) := Elim */ +#if defined(FOO2) && 0 +DELETE ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0127.c.expect b/test_sunifdef/test_cases/test0127.c.expect new file mode 100644 index 0000000..ba71f38 --- /dev/null +++ b/test_sunifdef/test_cases/test0127.c.expect @@ -0,0 +1,4 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +/* Left(false,elim) && Right(unk) := Elim */ +KEEP ME diff --git a/test_sunifdef/test_cases/test0128.c b/test_sunifdef/test_cases/test0128.c new file mode 100644 index 0000000..b12726d --- /dev/null +++ b/test_sunifdef/test_cases/test0128.c @@ -0,0 +1,8 @@ +/**ARGS: --constant eval -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +/* Left(false,keep) && Right(false,elim) := Left */ +#if 0 && defined(FOO2) +DELETE ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0128.c.expect b/test_sunifdef/test_cases/test0128.c.expect new file mode 100644 index 0000000..36c48d1 --- /dev/null +++ b/test_sunifdef/test_cases/test0128.c.expect @@ -0,0 +1,9 @@ +/**ARGS: --constant eval -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +/* Left(false,keep) && Right(false,elim) := Left */ +#if 0 +DELETE ME +#else +KEEP ME +#endif + diff --git a/test_sunifdef/test_cases/test0129.c b/test_sunifdef/test_cases/test0129.c new file mode 100644 index 0000000..399e669 --- /dev/null +++ b/test_sunifdef/test_cases/test0129.c @@ -0,0 +1,8 @@ +/**ARGS: --constant eval,del -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +/* Left(false,elim) && Right(false,elim) := Elim */ +#if 0 && defined(FOO2) +DELETE ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0129.c.expect b/test_sunifdef/test_cases/test0129.c.expect new file mode 100644 index 0000000..7a084c6 --- /dev/null +++ b/test_sunifdef/test_cases/test0129.c.expect @@ -0,0 +1,4 @@ +/**ARGS: --constant eval,del -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +/* Left(false,elim) && Right(false,elim) := Elim */ +KEEP ME diff --git a/test_sunifdef/test_cases/test0130.c b/test_sunifdef/test_cases/test0130.c new file mode 100644 index 0000000..5d19290 --- /dev/null +++ b/test_sunifdef/test_cases/test0130.c @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 0 */ +/* Left(unk) && Right(unk) := Keep */ +#if 0 && defined(UNKNOWN) +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0130.c.expect b/test_sunifdef/test_cases/test0130.c.expect new file mode 100644 index 0000000..5854a3a --- /dev/null +++ b/test_sunifdef/test_cases/test0130.c.expect @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 0 */ +/* Left(unk) && Right(unk) := Keep */ +#if 0 && defined(UNKNOWN) +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0131.c b/test_sunifdef/test_cases/test0131.c new file mode 100644 index 0000000..db0c588 --- /dev/null +++ b/test_sunifdef/test_cases/test0131.c @@ -0,0 +1,8 @@ +/**ARGS: --constant eval -DFOO1 -UFOO2 */ +/**SYSCODE: = 0 */ +/* Left(false,keep) && Right(unk) := Keep */ +#if 0 && defined(UNKNOWN) +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0131.c.expect b/test_sunifdef/test_cases/test0131.c.expect new file mode 100644 index 0000000..593e53b --- /dev/null +++ b/test_sunifdef/test_cases/test0131.c.expect @@ -0,0 +1,8 @@ +/**ARGS: --constant eval -DFOO1 -UFOO2 */ +/**SYSCODE: = 0 */ +/* Left(false,keep) && Right(unk) := Keep */ +#if 0 && defined(UNKNOWN) +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0132.c b/test_sunifdef/test_cases/test0132.c new file mode 100644 index 0000000..b4e8f1a --- /dev/null +++ b/test_sunifdef/test_cases/test0132.c @@ -0,0 +1,8 @@ +/**ARGS: --constant eval,del -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +/* Left(false,elim) && Right(unk) := Elim */ +#if 0 && defined(UNKNOWN) +DELETE ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0132.c.expect b/test_sunifdef/test_cases/test0132.c.expect new file mode 100644 index 0000000..ad33557 --- /dev/null +++ b/test_sunifdef/test_cases/test0132.c.expect @@ -0,0 +1,4 @@ +/**ARGS: --constant eval,del -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +/* Left(false,elim) && Right(unk) := Elim */ +KEEP ME diff --git a/test_sunifdef/test_cases/test0133.c b/test_sunifdef/test_cases/test0133.c new file mode 100644 index 0000000..86a858b --- /dev/null +++ b/test_sunifdef/test_cases/test0133.c @@ -0,0 +1,7 @@ +/**ARGS: --constant eval,del -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +#if defined(UNKNOWN) && 0 +DELETE ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0133.c.expect b/test_sunifdef/test_cases/test0133.c.expect new file mode 100644 index 0000000..6bd3fc6 --- /dev/null +++ b/test_sunifdef/test_cases/test0133.c.expect @@ -0,0 +1,3 @@ +/**ARGS: --constant eval,del -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +KEEP ME diff --git a/test_sunifdef/test_cases/test0134.c b/test_sunifdef/test_cases/test0134.c new file mode 100644 index 0000000..ff0056d --- /dev/null +++ b/test_sunifdef/test_cases/test0134.c @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +/* Left(unk) || Right(true,elim) := Left */ +#if 0 || defined(FOO1) +KEEP ME +#else +DELETE ME +#endif diff --git a/test_sunifdef/test_cases/test0134.c.expect b/test_sunifdef/test_cases/test0134.c.expect new file mode 100644 index 0000000..22f9755 --- /dev/null +++ b/test_sunifdef/test_cases/test0134.c.expect @@ -0,0 +1,4 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +/* Left(unk) || Right(true,elim) := Left */ +KEEP ME diff --git a/test_sunifdef/test_cases/test0135.c b/test_sunifdef/test_cases/test0135.c new file mode 100644 index 0000000..da7c1cd --- /dev/null +++ b/test_sunifdef/test_cases/test0135.c @@ -0,0 +1,8 @@ +/**ARGS: --constant eval -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +/* Left(false,keep) || Right(true,elim) := Elim */ +#if 0 || defined(FOO1) +KEEP ME +#else +DELETE ME +#endif diff --git a/test_sunifdef/test_cases/test0135.c.expect b/test_sunifdef/test_cases/test0135.c.expect new file mode 100644 index 0000000..53d3475 --- /dev/null +++ b/test_sunifdef/test_cases/test0135.c.expect @@ -0,0 +1,4 @@ +/**ARGS: --constant eval -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +/* Left(false,keep) || Right(true,elim) := Elim */ +KEEP ME diff --git a/test_sunifdef/test_cases/test0136.c b/test_sunifdef/test_cases/test0136.c new file mode 100644 index 0000000..4aa00f5 --- /dev/null +++ b/test_sunifdef/test_cases/test0136.c @@ -0,0 +1,8 @@ +/**ARGS: --constant eval,del -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +/* Left(false,elim) || right(true.elim) := Elim */ +#if 0 || defined(FOO1) +KEEP ME +#else +DELETE ME +#endif diff --git a/test_sunifdef/test_cases/test0136.c.expect b/test_sunifdef/test_cases/test0136.c.expect new file mode 100644 index 0000000..f38673f --- /dev/null +++ b/test_sunifdef/test_cases/test0136.c.expect @@ -0,0 +1,4 @@ +/**ARGS: --constant eval,del -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +/* Left(false,elim) || right(true.elim) := Elim */ +KEEP ME diff --git a/test_sunifdef/test_cases/test0137.c b/test_sunifdef/test_cases/test0137.c new file mode 100644 index 0000000..b3dc650 --- /dev/null +++ b/test_sunifdef/test_cases/test0137.c @@ -0,0 +1,8 @@ +/**ARGS: --constant eval,del -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +/* Left(true,elim) || Right(false,elim) := Elim */ +#if defined(FOO1) || 0 +KEEP ME +#else +DELETE ME +#endif diff --git a/test_sunifdef/test_cases/test0137.c.expect b/test_sunifdef/test_cases/test0137.c.expect new file mode 100644 index 0000000..bbf44fe --- /dev/null +++ b/test_sunifdef/test_cases/test0137.c.expect @@ -0,0 +1,4 @@ +/**ARGS: --constant eval,del -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +/* Left(true,elim) || Right(false,elim) := Elim */ +KEEP ME diff --git a/test_sunifdef/test_cases/test0138.c b/test_sunifdef/test_cases/test0138.c new file mode 100644 index 0000000..53885dc --- /dev/null +++ b/test_sunifdef/test_cases/test0138.c @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +/* Left(unk) || Right(false,elim) := Left */ +#if 0 || defined(FOO2) +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0138.c.expect b/test_sunifdef/test_cases/test0138.c.expect new file mode 100644 index 0000000..c6d7d6a --- /dev/null +++ b/test_sunifdef/test_cases/test0138.c.expect @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +/* Left(unk) || Right(false,elim) := Left */ +#if 0 +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0139.c b/test_sunifdef/test_cases/test0139.c new file mode 100644 index 0000000..6e7e9ff --- /dev/null +++ b/test_sunifdef/test_cases/test0139.c @@ -0,0 +1,8 @@ +/**ARGS: --constant eval -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +/* Left(false,keep) || Right(false,elim) := Left */ +#if 0 || defined(FOO2) +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0139.c.expect b/test_sunifdef/test_cases/test0139.c.expect new file mode 100644 index 0000000..42964d6 --- /dev/null +++ b/test_sunifdef/test_cases/test0139.c.expect @@ -0,0 +1,8 @@ +/**ARGS: --constant eval -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +/* Left(false,keep) || Right(false,elim) := Left */ +#if 0 +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0140.c b/test_sunifdef/test_cases/test0140.c new file mode 100644 index 0000000..5943e0d --- /dev/null +++ b/test_sunifdef/test_cases/test0140.c @@ -0,0 +1,8 @@ +/**ARGS: --constant eval -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +/* Left(false,elim) || Right(false,keep) := Right */ +#if defined(FOO2) || 0 +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0140.c.expect b/test_sunifdef/test_cases/test0140.c.expect new file mode 100644 index 0000000..a32dbc3 --- /dev/null +++ b/test_sunifdef/test_cases/test0140.c.expect @@ -0,0 +1,8 @@ +/**ARGS: --constant eval -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +/* Left(false,elim) || Right(false,keep) := Right */ +#if 0 +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0141.c b/test_sunifdef/test_cases/test0141.c new file mode 100644 index 0000000..acdbf97 --- /dev/null +++ b/test_sunifdef/test_cases/test0141.c @@ -0,0 +1,8 @@ +/**ARGS: --constant eval,del -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +/* Left(false,elim) || Right(false,elim) := Elim */ +#if 0 || defined(FOO2) +DELETE ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0141.c.expect b/test_sunifdef/test_cases/test0141.c.expect new file mode 100644 index 0000000..fefbee5 --- /dev/null +++ b/test_sunifdef/test_cases/test0141.c.expect @@ -0,0 +1,4 @@ +/**ARGS: --constant eval,del -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +/* Left(false,elim) || Right(false,elim) := Elim */ +KEEP ME diff --git a/test_sunifdef/test_cases/test0142.c b/test_sunifdef/test_cases/test0142.c new file mode 100644 index 0000000..6b13435 --- /dev/null +++ b/test_sunifdef/test_cases/test0142.c @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 0 */ +/* Left(unk) || Right(unk) := Keep */ +#if 0 || defined(UNKNOWN) +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0142.c.expect b/test_sunifdef/test_cases/test0142.c.expect new file mode 100644 index 0000000..c7ec532 --- /dev/null +++ b/test_sunifdef/test_cases/test0142.c.expect @@ -0,0 +1,8 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 0 */ +/* Left(unk) || Right(unk) := Keep */ +#if 0 || defined(UNKNOWN) +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0143.c b/test_sunifdef/test_cases/test0143.c new file mode 100644 index 0000000..e84eb5a --- /dev/null +++ b/test_sunifdef/test_cases/test0143.c @@ -0,0 +1,8 @@ +/**ARGS: --constant eval -DFOO1 -UFOO2 */ +/**SYSCODE: = 0 */ +/* Left(true,keep) || Right(unk) := Keep */ +#if 0 || defined(UNKNOWN) +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0143.c.expect b/test_sunifdef/test_cases/test0143.c.expect new file mode 100644 index 0000000..b78f4b5 --- /dev/null +++ b/test_sunifdef/test_cases/test0143.c.expect @@ -0,0 +1,8 @@ +/**ARGS: --constant eval -DFOO1 -UFOO2 */ +/**SYSCODE: = 0 */ +/* Left(true,keep) || Right(unk) := Keep */ +#if 0 || defined(UNKNOWN) +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0144.c b/test_sunifdef/test_cases/test0144.c new file mode 100644 index 0000000..9e33ed0 --- /dev/null +++ b/test_sunifdef/test_cases/test0144.c @@ -0,0 +1,8 @@ +/**ARGS: --constant eval -DFOO1 -UFOO2 */ +/**SYSCODE: = 0 */ +/* Left(unk) || Right(false,keep) := Keep */ +#if defined(UNKNOWN) || 0 +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0144.c.expect b/test_sunifdef/test_cases/test0144.c.expect new file mode 100644 index 0000000..e377bd8 --- /dev/null +++ b/test_sunifdef/test_cases/test0144.c.expect @@ -0,0 +1,8 @@ +/**ARGS: --constant eval -DFOO1 -UFOO2 */ +/**SYSCODE: = 0 */ +/* Left(unk) || Right(false,keep) := Keep */ +#if defined(UNKNOWN) || 0 +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0145.c b/test_sunifdef/test_cases/test0145.c new file mode 100644 index 0000000..fba7435 --- /dev/null +++ b/test_sunifdef/test_cases/test0145.c @@ -0,0 +1,8 @@ +/**ARGS: --constant eval,del -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +/* Left(false,elim) || Right(unk) := Right */ +#if 0 || defined(UNKNOWN) +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0145.c.expect b/test_sunifdef/test_cases/test0145.c.expect new file mode 100644 index 0000000..d3b81c8 --- /dev/null +++ b/test_sunifdef/test_cases/test0145.c.expect @@ -0,0 +1,8 @@ +/**ARGS: --constant eval,del -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +/* Left(false,elim) || Right(unk) := Right */ +#if defined(UNKNOWN) +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0146.c b/test_sunifdef/test_cases/test0146.c new file mode 100644 index 0000000..e520af5 --- /dev/null +++ b/test_sunifdef/test_cases/test0146.c @@ -0,0 +1,7 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 0 */ +#if !0 +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0146.c.expect b/test_sunifdef/test_cases/test0146.c.expect new file mode 100644 index 0000000..87413a8 --- /dev/null +++ b/test_sunifdef/test_cases/test0146.c.expect @@ -0,0 +1,7 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 0 */ +#if !0 +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0147.c b/test_sunifdef/test_cases/test0147.c new file mode 100644 index 0000000..2e6f35c --- /dev/null +++ b/test_sunifdef/test_cases/test0147.c @@ -0,0 +1,7 @@ +/**ARGS: --constant eval -DFOO1 -UFOO2 */ +/**SYSCODE: = 0 */ +#if !0 +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0147.c.expect b/test_sunifdef/test_cases/test0147.c.expect new file mode 100644 index 0000000..d52d8ab --- /dev/null +++ b/test_sunifdef/test_cases/test0147.c.expect @@ -0,0 +1,7 @@ +/**ARGS: --constant eval -DFOO1 -UFOO2 */ +/**SYSCODE: = 0 */ +#if !0 +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0148.c b/test_sunifdef/test_cases/test0148.c new file mode 100644 index 0000000..0a2e089 --- /dev/null +++ b/test_sunifdef/test_cases/test0148.c @@ -0,0 +1,7 @@ +/**ARGS: --constant eval,del -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +#if !0 +KEEP ME +#else +DELETE ME +#endif diff --git a/test_sunifdef/test_cases/test0148.c.expect b/test_sunifdef/test_cases/test0148.c.expect new file mode 100644 index 0000000..6bd3fc6 --- /dev/null +++ b/test_sunifdef/test_cases/test0148.c.expect @@ -0,0 +1,3 @@ +/**ARGS: --constant eval,del -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +KEEP ME diff --git a/test_sunifdef/test_cases/test0149.c b/test_sunifdef/test_cases/test0149.c new file mode 100644 index 0000000..44ec3e4 --- /dev/null +++ b/test_sunifdef/test_cases/test0149.c @@ -0,0 +1,7 @@ +/**ARGS: --constant eval,del -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +#if !(1 && FOO1) +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0149.c.expect b/test_sunifdef/test_cases/test0149.c.expect new file mode 100644 index 0000000..2fc7dcd --- /dev/null +++ b/test_sunifdef/test_cases/test0149.c.expect @@ -0,0 +1,7 @@ +/**ARGS: --constant eval,del -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +#if ! FOO1 +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0150.c b/test_sunifdef/test_cases/test0150.c new file mode 100644 index 0000000..faa2aae --- /dev/null +++ b/test_sunifdef/test_cases/test0150.c @@ -0,0 +1,7 @@ +/**ARGS: --constant eval,del -DFOO1=1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +#if !(1 && FOO1) +DELETE ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0150.c.expect b/test_sunifdef/test_cases/test0150.c.expect new file mode 100644 index 0000000..7351d5c --- /dev/null +++ b/test_sunifdef/test_cases/test0150.c.expect @@ -0,0 +1,4 @@ +/**ARGS: --constant eval,del -DFOO1=1 -UFOO2 */ +/**SYSCODE: = 1 | 16 */ +KEEP ME + diff --git a/test_sunifdef/test_cases/test0151.c b/test_sunifdef/test_cases/test0151.c new file mode 100644 index 0000000..2564dba --- /dev/null +++ b/test_sunifdef/test_cases/test0151.c @@ -0,0 +1,7 @@ +/**ARGS: -c --constant eval,del -DFOO1=1 -UFOO2 */ +/**SYSCODE: = 1 | 16 | 32 */ +#if !(1 && FOO1) +DELETE ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0151.c.expect b/test_sunifdef/test_cases/test0151.c.expect new file mode 100644 index 0000000..ddff1d0 --- /dev/null +++ b/test_sunifdef/test_cases/test0151.c.expect @@ -0,0 +1,4 @@ +#if ! FOO1 +DELETE ME +#else +#endif diff --git a/test_sunifdef/test_cases/test0152.c b/test_sunifdef/test_cases/test0152.c new file mode 100644 index 0000000..81d7337 --- /dev/null +++ b/test_sunifdef/test_cases/test0152.c @@ -0,0 +1,15 @@ +/**ARGS: --complement --discard blank -DFOO1 -UFOO2 -DBAR1 -UBAR2 */ +/**SYSCODE: = 1 | 32 */ +#ifdef FOO1 + #ifndef FOO2 + KEEP ME + #else + DELETE ME + #endif +#else + #ifdef BAR1 + DELETE ME + #else + DELETE ME + #endif +#endif diff --git a/test_sunifdef/test_cases/test0152.c.expect b/test_sunifdef/test_cases/test0152.c.expect new file mode 100644 index 0000000..7c9bcb1 --- /dev/null +++ b/test_sunifdef/test_cases/test0152.c.expect @@ -0,0 +1,15 @@ + + +#ifdef FOO1 + #ifndef FOO2 + + #else + DELETE ME + #endif +#else + #ifdef BAR1 + DELETE ME + #else + DELETE ME + #endif +#endif diff --git a/test_sunifdef/test_cases/test0153.c b/test_sunifdef/test_cases/test0153.c new file mode 100644 index 0000000..669262e --- /dev/null +++ b/test_sunifdef/test_cases/test0153.c @@ -0,0 +1,7 @@ +/**ARGS: -P -DFOO */ +/**SYSCODE: = 1 | 16 */ +/* Not to be parsed as comment +#ifdef FOO +KEEP ME +#endif +*/ diff --git a/test_sunifdef/test_cases/test0153.c.expect b/test_sunifdef/test_cases/test0153.c.expect new file mode 100644 index 0000000..ab6eb4b --- /dev/null +++ b/test_sunifdef/test_cases/test0153.c.expect @@ -0,0 +1,5 @@ +/**ARGS: -P -DFOO */ +/**SYSCODE: = 1 | 16 */ +/* Not to be parsed as comment +KEEP ME +*/ diff --git a/test_sunifdef/test_cases/test0154.c b/test_sunifdef/test_cases/test0154.c new file mode 100644 index 0000000..a58cf07 --- /dev/null +++ b/test_sunifdef/test_cases/test0154.c @@ -0,0 +1,13 @@ +/**ARGS: -DFOO1 */ +/**SYSCODE: = 1 | 16 */ +#ifdef FOO1 +/* To be parsed as comment +#ifdef FOO1 +" To be parsed as quote +#ifndef FOO1 +KEEP ME +#endif +End quote " +#endif +End comment */ +#endif diff --git a/test_sunifdef/test_cases/test0154.c.expect b/test_sunifdef/test_cases/test0154.c.expect new file mode 100644 index 0000000..0cc6c01 --- /dev/null +++ b/test_sunifdef/test_cases/test0154.c.expect @@ -0,0 +1,11 @@ +/**ARGS: -DFOO1 */ +/**SYSCODE: = 1 | 16 */ +/* To be parsed as comment +#ifdef FOO1 +" To be parsed as quote +#ifndef FOO1 +KEEP ME +#endif +End quote " +#endif +End comment */ diff --git a/test_sunifdef/test_cases/test0155.c b/test_sunifdef/test_cases/test0155.c new file mode 100644 index 0000000..7373af7 --- /dev/null +++ b/test_sunifdef/test_cases/test0155.c @@ -0,0 +1,7 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +#if (!defined(FOO1) || !defined(UNKNOWN)) && (defined(UNKNOWN) || defined(FOO2)) +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0155.c.expect b/test_sunifdef/test_cases/test0155.c.expect new file mode 100644 index 0000000..72b9f83 --- /dev/null +++ b/test_sunifdef/test_cases/test0155.c.expect @@ -0,0 +1,7 @@ +/**ARGS: -DFOO1 -UFOO2 */ +/**SYSCODE: = 1 | 32 */ +#if !defined(UNKNOWN) && defined(UNKNOWN) +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0156.c b/test_sunifdef/test_cases/test0156.c new file mode 100644 index 0000000..872846f --- /dev/null +++ b/test_sunifdef/test_cases/test0156.c @@ -0,0 +1,17 @@ +/**ARGS: -DFOO */ +/**SYSCODE: = 1 | 16 */ +#if 1 + 2 +KEEP ME +#endif +#if 1 - 1 +KEEP ME +#endif +#if 1 * 1 +KEEP ME +#endif +#if 1 / 1 +KEEP ME +#endif +#if 3 % 2 +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0156.c.expect b/test_sunifdef/test_cases/test0156.c.expect new file mode 100644 index 0000000..cbbc0cb --- /dev/null +++ b/test_sunifdef/test_cases/test0156.c.expect @@ -0,0 +1,6 @@ +/**ARGS: -DFOO */ +/**SYSCODE: = 1 | 16 */ +KEEP ME +KEEP ME +KEEP ME +KEEP ME diff --git a/test_sunifdef/test_cases/test0157.c b/test_sunifdef/test_cases/test0157.c new file mode 100644 index 0000000..9f3d17c --- /dev/null +++ b/test_sunifdef/test_cases/test0157.c @@ -0,0 +1,17 @@ +/**ARGS: --constant eval -DFOO */ +/**SYSCODE: = 1 | 16 */ +#if 1 + 2 +KEEP ME +#endif +#if 1 - 1 +KEEP ME +#endif +#if 1 * 1 +KEEP ME +#endif +#if 1 / 1 +KEEP ME +#endif +#if 3 % 2 +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0157.c.expect b/test_sunifdef/test_cases/test0157.c.expect new file mode 100644 index 0000000..57f0f9b --- /dev/null +++ b/test_sunifdef/test_cases/test0157.c.expect @@ -0,0 +1,7 @@ +/**ARGS: --constant eval -DFOO */ +/**SYSCODE: = 1 | 16 */ +KEEP ME +KEEP ME +KEEP ME +KEEP ME + diff --git a/test_sunifdef/test_cases/test0158.c b/test_sunifdef/test_cases/test0158.c new file mode 100644 index 0000000..572fa8c --- /dev/null +++ b/test_sunifdef/test_cases/test0158.c @@ -0,0 +1,17 @@ +/**ARGS: -DFOO=1 -DBAR=2 */ +/**SYSCODE: = 1 | 16 */ +#if 1 + BAR +KEEP ME +#endif +#if 1 - FOO +KEEP ME +#endif +#if 1 * FOO +KEEP ME +#endif +#if 1 / FOO +KEEP ME +#endif +#if 3 % BAR +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0158.c.expect b/test_sunifdef/test_cases/test0158.c.expect new file mode 100644 index 0000000..83c1488 --- /dev/null +++ b/test_sunifdef/test_cases/test0158.c.expect @@ -0,0 +1,6 @@ +/**ARGS: -DFOO=1 -DBAR=2 */ +/**SYSCODE: = 1 | 16 */ +KEEP ME +KEEP ME +KEEP ME +KEEP ME diff --git a/test_sunifdef/test_cases/test0159.c b/test_sunifdef/test_cases/test0159.c new file mode 100644 index 0000000..572fa8c --- /dev/null +++ b/test_sunifdef/test_cases/test0159.c @@ -0,0 +1,17 @@ +/**ARGS: -DFOO=1 -DBAR=2 */ +/**SYSCODE: = 1 | 16 */ +#if 1 + BAR +KEEP ME +#endif +#if 1 - FOO +KEEP ME +#endif +#if 1 * FOO +KEEP ME +#endif +#if 1 / FOO +KEEP ME +#endif +#if 3 % BAR +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0159.c.expect b/test_sunifdef/test_cases/test0159.c.expect new file mode 100644 index 0000000..e3085e3 --- /dev/null +++ b/test_sunifdef/test_cases/test0159.c.expect @@ -0,0 +1,7 @@ +/**ARGS: -DFOO=1 -DBAR=2 */ +/**SYSCODE: = 1 | 16 */ +KEEP ME +KEEP ME +KEEP ME +KEEP ME + diff --git a/test_sunifdef/test_cases/test0160.c b/test_sunifdef/test_cases/test0160.c new file mode 100644 index 0000000..d3c664b --- /dev/null +++ b/test_sunifdef/test_cases/test0160.c @@ -0,0 +1,5 @@ +/**ARGS: -DFOO=1 */ +/**SYSCODE: = 1 | 32 */ +#if (1 + BAR) && defined(FOO) +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0160.c.expect b/test_sunifdef/test_cases/test0160.c.expect new file mode 100644 index 0000000..fbf9608 --- /dev/null +++ b/test_sunifdef/test_cases/test0160.c.expect @@ -0,0 +1,5 @@ +/**ARGS: -DFOO=1 */ +/**SYSCODE: = 1 | 32 */ +#if 1 + BAR +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0161.c b/test_sunifdef/test_cases/test0161.c new file mode 100644 index 0000000..d8417d5 --- /dev/null +++ b/test_sunifdef/test_cases/test0161.c @@ -0,0 +1,5 @@ +/**ARGS: --constant eval -DFOO=1 */ +/**SYSCODE: = 1 | 32 */ +#if (1 + BAR) && defined(FOO) +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0161.c.expect b/test_sunifdef/test_cases/test0161.c.expect new file mode 100644 index 0000000..89d1782 --- /dev/null +++ b/test_sunifdef/test_cases/test0161.c.expect @@ -0,0 +1,5 @@ +/**ARGS: --constant eval -DFOO=1 */ +/**SYSCODE: = 1 | 32 */ +#if 1 + BAR +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0162.c b/test_sunifdef/test_cases/test0162.c new file mode 100644 index 0000000..0bc5a29 --- /dev/null +++ b/test_sunifdef/test_cases/test0162.c @@ -0,0 +1,5 @@ +/**ARGS: --constant eval -DFOO=1 -DBAR */ +/**SYSCODE: = 1 | 32 */ +#if (1 + BAR) && defined(FOO) +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0162.c.expect b/test_sunifdef/test_cases/test0162.c.expect new file mode 100644 index 0000000..9288e7a --- /dev/null +++ b/test_sunifdef/test_cases/test0162.c.expect @@ -0,0 +1,5 @@ +/**ARGS: --constant eval -DFOO=1 -DBAR */ +/**SYSCODE: = 1 | 32 */ +#if 1 + BAR +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0163.c b/test_sunifdef/test_cases/test0163.c new file mode 100644 index 0000000..c593a15 --- /dev/null +++ b/test_sunifdef/test_cases/test0163.c @@ -0,0 +1,5 @@ +/**ARGS: --constant eval -DFOO=1 -DBAR=1 */ +/**SYSCODE: = 1 | 16 */ +#if (1 + BAR) && defined(FOO) +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0163.c.expect b/test_sunifdef/test_cases/test0163.c.expect new file mode 100644 index 0000000..636a233 --- /dev/null +++ b/test_sunifdef/test_cases/test0163.c.expect @@ -0,0 +1,4 @@ +/**ARGS: --constant eval -DFOO=1 -DBAR=1 */ +/**SYSCODE: = 1 | 16 */ +KEEP ME + diff --git a/test_sunifdef/test_cases/test0164.c b/test_sunifdef/test_cases/test0164.c new file mode 100644 index 0000000..d2cefaf --- /dev/null +++ b/test_sunifdef/test_cases/test0164.c @@ -0,0 +1,5 @@ +/**ARGS: --constant eval -DFOO=1 -DBAR=1+1 */ +/**SYSCODE: = 1 | 16 */ +#if (1 + BAR) && defined(FOO) +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0164.c.expect b/test_sunifdef/test_cases/test0164.c.expect new file mode 100644 index 0000000..d0af85b --- /dev/null +++ b/test_sunifdef/test_cases/test0164.c.expect @@ -0,0 +1,4 @@ +/**ARGS: --constant eval -DFOO=1 -DBAR=1+1 */ +/**SYSCODE: = 1 | 16 */ +KEEP ME + diff --git a/test_sunifdef/test_cases/test0165.c b/test_sunifdef/test_cases/test0165.c new file mode 100644 index 0000000..f17e0d4 --- /dev/null +++ b/test_sunifdef/test_cases/test0165.c @@ -0,0 +1,7 @@ +/**ARGS: -DFOO=BAR -DBAR=FOO */ +/**SYSCODE: = 0 */ +#if FOO || BAR +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0165.c.expect b/test_sunifdef/test_cases/test0165.c.expect new file mode 100644 index 0000000..60b54d8 --- /dev/null +++ b/test_sunifdef/test_cases/test0165.c.expect @@ -0,0 +1,7 @@ +/**ARGS: -DFOO=BAR -DBAR=FOO */ +/**SYSCODE: = 0 */ +#if FOO || BAR +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0166.c b/test_sunifdef/test_cases/test0166.c new file mode 100644 index 0000000..abbc62a --- /dev/null +++ b/test_sunifdef/test_cases/test0166.c @@ -0,0 +1,7 @@ +/**ARGS: --constant eval -DFOO=1 -DBAR=2 */ +/**SYSCODE: = 1 | 16 */ +#if 1 == (FOO | BAR == 3) +KEEP ME +#else +DELETE ME +#endif diff --git a/test_sunifdef/test_cases/test0166.c.expect b/test_sunifdef/test_cases/test0166.c.expect new file mode 100644 index 0000000..ccae819 --- /dev/null +++ b/test_sunifdef/test_cases/test0166.c.expect @@ -0,0 +1,3 @@ +/**ARGS: --constant eval -DFOO=1 -DBAR=2 */ +/**SYSCODE: = 1 | 16 */ +KEEP ME diff --git a/test_sunifdef/test_cases/test0167.c b/test_sunifdef/test_cases/test0167.c new file mode 100644 index 0000000..b0b3146 --- /dev/null +++ b/test_sunifdef/test_cases/test0167.c @@ -0,0 +1,26 @@ +/**ARGS: --constant eval -DFOO=3 -DBAR=0 */ +/**SYSCODE: = 1 | 16 */ +#if FOO & BAR +DELETE ME +#endif +#if FOO & 2 +KEEP ME +#endif +#if FOO ^ BAR +KEEP ME +#endif +#if FOO ^ FOO +DELETE ME +#endif +#if FOO | BAR +KEEP ME +#endif +#if BAR | BAR +DELETE ME +#endif +#if ~BAR +KEEP ME +#endif +#if FOO & ~FOO +DELETE ME +#endif diff --git a/test_sunifdef/test_cases/test0167.c.expect b/test_sunifdef/test_cases/test0167.c.expect new file mode 100644 index 0000000..14464bb --- /dev/null +++ b/test_sunifdef/test_cases/test0167.c.expect @@ -0,0 +1,6 @@ +/**ARGS: --constant eval -DFOO=3 -DBAR=0 */ +/**SYSCODE: = 1 | 16 */ +KEEP ME +KEEP ME +KEEP ME +KEEP ME diff --git a/test_sunifdef/test_cases/test0168.c b/test_sunifdef/test_cases/test0168.c new file mode 100644 index 0000000..1bcba76 --- /dev/null +++ b/test_sunifdef/test_cases/test0168.c @@ -0,0 +1,14 @@ +/**ARGS: --constant eval "-DFOO=4>>2" */ +/**SYSCODE: = 1 | 16 */ +#if FOO == 1 +KEEP ME +#else +DELETE ME +#endif +#if 1 << 2 == 4 +KEEP ME +#else +DELETE ME +#endif + + diff --git a/test_sunifdef/test_cases/test0168.c.expect b/test_sunifdef/test_cases/test0168.c.expect new file mode 100644 index 0000000..c287bc4 --- /dev/null +++ b/test_sunifdef/test_cases/test0168.c.expect @@ -0,0 +1,5 @@ +/**ARGS: --constant eval "-DFOO=4>>2" */ +/**SYSCODE: = 1 | 16 */ +KEEP ME +KEEP ME + diff --git a/test_sunifdef/test_cases/test0169.c b/test_sunifdef/test_cases/test0169.c new file mode 100644 index 0000000..22c3b86 --- /dev/null +++ b/test_sunifdef/test_cases/test0169.c @@ -0,0 +1,15 @@ +/**ARGS: --discard comment -DFOO1 -UFOO2 -DBAR1 -UBAR2 */ +/**SYSCODE: = 1 | 32 */ +#ifdef FOO1 + #ifndef FOO2 + KEEP ME + #else + DELETE ME + #endif +#else + #ifdef BAR1 + DELETE ME + #else + DELETE ME + #endif +#endif diff --git a/test_sunifdef/test_cases/test0169.c.expect b/test_sunifdef/test_cases/test0169.c.expect new file mode 100644 index 0000000..cadcd89 --- /dev/null +++ b/test_sunifdef/test_cases/test0169.c.expect @@ -0,0 +1,15 @@ +/**ARGS: --discard comment -DFOO1 -UFOO2 -DBAR1 -UBAR2 */ +/**SYSCODE: = 1 | 32 */ +//sunifdef < #ifdef FOO1 +//sunifdef < #ifndef FOO2 + KEEP ME +//sunifdef < #else +//sunifdef < DELETE ME +//sunifdef < #endif +//sunifdef < #else +//sunifdef < #ifdef BAR1 +//sunifdef < DELETE ME +//sunifdef < #else +//sunifdef < DELETE ME +//sunifdef < #endif +//sunifdef < #endif diff --git a/test_sunifdef/test_cases/test0170.c b/test_sunifdef/test_cases/test0170.c new file mode 100644 index 0000000..d32efc4 --- /dev/null +++ b/test_sunifdef/test_cases/test0170.c @@ -0,0 +1,12 @@ +/**ARGS: -sa */ +/**SYSCODE: = 0 */ +#ifdef FOO1 +KEEP ME +#endif +#if defined(FOO2) && defined(FOO2) +KEEP ME +#elif defined FOO3 || defined FOO4 +KEEP ME +#elif FOO5 +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0170.c.expect b/test_sunifdef/test_cases/test0170.c.expect new file mode 100644 index 0000000..b46c6c3 --- /dev/null +++ b/test_sunifdef/test_cases/test0170.c.expect @@ -0,0 +1,6 @@ +FOO1 +FOO2 +FOO2 +FOO3 +FOO4 +FOO5 diff --git a/test_sunifdef/test_cases/test0171.c b/test_sunifdef/test_cases/test0171.c new file mode 100644 index 0000000..b84caf4 --- /dev/null +++ b/test_sunifdef/test_cases/test0171.c @@ -0,0 +1,12 @@ +/**ARGS: -sal */ +/**SYSCODE: = 0 */ +#ifdef FOO1 +KEEP ME +#endif +#if defined(FOO2) && defined(FOO2) +KEEP ME +#elif defined FOO3 || defined FOO4 +KEEP ME +#elif FOO5 +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0171.c.expect b/test_sunifdef/test_cases/test0171.c.expect new file mode 100644 index 0000000..5b26d43 --- /dev/null +++ b/test_sunifdef/test_cases/test0171.c.expect @@ -0,0 +1,6 @@ +FOO1: ./test_cases/test0171.c(3) +FOO2: ./test_cases/test0171.c(6) +FOO2: ./test_cases/test0171.c(6) +FOO3: ./test_cases/test0171.c(8) +FOO4: ./test_cases/test0171.c(8) +FOO5: ./test_cases/test0171.c(10) diff --git a/test_sunifdef/test_cases/test0172.c b/test_sunifdef/test_cases/test0172.c new file mode 100644 index 0000000..e51a478 --- /dev/null +++ b/test_sunifdef/test_cases/test0172.c @@ -0,0 +1,12 @@ +/**ARGS: -sfl */ +/**SYSCODE: = 0 */ +#ifdef FOO1 +KEEP ME +#endif +#if defined(FOO2) && defined(FOO2) +KEEP ME +#elif defined FOO3 || defined FOO4 +KEEP ME +#elif FOO5 +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0172.c.expect b/test_sunifdef/test_cases/test0172.c.expect new file mode 100644 index 0000000..f8301a6 --- /dev/null +++ b/test_sunifdef/test_cases/test0172.c.expect @@ -0,0 +1,5 @@ +FOO1: ./test_cases/test0172.c(3) +FOO2: ./test_cases/test0172.c(6) +FOO3: ./test_cases/test0172.c(8) +FOO4: ./test_cases/test0172.c(8) +FOO5: ./test_cases/test0172.c(10) diff --git a/test_sunifdef/test_cases/test0173.c b/test_sunifdef/test_cases/test0173.c new file mode 100644 index 0000000..60c0fea --- /dev/null +++ b/test_sunifdef/test_cases/test0173.c @@ -0,0 +1,3 @@ +/**ARGS: -sfl */ +/**ALTFILES: ./test_cases/altfiles/test0173-1.c ./test_cases/altfiles/test0173-2.c */ +/**SYSCODE: = 0 */ diff --git a/test_sunifdef/test_cases/test0173.c.expect b/test_sunifdef/test_cases/test0173.c.expect new file mode 100644 index 0000000..1ee621f --- /dev/null +++ b/test_sunifdef/test_cases/test0173.c.expect @@ -0,0 +1,6 @@ +FOO1: ./test_cases/altfiles/test0173-1.c(1) +FOO2: ./test_cases/altfiles/test0173-1.c(4) +FOO3: ./test_cases/altfiles/test0173-1.c(6) +FOO4: ./test_cases/altfiles/test0173-1.c(6) +FOO5: ./test_cases/altfiles/test0173-1.c(8) +FOO6: ./test_cases/altfiles/test0173-2.c(8) diff --git a/test_sunifdef/test_cases/test0174.c b/test_sunifdef/test_cases/test0174.c new file mode 100644 index 0000000..3e40681 --- /dev/null +++ b/test_sunifdef/test_cases/test0174.c @@ -0,0 +1,12 @@ +/**ARGS: --line -DFOO */ +/**SYSCODE: = 1 | 16 | 32 */ +#ifdef FOO +KEEP ME +#else +DELETE ME +DELETE ME +DELETE ME +#endif +#ifdef FOO +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0174.c.expect b/test_sunifdef/test_cases/test0174.c.expect new file mode 100644 index 0000000..e38b63c --- /dev/null +++ b/test_sunifdef/test_cases/test0174.c.expect @@ -0,0 +1,6 @@ +/**ARGS: --line -DFOO */ +/**SYSCODE: = 1 | 16 | 32 */ +#line 4 +KEEP ME +#line 11 +KEEP ME diff --git a/test_sunifdef/test_cases/test0175.c b/test_sunifdef/test_cases/test0175.c new file mode 100644 index 0000000..dd03048 --- /dev/null +++ b/test_sunifdef/test_cases/test0175.c @@ -0,0 +1,15 @@ +/**ARGS: --pod -DFOO -DBAR */ +/**SYSCODE: = 1 | 16 */ +#ifdef FOO +/* Not to be parsed as comment +#if defined(BAR) +KEEP ME +#else +DELETE ME +#endif +end */ +" Not to be parsed as quotation +#else +DELETE ME +#endif +end " diff --git a/test_sunifdef/test_cases/test0175.c.expect b/test_sunifdef/test_cases/test0175.c.expect new file mode 100644 index 0000000..d228369 --- /dev/null +++ b/test_sunifdef/test_cases/test0175.c.expect @@ -0,0 +1,7 @@ +/**ARGS: --pod -DFOO -DBAR */ +/**SYSCODE: = 1 | 16 */ +/* Not to be parsed as comment +KEEP ME +end */ +" Not to be parsed as quotation +end " diff --git a/test_sunifdef/test_cases/test0176.c b/test_sunifdef/test_cases/test0176.c new file mode 100644 index 0000000..6c14ad0 --- /dev/null +++ b/test_sunifdef/test_cases/test0176.c @@ -0,0 +1,8 @@ +/**ARGS: -UFOO1 */ +/**SYSCODE: = 1 | 32 */ +#if defined(FOO3) || defined(FOO2) || defined(FOO1) +KEEP ME +#else +KEEP ME +#endif + diff --git a/test_sunifdef/test_cases/test0176.c.expect b/test_sunifdef/test_cases/test0176.c.expect new file mode 100644 index 0000000..a6ecb7f --- /dev/null +++ b/test_sunifdef/test_cases/test0176.c.expect @@ -0,0 +1,8 @@ +/**ARGS: -UFOO1 */ +/**SYSCODE: = 1 | 32 */ +#if defined(FOO3) || defined(FOO2) +KEEP ME +#else +KEEP ME +#endif + diff --git a/test_sunifdef/test_cases/test0177.c b/test_sunifdef/test_cases/test0177.c new file mode 100644 index 0000000..0ba1ae5 --- /dev/null +++ b/test_sunifdef/test_cases/test0177.c @@ -0,0 +1,7 @@ +/**ARGS: -DFOO */ +/**SYSCODE: = 0 */ +#if UNKNOWN +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0177.c.expect b/test_sunifdef/test_cases/test0177.c.expect new file mode 100644 index 0000000..0ba1ae5 --- /dev/null +++ b/test_sunifdef/test_cases/test0177.c.expect @@ -0,0 +1,7 @@ +/**ARGS: -DFOO */ +/**SYSCODE: = 0 */ +#if UNKNOWN +KEEP ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0178.c b/test_sunifdef/test_cases/test0178.c new file mode 100644 index 0000000..f70ffa0 --- /dev/null +++ b/test_sunifdef/test_cases/test0178.c @@ -0,0 +1,7 @@ +/**ARGS: -DFOO=1 */ +/**SYSCODE: = 1 | 16 */ +#if FOO +KEEP ME +#else +DELETE ME +#endif diff --git a/test_sunifdef/test_cases/test0178.c.expect b/test_sunifdef/test_cases/test0178.c.expect new file mode 100644 index 0000000..183aaff --- /dev/null +++ b/test_sunifdef/test_cases/test0178.c.expect @@ -0,0 +1,3 @@ +/**ARGS: -DFOO=1 */ +/**SYSCODE: = 1 | 16 */ +KEEP ME diff --git a/test_sunifdef/test_cases/test0179.c b/test_sunifdef/test_cases/test0179.c new file mode 100644 index 0000000..86936e2 --- /dev/null +++ b/test_sunifdef/test_cases/test0179.c @@ -0,0 +1,7 @@ +/**ARGS: -UFOO */ +/**SYSCODE: = 1 | 16 */ +#if FOO +DELETE ME +#else +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0179.c.expect b/test_sunifdef/test_cases/test0179.c.expect new file mode 100644 index 0000000..8ec1c25 --- /dev/null +++ b/test_sunifdef/test_cases/test0179.c.expect @@ -0,0 +1,4 @@ +/**ARGS: -UFOO */ +/**SYSCODE: = 1 | 16 */ +KEEP ME + diff --git a/test_sunifdef/test_cases/test0180.c b/test_sunifdef/test_cases/test0180.c new file mode 100644 index 0000000..e3d7561 --- /dev/null +++ b/test_sunifdef/test_cases/test0180.c @@ -0,0 +1,8 @@ +/**ARGS: -DFOO=1 */ +/**SYSCODE: = 4 */ +#if (FOO +ABORT +#else +ABORT +#endif + diff --git a/test_sunifdef/test_cases/test0180.c.expect b/test_sunifdef/test_cases/test0180.c.expect new file mode 100644 index 0000000..114dc69 --- /dev/null +++ b/test_sunifdef/test_cases/test0180.c.expect @@ -0,0 +1,3 @@ +/**ARGS: -DFOO=1 */ +/**SYSCODE: = 4 */ + diff --git a/test_sunifdef/test_cases/test0181.c b/test_sunifdef/test_cases/test0181.c new file mode 100644 index 0000000..8474de0 --- /dev/null +++ b/test_sunifdef/test_cases/test0181.c @@ -0,0 +1,9 @@ +/**ARGS: -DFOO=1 */ +/**SYSCODE: = 4 */ +#if FOO) +ABORT +#else +ABORT +#endif + + diff --git a/test_sunifdef/test_cases/test0181.c.expect b/test_sunifdef/test_cases/test0181.c.expect new file mode 100644 index 0000000..a22bf32 --- /dev/null +++ b/test_sunifdef/test_cases/test0181.c.expect @@ -0,0 +1,4 @@ +/**ARGS: -DFOO=1 */ +/**SYSCODE: = 4 */ + + diff --git a/test_sunifdef/test_cases/test0182.c b/test_sunifdef/test_cases/test0182.c new file mode 100644 index 0000000..1b5d038 --- /dev/null +++ b/test_sunifdef/test_cases/test0182.c @@ -0,0 +1,7 @@ +/**ARGS: -UFOO --constant eval */ +/**SYSCODE: = 1 | 16 */ +#if FOO + 1 +KEEP ME +#else +DELETE ME +#endif diff --git a/test_sunifdef/test_cases/test0182.c.expect b/test_sunifdef/test_cases/test0182.c.expect new file mode 100644 index 0000000..ad67066 --- /dev/null +++ b/test_sunifdef/test_cases/test0182.c.expect @@ -0,0 +1,5 @@ +/**ARGS: -UFOO --constant eval */ +/**SYSCODE: = 1 | 16 */ +KEEP ME + + diff --git a/test_sunifdef/test_cases/test0183.c b/test_sunifdef/test_cases/test0183.c new file mode 100644 index 0000000..98ccb1d --- /dev/null +++ b/test_sunifdef/test_cases/test0183.c @@ -0,0 +1,9 @@ +/**ARGS: -UFOO --constant eval */ +/**SYSCODE: = 1 | 16 */ +#if FOO + 0 +DELETE ME +#else +KEEP ME +#endif + + diff --git a/test_sunifdef/test_cases/test0183.c.expect b/test_sunifdef/test_cases/test0183.c.expect new file mode 100644 index 0000000..ad67066 --- /dev/null +++ b/test_sunifdef/test_cases/test0183.c.expect @@ -0,0 +1,5 @@ +/**ARGS: -UFOO --constant eval */ +/**SYSCODE: = 1 | 16 */ +KEEP ME + + diff --git a/test_sunifdef/test_cases/test0184.c b/test_sunifdef/test_cases/test0184.c new file mode 100644 index 0000000..b024d83 --- /dev/null +++ b/test_sunifdef/test_cases/test0184.c @@ -0,0 +1,5 @@ +/**ARGS: -DFOO */ +/**SYSCODE: = 0 */ +#if defined(UNK1) || defined(UNK2) || defined(UNK3) +KEEP_ME +#endif diff --git a/test_sunifdef/test_cases/test0184.c.expect b/test_sunifdef/test_cases/test0184.c.expect new file mode 100644 index 0000000..b024d83 --- /dev/null +++ b/test_sunifdef/test_cases/test0184.c.expect @@ -0,0 +1,5 @@ +/**ARGS: -DFOO */ +/**SYSCODE: = 0 */ +#if defined(UNK1) || defined(UNK2) || defined(UNK3) +KEEP_ME +#endif diff --git a/test_sunifdef/test_cases/test0185.c b/test_sunifdef/test_cases/test0185.c new file mode 100644 index 0000000..5ee8747 --- /dev/null +++ b/test_sunifdef/test_cases/test0185.c @@ -0,0 +1,19 @@ +/**ARGS: -DBAR */ +/**SYSCODE: = 0 */ + +#define A 1 /* start of comment + extends to next line */ + +#define B /* comment */ 1 + +#define C /* start of comment + extends to next line */ 1 + +#undef D /* start of comment + extends to next line */ + +#ifdef E /* start of comment + extends to next line */ + +#endif + diff --git a/test_sunifdef/test_cases/test0185.c.expect b/test_sunifdef/test_cases/test0185.c.expect new file mode 100644 index 0000000..5ee8747 --- /dev/null +++ b/test_sunifdef/test_cases/test0185.c.expect @@ -0,0 +1,19 @@ +/**ARGS: -DBAR */ +/**SYSCODE: = 0 */ + +#define A 1 /* start of comment + extends to next line */ + +#define B /* comment */ 1 + +#define C /* start of comment + extends to next line */ 1 + +#undef D /* start of comment + extends to next line */ + +#ifdef E /* start of comment + extends to next line */ + +#endif + diff --git a/test_sunifdef/test_cases/test0186.c b/test_sunifdef/test_cases/test0186.c new file mode 100644 index 0000000..58bd771 --- /dev/null +++ b/test_sunifdef/test_cases/test0186.c @@ -0,0 +1,18 @@ +/**ARGS: -DB=2 */ +/**SYSCODE: = 1 | 2 | 32 */ + +#define A 1 /* start of comment + extends to next line */ + +#define B /* comment */ 1 + +#define C /* start of comment + extends to next line */ 1 + +#undef D /* start of comment + extends to next line */ + +#ifdef E /* start of comment + extends to next line */ + +#endif diff --git a/test_sunifdef/test_cases/test0186.c.expect b/test_sunifdef/test_cases/test0186.c.expect new file mode 100644 index 0000000..2f4f65f --- /dev/null +++ b/test_sunifdef/test_cases/test0186.c.expect @@ -0,0 +1,18 @@ +/**ARGS: -DB=2 */ +/**SYSCODE: = 1 | 2 | 32 */ + +#define A 1 /* start of comment + extends to next line */ + +//error : inserted by sunifdef: "#define B /* comment */ 1" differently redefines -D symbol at ./test_cases/test0186.c(7) + +#define C /* start of comment + extends to next line */ 1 + +#undef D /* start of comment + extends to next line */ + +#ifdef E /* start of comment + extends to next line */ + +#endif diff --git a/test_sunifdef/test_cases/test0187.c b/test_sunifdef/test_cases/test0187.c new file mode 100644 index 0000000..f782843 --- /dev/null +++ b/test_sunifdef/test_cases/test0187.c @@ -0,0 +1,13 @@ +/**ARGS: -DB=1 */ +/**SYSCODE: = 1 | 16 */ + +#define A 1 /* start of comment + extends to next line */ +#define B /* comment */ 1 +#define C /* start of comment + extends to next line */ 1 +#undef D /* start of comment + extends to next line */ +#ifdef E /* start of comment + extends to next line */ +#endif diff --git a/test_sunifdef/test_cases/test0187.c.expect b/test_sunifdef/test_cases/test0187.c.expect new file mode 100644 index 0000000..899ee05 --- /dev/null +++ b/test_sunifdef/test_cases/test0187.c.expect @@ -0,0 +1,12 @@ +/**ARGS: -DB=1 */ +/**SYSCODE: = 1 | 16 */ + +#define A 1 /* start of comment + extends to next line */ +#define C /* start of comment + extends to next line */ 1 +#undef D /* start of comment + extends to next line */ +#ifdef E /* start of comment + extends to next line */ +#endif diff --git a/test_sunifdef/test_cases/test0188.c b/test_sunifdef/test_cases/test0188.c new file mode 100644 index 0000000..6d9789b --- /dev/null +++ b/test_sunifdef/test_cases/test0188.c @@ -0,0 +1,14 @@ +/**ARGS: -DC=1 */ +/**SYSCODE: = 1 | 16 */ + +#define A 1 /* start of comment + extends to next line */ +#define B /* comment */ 1 +#define C /* start of comment + extends to next line + and to next line */ 1 +#undef D /* start of comment + extends to next line */ +#ifdef E /* start of comment + extends to next line */ +#endif diff --git a/test_sunifdef/test_cases/test0188.c.expect b/test_sunifdef/test_cases/test0188.c.expect new file mode 100644 index 0000000..043f7ba --- /dev/null +++ b/test_sunifdef/test_cases/test0188.c.expect @@ -0,0 +1,11 @@ +/**ARGS: -DC=1 */ +/**SYSCODE: = 1 | 16 */ + +#define A 1 /* start of comment + extends to next line */ +#define B /* comment */ 1 +#undef D /* start of comment + extends to next line */ +#ifdef E /* start of comment + extends to next line */ +#endif diff --git a/test_sunifdef/test_cases/test0189.c b/test_sunifdef/test_cases/test0189.c new file mode 100644 index 0000000..76c9aad --- /dev/null +++ b/test_sunifdef/test_cases/test0189.c @@ -0,0 +1,14 @@ +/**ARGS: -DC=1 --discard blank */ +/**SYSCODE: = 1 | 32 */ + +#define A 1 /* start of comment + extends to next line */ +#define B /* comment */ 1 +#define C /* start of comment + extends to next line + and to next line */ 1 +#undef D /* start of comment + extends to next line */ +#ifdef E /* start of comment + extends to next line */ +#endif diff --git a/test_sunifdef/test_cases/test0189.c.expect b/test_sunifdef/test_cases/test0189.c.expect new file mode 100644 index 0000000..4d26592 --- /dev/null +++ b/test_sunifdef/test_cases/test0189.c.expect @@ -0,0 +1,14 @@ +/**ARGS: -DC=1 --discard blank */ +/**SYSCODE: = 1 | 32 */ + +#define A 1 /* start of comment + extends to next line */ +#define B /* comment */ 1 + + + +#undef D /* start of comment + extends to next line */ +#ifdef E /* start of comment + extends to next line */ +#endif diff --git a/test_sunifdef/test_cases/test0190.c b/test_sunifdef/test_cases/test0190.c new file mode 100644 index 0000000..2cd1a41 --- /dev/null +++ b/test_sunifdef/test_cases/test0190.c @@ -0,0 +1,14 @@ +/**ARGS: -DC=1 --line */ +/**SYSCODE: = 1 | 16 | 32 */ + +#define A 1 /* start of comment + extends to next line */ +#define B /* comment */ 1 +#define C /* start of comment + extends to next line + and to next line */ 1 +#undef D /* start of comment + extends to next line */ +#ifdef E /* start of comment + extends to next line */ +#endif diff --git a/test_sunifdef/test_cases/test0190.c.expect b/test_sunifdef/test_cases/test0190.c.expect new file mode 100644 index 0000000..d49a74b --- /dev/null +++ b/test_sunifdef/test_cases/test0190.c.expect @@ -0,0 +1,12 @@ +/**ARGS: -DC=1 --line */ +/**SYSCODE: = 1 | 16 | 32 */ + +#define A 1 /* start of comment + extends to next line */ +#define B /* comment */ 1 +#line 10 +#undef D /* start of comment + extends to next line */ +#ifdef E /* start of comment + extends to next line */ +#endif diff --git a/test_sunifdef/test_cases/test0191.c b/test_sunifdef/test_cases/test0191.c new file mode 100644 index 0000000..0e14475 --- /dev/null +++ b/test_sunifdef/test_cases/test0191.c @@ -0,0 +1,6 @@ +/**ARGS: -DB=1 --line */ +/**SYSCODE: = 1 | 32 */ +#define B /* comment */ 1 +#if 1 +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0191.c.expect b/test_sunifdef/test_cases/test0191.c.expect new file mode 100644 index 0000000..e9c8e76 --- /dev/null +++ b/test_sunifdef/test_cases/test0191.c.expect @@ -0,0 +1,7 @@ +/**ARGS: -DB=1 --line */ +/**SYSCODE: = 1 | 32 */ +#line 4 +#if 1 +KEEP ME +#endif + diff --git a/test_sunifdef/test_cases/test0192.c b/test_sunifdef/test_cases/test0192.c new file mode 100644 index 0000000..0ff18ba --- /dev/null +++ b/test_sunifdef/test_cases/test0192.c @@ -0,0 +1,5 @@ +/**ARGS: -UA -UB */ +/**SYSCODE: = 1 | 16 */ +#undef /* Comment */ A +#undef /* Comment + extending to next line */ B diff --git a/test_sunifdef/test_cases/test0192.c.expect b/test_sunifdef/test_cases/test0192.c.expect new file mode 100644 index 0000000..b84c5a7 --- /dev/null +++ b/test_sunifdef/test_cases/test0192.c.expect @@ -0,0 +1,2 @@ +/**ARGS: -UA -UB */ +/**SYSCODE: = 1 | 16 */ diff --git a/test_sunifdef/test_cases/test0193.c b/test_sunifdef/test_cases/test0193.c new file mode 100644 index 0000000..0875440 --- /dev/null +++ b/test_sunifdef/test_cases/test0193.c @@ -0,0 +1,5 @@ +/**ARGS: -DA -DB */ +/**SYSCODE: = 1 | 2 | 16 | 32 */ +#undef /* Comment */ A +#undef /* Comment + extending to next line */ B diff --git a/test_sunifdef/test_cases/test0193.c.expect b/test_sunifdef/test_cases/test0193.c.expect new file mode 100644 index 0000000..1371a24 --- /dev/null +++ b/test_sunifdef/test_cases/test0193.c.expect @@ -0,0 +1,5 @@ +/**ARGS: -DA -DB */ +/**SYSCODE: = 1 | 2 | 16 | 32 */ +//error : inserted by sunifdef: "#undef /* Comment */ A" contradicts -D symbol at ./test_cases/test0193.c(3) +//error : inserted by sunifdef: "#undef /* Comment extending to next line */ B" +contradicts -D symbol at ./test_cases/test0193.c(5) diff --git a/test_sunifdef/test_cases/test0194.c b/test_sunifdef/test_cases/test0194.c new file mode 100644 index 0000000..5b2ab6a --- /dev/null +++ b/test_sunifdef/test_cases/test0194.c @@ -0,0 +1,9 @@ +/**ARGS: -DA -UB */ +/**SYSCODE: = 1 | 16 */ +#ifdef /* Comment */ A +KEEP ME +#endif +#if /* Comment + extending to next line */ defined(B) +DELETE ME +#endif diff --git a/test_sunifdef/test_cases/test0194.c.expect b/test_sunifdef/test_cases/test0194.c.expect new file mode 100644 index 0000000..4be088e --- /dev/null +++ b/test_sunifdef/test_cases/test0194.c.expect @@ -0,0 +1,3 @@ +/**ARGS: -DA -UB */ +/**SYSCODE: = 1 | 16 */ +KEEP ME diff --git a/test_sunifdef/test_cases/test0195.c b/test_sunifdef/test_cases/test0195.c new file mode 100644 index 0000000..2f2bfbe --- /dev/null +++ b/test_sunifdef/test_cases/test0195.c @@ -0,0 +1,7 @@ +/**ARGS: -DA */ +/**SYSCODE: = 1 | 16 */ +#if\ +\ +def A +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0195.c.expect b/test_sunifdef/test_cases/test0195.c.expect new file mode 100644 index 0000000..171fd9c --- /dev/null +++ b/test_sunifdef/test_cases/test0195.c.expect @@ -0,0 +1,4 @@ +/**ARGS: -DA */ +/**SYSCODE: = 1 | 16 */ +KEEP ME + diff --git a/test_sunifdef/test_cases/test0196.c b/test_sunifdef/test_cases/test0196.c new file mode 100644 index 0000000..3939381 --- /dev/null +++ b/test_sunifdef/test_cases/test0196.c @@ -0,0 +1,5 @@ +/**ARGS: "-DA=(B+C)" -DB=0x1 -DC=2 */ +/**SYSCODE: = 1 | 16 */ +#if A > B +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0196.c.expect b/test_sunifdef/test_cases/test0196.c.expect new file mode 100644 index 0000000..322704e --- /dev/null +++ b/test_sunifdef/test_cases/test0196.c.expect @@ -0,0 +1,3 @@ +/**ARGS: "-DA=(B+C)" -DB=0x1 -DC=2 */ +/**SYSCODE: = 1 | 16 */ +KEEP ME diff --git a/test_sunifdef/test_cases/test0197.c b/test_sunifdef/test_cases/test0197.c new file mode 100644 index 0000000..05b08a6 --- /dev/null +++ b/test_sunifdef/test_cases/test0197.c @@ -0,0 +1,5 @@ +/**ARGS: "-DA=(1+2)" -DB=1 */ +/**SYSCODE: = 1 | 16 */ +#if A > B +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0197.c.expect b/test_sunifdef/test_cases/test0197.c.expect new file mode 100644 index 0000000..ef57887 --- /dev/null +++ b/test_sunifdef/test_cases/test0197.c.expect @@ -0,0 +1,3 @@ +/**ARGS: "-DA=(1+2)" -DB=1 */ +/**SYSCODE: = 1 | 16 */ +KEEP ME diff --git a/test_sunifdef/test_cases/test0198.c b/test_sunifdef/test_cases/test0198.c new file mode 100644 index 0000000..47333f8 --- /dev/null +++ b/test_sunifdef/test_cases/test0198.c @@ -0,0 +1,11 @@ +/**ARGS: -DA=1 -DB=0 "-DC=(1 && 0)" */ +/**SYSCODE: = 1 | 16 */ +#if (A || B) +KEEP ME +#endif +#if (A && B) +DELETE ME +#endif +#if C +DELETE ME +#endif diff --git a/test_sunifdef/test_cases/test0198.c.expect b/test_sunifdef/test_cases/test0198.c.expect new file mode 100644 index 0000000..f159aa1 --- /dev/null +++ b/test_sunifdef/test_cases/test0198.c.expect @@ -0,0 +1,3 @@ +/**ARGS: -DA=1 -DB=0 "-DC=(1 && 0)" */ +/**SYSCODE: = 1 | 16 */ +KEEP ME diff --git a/test_sunifdef/test_cases/test0199.c b/test_sunifdef/test_cases/test0199.c new file mode 100644 index 0000000..a2d265a --- /dev/null +++ b/test_sunifdef/test_cases/test0199.c @@ -0,0 +1,11 @@ +/**ARGS: -DFOO */ +/**SYSCODE: = 1 | 16 */ +#if 0x10u == 16U +KEEP ME +#endif +#if (020l == 16L) +KEEP ME +#endif +#if 020uL != 0x10Ul +DELETE ME +#endif diff --git a/test_sunifdef/test_cases/test0199.c.expect b/test_sunifdef/test_cases/test0199.c.expect new file mode 100644 index 0000000..6d158b0 --- /dev/null +++ b/test_sunifdef/test_cases/test0199.c.expect @@ -0,0 +1,5 @@ +/**ARGS: -DFOO */ +/**SYSCODE: = 1 | 16 */ +KEEP ME +KEEP ME + diff --git a/test_sunifdef/test_cases/test0200.c b/test_sunifdef/test_cases/test0200.c new file mode 100644 index 0000000..84a6650 --- /dev/null +++ b/test_sunifdef/test_cases/test0200.c @@ -0,0 +1,5 @@ +/**ARGS: -DFOO */ +/**SYSCODE: = 2 */ +#if 4294967296 > 0 +KEEP ME +#endif diff --git a/test_sunifdef/test_cases/test0200.c.expect b/test_sunifdef/test_cases/test0200.c.expect new file mode 100644 index 0000000..84a6650 --- /dev/null +++ b/test_sunifdef/test_cases/test0200.c.expect @@ -0,0 +1,5 @@ +/**ARGS: -DFOO */ +/**SYSCODE: = 2 */ +#if 4294967296 > 0 +KEEP ME +#endif