Full Code of google/crush-tools for AI

master a60716b91435 cached
592 files
3.4 MB
921.8k tokens
275 symbols
1 requests
Download .txt
Showing preview only (3,681K chars total). Download the full file or copy to clipboard to get everything.
Repository: google/crush-tools
Branch: master
Commit: a60716b91435
Files: 592
Total size: 3.4 MB

Directory structure:
gitextract_vuzdkc56/

├── AUTHORS
├── COPYING
├── ChangeLog
├── HACKING
├── INSTALL
├── Makefile.am
├── README
├── TODO
├── acinclude.m4
├── bootstrap
├── build/
│   ├── config.guess
│   ├── config.sub
│   ├── depcomp
│   ├── install-sh
│   ├── ltmain.sh
│   └── missing
├── cgener
├── configure.ac
├── contrib/
│   ├── Makefile.am
│   ├── crushlib-test.sh
│   ├── crushlib.sh
│   └── csv2d
├── dev_tools/
│   ├── argstab2wiki.pl
│   ├── datagen
│   └── rebuild_userdocs.sh
└── src/
    ├── Makefile.am
    ├── add_field/
    │   ├── Makefile.am
    │   ├── add_field.in
    │   ├── args.tab
    │   ├── test.conf
    │   └── tests/
    │       ├── test.first.expect
    │       ├── test.in
    │       ├── test.last.expect
    │       ├── test.second.expect
    │       ├── test.third.expect
    │       ├── test_00.sh
    │       ├── test_01.sh
    │       ├── test_02.sh
    │       ├── test_03.0.expect
    │       ├── test_03.1.expect
    │       ├── test_03.2.expect
    │       └── test_03.sh
    ├── aggregate/
    │   ├── Makefile.am
    │   ├── aggregate.c
    │   ├── aggregate.h
    │   ├── args.tab
    │   ├── bak/
    │   │   ├── aggregate
    │   │   └── aggregate.alt
    │   ├── example.html
    │   ├── test/
    │   │   ├── test.in
    │   │   ├── test.in2
    │   │   ├── test.in3
    │   │   ├── test_00.expected
    │   │   ├── test_00.sh
    │   │   ├── test_01.expected
    │   │   ├── test_01.sh
    │   │   ├── test_02.expected
    │   │   ├── test_02.sh
    │   │   ├── test_03.expected
    │   │   ├── test_03.sh
    │   │   ├── test_04.expected
    │   │   ├── test_04.sh
    │   │   ├── test_05.0.C.expected
    │   │   ├── test_05.0.en_US.utf8.expected
    │   │   ├── test_05.0.es_AR.utf8.expected
    │   │   ├── test_05.1.C.expected
    │   │   ├── test_05.1.en_US.utf8.expected
    │   │   ├── test_05.1.es_AR.utf8.expected
    │   │   ├── test_05.2.C.expected
    │   │   ├── test_05.2.en_US.utf8.expected
    │   │   ├── test_05.2.es_AR.utf8.expected
    │   │   ├── test_05.sh
    │   │   ├── test_06.0.expected
    │   │   ├── test_06.1.expected
    │   │   ├── test_06.2.expected
    │   │   ├── test_06.sh
    │   │   ├── test_07.expected
    │   │   ├── test_07.sh
    │   │   ├── test_08.expected
    │   │   ├── test_08.sh
    │   │   ├── test_09.sh
    │   │   ├── test_10.sh
    │   │   ├── test_11.expected
    │   │   └── test_11.sh
    │   └── test.conf
    ├── aggregate2/
    │   ├── Makefile.am
    │   ├── aggregate2.c
    │   ├── args.tab
    │   ├── test/
    │   │   ├── test.in
    │   │   ├── test.in2
    │   │   ├── test_00.expected
    │   │   ├── test_00.sh
    │   │   ├── test_01.expected
    │   │   ├── test_01.sh
    │   │   ├── test_02.expected
    │   │   ├── test_02.sh
    │   │   ├── test_03.expected
    │   │   ├── test_03.sh
    │   │   ├── test_04.sh
    │   │   ├── test_05.expected
    │   │   ├── test_05.sh
    │   │   ├── test_06.expected
    │   │   ├── test_06.sh
    │   │   ├── test_07.expected
    │   │   └── test_07.sh
    │   └── test.conf
    ├── bin/
    │   ├── Makefile.am
    │   ├── genman.pl
    │   └── testharness.sh
    ├── buffer/
    │   ├── Makefile.am
    │   ├── args.tab
    │   └── buffer.c
    ├── calcfield/
    │   ├── Makefile.am
    │   ├── args.tab
    │   ├── calcfield.in
    │   ├── test/
    │   │   ├── imps_clks.log
    │   │   ├── test.txt
    │   │   ├── test_00.expected
    │   │   ├── test_00.sh
    │   │   ├── test_01.expected
    │   │   ├── test_01.sh
    │   │   ├── test_02.expected
    │   │   ├── test_02.sh
    │   │   ├── test_03.expected
    │   │   ├── test_03.sh
    │   │   ├── test_04.0.expected
    │   │   ├── test_04.1.expected
    │   │   ├── test_04.2.expected
    │   │   ├── test_04.3.expected
    │   │   ├── test_04.sh
    │   │   ├── test_05.expected
    │   │   └── test_05.sh
    │   └── test.conf
    ├── convdate/
    │   ├── Makefile.am
    │   ├── args.tab
    │   ├── convdate.c
    │   ├── convdate.h
    │   ├── example.html
    │   ├── test/
    │   │   ├── test_01.sh
    │   │   ├── test_02.sh
    │   │   ├── test_03.sh
    │   │   └── test_04.sh
    │   └── test.conf
    ├── csvformat/
    │   ├── Makefile.am
    │   ├── args.tab
    │   ├── csvformat.in
    │   ├── test.conf
    │   └── tests/
    │       ├── test_00.expected
    │       ├── test_00.sh
    │       ├── test_01.sh
    │       ├── test_02.sh
    │       ├── test_03.expected
    │       ├── test_03.in
    │       ├── test_03.sh
    │       └── test_04.sh
    ├── cutfield/
    │   ├── Makefile.am
    │   ├── args.tab
    │   ├── cutfield.c
    │   ├── test/
    │   │   ├── test_01.sh
    │   │   ├── test_02.sh
    │   │   ├── test_03.sh
    │   │   ├── test_04.sh
    │   │   └── test_05.sh
    │   └── test.conf
    ├── dates_in_range/
    │   ├── Makefile.am
    │   ├── args.tab
    │   └── dates_in_range.in
    ├── dbstream/
    │   ├── Makefile.am
    │   ├── args.tab
    │   ├── dbstream.in
    │   ├── test.conf
    │   └── tests/
    │       ├── setup.pl
    │       ├── test_00.sh
    │       ├── test_01.sh
    │       ├── test_02.sh
    │       ├── test_03.sh
    │       ├── test_04.sh
    │       ├── test_05.sh
    │       ├── test_06.sh
    │       ├── test_07.sh
    │       └── test_08.sh
    ├── deltadays/
    │   ├── Makefile.am
    │   ├── args.tab
    │   └── deltadays.in
    ├── deltaforce/
    │   ├── Makefile.am
    │   ├── args.tab
    │   ├── deltaforce.c
    │   ├── deltaforce.h
    │   ├── test.conf
    │   └── tests/
    │       ├── test_00-delta.txt
    │       ├── test_00-full.txt
    │       ├── test_00.expected
    │       ├── test_00.sh
    │       ├── test_01-delta.txt
    │       ├── test_01-full.txt
    │       ├── test_01.expected
    │       ├── test_01.sh
    │       ├── test_02-delta.txt
    │       ├── test_02-full.txt
    │       ├── test_02.expected
    │       ├── test_02.sh
    │       ├── test_03-delta.txt
    │       ├── test_03-full.txt
    │       ├── test_03.expected
    │       ├── test_03.sh
    │       ├── test_04-delta.txt
    │       ├── test_04-full.txt
    │       ├── test_04.expected
    │       └── test_04.sh
    ├── fieldsplit/
    │   ├── Makefile.am
    │   ├── args.tab
    │   ├── fieldsplit.c
    │   ├── test/
    │   │   ├── 001/
    │   │   │   ├── 2008-01.expected
    │   │   │   └── 2008-02.expected
    │   │   ├── 001-transform-key.txt
    │   │   ├── 002-data.txt
    │   │   ├── 003/
    │   │   │   ├── 2008-01-29.expected
    │   │   │   ├── 2008-02-01.expected
    │   │   │   └── 2008-02-09.expected
    │   │   ├── 004/
    │   │   │   ├── 1.expected
    │   │   │   └── 2.expected
    │   │   ├── 005/
    │   │   │   ├── 10.expected
    │   │   │   ├── 11.expected
    │   │   │   └── _blank_value.expected
    │   │   ├── 006/
    │   │   │   ├── 0.expected
    │   │   │   ├── 1.expected
    │   │   │   └── 2.expected
    │   │   ├── 007/
    │   │   │   ├── 1.expected
    │   │   │   └── 2.expected
    │   │   ├── 008/
    │   │   │   ├── 10.expected
    │   │   │   ├── 11.expected
    │   │   │   └── _blank_value.expected
    │   │   ├── test_001.sh
    │   │   ├── test_002.sh
    │   │   ├── test_003.sh
    │   │   ├── test_004.sh
    │   │   ├── test_005.sh
    │   │   ├── test_006.sh
    │   │   ├── test_007.sh
    │   │   └── test_008.sh
    │   └── test.conf
    ├── filterkeys/
    │   ├── Makefile.am
    │   ├── args.tab
    │   ├── filterkeys.c
    │   ├── filterkeys.h
    │   ├── test/
    │   │   ├── test-1.in
    │   │   ├── test-2.in
    │   │   ├── test-3.in
    │   │   ├── test-4.in
    │   │   ├── test-filter-2.in
    │   │   ├── test-filter-3.in
    │   │   ├── test-filter.in
    │   │   ├── test_00.expected
    │   │   ├── test_00.sh
    │   │   ├── test_01.expected
    │   │   ├── test_01.sh
    │   │   ├── test_02.expected
    │   │   ├── test_02.sh
    │   │   ├── test_03.expected
    │   │   ├── test_03.sh
    │   │   ├── test_04.expected
    │   │   ├── test_04.sh
    │   │   ├── test_05.expected
    │   │   ├── test_05.sh
    │   │   ├── test_06.expected
    │   │   ├── test_06.sh
    │   │   ├── test_07.expected
    │   │   └── test_07.sh
    │   └── test.conf
    ├── find_not_processed/
    │   ├── Makefile.am
    │   ├── args.tab
    │   ├── find_not_processed.in
    │   └── test.sh
    ├── findfiles/
    │   ├── Makefile.am
    │   ├── args.tab
    │   └── findfiles.in
    ├── foreach_parallel/
    │   ├── Makefile.am
    │   ├── args.tab
    │   ├── foreach_parallel.c
    │   └── test/
    │       └── echo.sh
    ├── funiq/
    │   ├── Makefile.am
    │   ├── args.tab
    │   ├── example.html
    │   ├── funiq.c
    │   ├── test/
    │   │   ├── test_01.sh
    │   │   ├── test_02.sh
    │   │   ├── test_03.sh
    │   │   ├── test_04.sh
    │   │   └── test_05.sh
    │   └── test.conf
    ├── grepfield/
    │   ├── Makefile.am
    │   ├── args.tab
    │   ├── example.html
    │   ├── grepfield.c
    │   ├── grepfield.h
    │   ├── test/
    │   │   ├── test.in
    │   │   ├── test_00.expected
    │   │   ├── test_00.sh
    │   │   ├── test_01.expected
    │   │   ├── test_01.sh
    │   │   ├── test_02.expected
    │   │   ├── test_02.sh
    │   │   ├── test_03.expected
    │   │   ├── test_03.sh
    │   │   ├── test_04.expected
    │   │   ├── test_04.sh
    │   │   ├── test_05.1.expected
    │   │   ├── test_05.2.expected
    │   │   ├── test_05.3.expected
    │   │   ├── test_05.in
    │   │   └── test_05.sh
    │   └── test.conf
    ├── hashjoin/
    │   ├── Makefile.am
    │   ├── args.tab
    │   ├── hashjoin.c
    │   ├── test/
    │   │   ├── dimension_header.log
    │   │   ├── dimension_no_header.log
    │   │   ├── input_header.log
    │   │   ├── input_no_header.log
    │   │   ├── test_00.expected
    │   │   ├── test_00.sh
    │   │   ├── test_01.expected
    │   │   ├── test_01.sh
    │   │   ├── test_02.expected
    │   │   ├── test_02.sh
    │   │   ├── test_03.expected
    │   │   ├── test_03.sh
    │   │   ├── test_04.sh
    │   │   ├── test_05.1.expected
    │   │   ├── test_05.2.expected
    │   │   ├── test_05.3.expected
    │   │   ├── test_05.sh
    │   │   ├── test_06.sh
    │   │   ├── test_07.expected
    │   │   ├── test_07.sh
    │   │   ├── test_08.expected
    │   │   ├── test_08.sh
    │   │   ├── test_09.1.expected
    │   │   ├── test_09.2.expected
    │   │   └── test_09.sh
    │   └── test.conf
    ├── indexof/
    │   ├── Makefile.am
    │   ├── args.tab
    │   ├── example.html
    │   ├── indexof.c
    │   ├── indexof.h
    │   ├── test/
    │   │   ├── test_01.sh
    │   │   ├── test_02.sh
    │   │   └── test_03.sh
    │   └── test.conf
    ├── libcrush/
    │   ├── GeneralHashFunctions.c
    │   ├── Makefile.am
    │   ├── bstree.c
    │   ├── crush/
    │   │   ├── Makefile.am
    │   │   ├── bstree.h
    │   │   ├── crush_version.h.in
    │   │   ├── crushstr.h
    │   │   ├── dbfr.h
    │   │   ├── ffutils.h
    │   │   ├── general.h
    │   │   ├── hashfuncs.h
    │   │   ├── hashtbl.h
    │   │   ├── hashtbl2.h
    │   │   ├── ht2_GeneralHashFunctions.h
    │   │   ├── linklist.h
    │   │   ├── mempool.h
    │   │   ├── qsort_helper.h
    │   │   ├── queue.h
    │   │   └── reutils.h
    │   ├── crushstr.c
    │   ├── dbfr.c
    │   ├── ffutils.c
    │   ├── general.c
    │   ├── hashfuncs.c
    │   ├── hashtbl.c
    │   ├── hashtbl2.c
    │   ├── linklist.c
    │   ├── mempool.c
    │   ├── qsort_helper.c
    │   ├── queue.c
    │   ├── reutils.c
    │   └── test/
    │       ├── bstree_test.c
    │       ├── crushstr_test.c
    │       ├── datecmp_test.c
    │       ├── datecmp_test.dmy.in
    │       ├── datecmp_test.in
    │       ├── dbfr_test.c
    │       ├── ffutils_test.c
    │       ├── hashtbl_test.c
    │       ├── mempool_test.c
    │       ├── qsort_helper_test.c
    │       ├── reutils_test.c
    │       └── unittest.h
    ├── mergekeys/
    │   ├── Makefile.am
    │   ├── args.tab
    │   ├── example.html
    │   ├── mergekeys.c
    │   ├── mergekeys.h
    │   ├── test.conf
    │   └── tests/
    │       ├── test_00.a
    │       ├── test_00.b
    │       ├── test_00.expected
    │       ├── test_00.sh
    │       ├── test_01.a
    │       ├── test_01.b
    │       ├── test_01.expected
    │       ├── test_01.sh
    │       ├── test_02.-i.expected
    │       ├── test_02.-l.expected
    │       ├── test_02.-r.expected
    │       ├── test_02..expected
    │       ├── test_02.a
    │       ├── test_02.b
    │       ├── test_02.sh
    │       ├── test_03.-i.expected
    │       ├── test_03.-l.expected
    │       ├── test_03.-r.expected
    │       ├── test_03..expected
    │       ├── test_03.a
    │       ├── test_03.b
    │       ├── test_03.sh
    │       ├── test_04.-i.expected
    │       ├── test_04.-l.expected
    │       ├── test_04.-r.expected
    │       ├── test_04..expected
    │       ├── test_04.a
    │       ├── test_04.b
    │       ├── test_04.sh
    │       ├── test_05.-i.expected
    │       ├── test_05.-l.expected
    │       ├── test_05.-r.expected
    │       ├── test_05..expected
    │       ├── test_05.a
    │       ├── test_05.b
    │       ├── test_05.sh
    │       ├── test_06.-i.expected
    │       ├── test_06.-l.expected
    │       ├── test_06.-r.expected
    │       ├── test_06..expected
    │       ├── test_06.a
    │       ├── test_06.b
    │       ├── test_06.sh
    │       ├── test_07.-i.expected
    │       ├── test_07.-l.expected
    │       ├── test_07.-r.expected
    │       ├── test_07..expected
    │       ├── test_07.a
    │       ├── test_07.b
    │       ├── test_07.sh
    │       ├── test_08.-i.expected
    │       ├── test_08.-l.expected
    │       ├── test_08.-r.expected
    │       ├── test_08..expected
    │       ├── test_08.a
    │       ├── test_08.b
    │       ├── test_08.sh
    │       ├── test_09.a
    │       ├── test_09.b
    │       ├── test_09.expected
    │       ├── test_09.sh
    │       ├── test_10.-i.expected
    │       ├── test_10.-l.expected
    │       ├── test_10.-r.expected
    │       ├── test_10..expected
    │       ├── test_10.a
    │       ├── test_10.b
    │       ├── test_10.sh
    │       ├── test_11.a
    │       ├── test_11.b
    │       ├── test_11.expected
    │       ├── test_11.sh
    │       ├── test_12.-i.expected
    │       ├── test_12.-l.expected
    │       ├── test_12.-r.expected
    │       ├── test_12..expected
    │       ├── test_12.a
    │       ├── test_12.b
    │       ├── test_12.sh
    │       ├── test_13.-i.expected
    │       ├── test_13.-l.expected
    │       ├── test_13.-r.expected
    │       ├── test_13..expected
    │       ├── test_13.a
    │       ├── test_13.b
    │       ├── test_13.sh
    │       ├── test_14.a
    │       ├── test_14.b
    │       ├── test_14.expected
    │       ├── test_14.sh
    │       ├── test_15.-i.expected
    │       ├── test_15.-l.expected
    │       ├── test_15.-r.expected
    │       ├── test_15..expected
    │       ├── test_15.a
    │       ├── test_15.b
    │       ├── test_15.sh
    │       ├── test_16.a
    │       ├── test_16.b
    │       ├── test_16.expected
    │       └── test_16.sh
    ├── perllib/
    │   ├── Makefile.am
    │   ├── crush_version.pl.in
    │   ├── date_parse_format.pl
    │   ├── date_parse_format_test.pl
    │   ├── hackery.m4
    │   ├── utils.pl
    │   └── utils_test.pl
    ├── pivot/
    │   ├── Makefile.am
    │   ├── README.functional
    │   ├── args.tab
    │   ├── example.html
    │   ├── pivot.c
    │   ├── prototype/
    │   │   └── pivot.pl
    │   ├── test.conf
    │   └── tests/
    │       ├── test_00.expected
    │       ├── test_00.in
    │       ├── test_00.sh
    │       ├── test_01.expected
    │       ├── test_01.in
    │       ├── test_01.sh
    │       ├── test_02.expected
    │       ├── test_02.in
    │       └── test_02.sh
    ├── range/
    │   ├── Makefile.am
    │   ├── args.tab
    │   └── range.c
    ├── reorder/
    │   ├── Makefile.am
    │   ├── args.tab
    │   ├── example.html
    │   ├── reorder.c
    │   ├── reorder.h
    │   ├── reorder.test.sh
    │   ├── test.conf
    │   └── tests/
    │       ├── test.in0
    │       ├── test.in1
    │       ├── test.in2
    │       ├── test_00.sh
    │       ├── test_01.0.expected
    │       ├── test_01.sh
    │       ├── test_02.1.expected
    │       ├── test_02.sh
    │       ├── test_03.expected
    │       ├── test_03.sh
    │       ├── test_04.0.expected
    │       ├── test_04.1.expected
    │       ├── test_04.2.expected
    │       ├── test_04.3.expected
    │       ├── test_04.4.expected
    │       ├── test_04.5.expected
    │       ├── test_04.sh
    │       ├── test_05.0.expected
    │       ├── test_05.1.expected
    │       ├── test_05.2.expected
    │       ├── test_05.in
    │       ├── test_05.sh
    │       └── test_labeled.in
    ├── subtotal/
    │   ├── Makefile.am
    │   ├── args.tab
    │   ├── example.html
    │   ├── subtotal.c
    │   ├── test/
    │   │   ├── test_01.sh
    │   │   ├── test_02.sh
    │   │   ├── test_03.sh
    │   │   └── test_04.sh
    │   └── test.conf
    ├── tochar/
    │   ├── Makefile.am
    │   ├── args.tab
    │   └── tochar.c
    ├── translate_field/
    │   ├── Makefile.am
    │   ├── args.tab
    │   ├── test.conf
    │   ├── tests/
    │   │   ├── test.in
    │   │   ├── test_00.expected
    │   │   ├── test_00.sh
    │   │   ├── test_01.expected
    │   │   ├── test_01.sh
    │   │   ├── test_02.expected
    │   │   ├── test_02.sh
    │   │   ├── test_03.expected
    │   │   ├── test_03.sh
    │   │   ├── test_04.expected
    │   │   ├── test_04.sh
    │   │   ├── test_05.expected
    │   │   └── test_05.sh
    │   └── translate_field.in
    └── truncfield/
        ├── Makefile.am
        ├── args.tab
        ├── test/
        │   ├── test_01.sh
        │   ├── test_02.sh
        │   └── test_03.sh
        ├── test.conf
        └── truncfield.c

================================================
FILE CONTENTS
================================================

================================================
FILE: AUTHORS
================================================
Google, Inc

Contributers:

Jeremy Hinds
Jason Gessner
Jim Renwick
Norman Gocke
Rodofo Granata
Tobias Wolff



================================================
FILE: COPYING
================================================

                                 Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."

      "Contributor" shall mean Licensor and any individual or Legal Entity
      on behalf of whom a Contribution has been received by Licensor and
      subsequently incorporated within the Work.

   2. Grant of Copyright License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      copyright license to reproduce, prepare Derivative Works of,
      publicly display, publicly perform, sublicense, and distribute the
      Work and such Derivative Works in Source or Object form.

   3. Grant of Patent License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      (except as stated in this section) patent license to make, have made,
      use, offer to sell, sell, import, and otherwise transfer the Work,
      where such license applies only to those patent claims licensable
      by such Contributor that are necessarily infringed by their
      Contribution(s) alone or by combination of their Contribution(s)
      with the Work to which such Contribution(s) was submitted. If You
      institute patent litigation against any entity (including a
      cross-claim or counterclaim in a lawsuit) alleging that the Work
      or a Contribution incorporated within the Work constitutes direct
      or contributory patent infringement, then any patent licenses
      granted to You under this License for that Work shall terminate
      as of the date such litigation is filed.

   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:

      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and

      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and

      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and

      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, then any Derivative Works that You distribute must
          include a readable copy of the attribution notices contained
          within such NOTICE file, excluding those notices that do not
          pertain to any part of the Derivative Works, in at least one
          of the following places: within a NOTICE text file distributed
          as part of the Derivative Works; within the Source form or
          documentation, if provided along with the Derivative Works; or,
          within a display generated by the Derivative Works, if and
          wherever such third-party notices normally appear. The contents
          of the NOTICE file are for informational purposes only and
          do not modify the License. You may add Your own attribution
          notices within Derivative Works that You distribute, alongside
          or as an addendum to the NOTICE text from the Work, provided
          that such additional attribution notices cannot be construed
          as modifying the License.

      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.

   5. Submission of Contributions. Unless You explicitly state otherwise,
      any Contribution intentionally submitted for inclusion in the Work
      by You to the Licensor shall be under the terms and conditions of
      this License, without any additional terms or conditions.
      Notwithstanding the above, nothing herein shall supersede or modify
      the terms of any separate license agreement you may have executed
      with Licensor regarding such Contributions.

   6. Trademarks. This License does not grant permission to use the trade
      names, trademarks, service marks, or product names of the Licensor,
      except as required for reasonable and customary use in describing the
      origin of the Work and reproducing the content of the NOTICE file.

   7. Disclaimer of Warranty. Unless required by applicable law or
      agreed to in writing, Licensor provides the Work (and each
      Contributor provides its Contributions) on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
      implied, including, without limitation, any warranties or conditions
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
      PARTICULAR PURPOSE. You are solely responsible for determining the
      appropriateness of using or redistributing the Work and assume any
      risks associated with Your exercise of permissions under this License.

   8. Limitation of Liability. In no event and under no legal theory,
      whether in tort (including negligence), contract, or otherwise,
      unless required by applicable law (such as deliberate and grossly
      negligent acts) or agreed to in writing, shall any Contributor be
      liable to You for damages, including any direct, indirect, special,
      incidental, or consequential damages of any character arising as a
      result of this License or out of the use or inability to use the
      Work (including but not limited to damages for loss of goodwill,
      work stoppage, computer failure or malfunction, or any and all
      other commercial damages or losses), even if such Contributor
      has been advised of the possibility of such damages.

   9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on Your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.

   END OF TERMS AND CONDITIONS

   APPENDIX: How to apply the Apache License to your work.

      To apply the Apache License to your work, attach the following
      boilerplate notice, with the fields enclosed by brackets "[]"
      replaced with your own identifying information. (Don't include
      the brackets!)  The text should be enclosed in the appropriate
      comment syntax for the file format. We also recommend that a
      file or class name and description of purpose be included on the
      same "printed page" as the copyright notice for easier
      identification within third-party archives.

   Copyright [yyyy] [name of copyright owner]

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.


================================================
FILE: ChangeLog
================================================
Changes in the "2010-01" release (2009-01-13 thru 2010-01-10):

* aggregate
  * Add support for min/max output.
	* Bug fix: avoid seg-fault when labels are not found.
	* Performance enhancements.

* fieldsplit
  * Bug fix: When running with -b, pad bucket numbers in output filenames
	  with zeros instead of spaces.
	* Rewritten in C for improved performance.
	* NOTE: This now depends on PCRE (dev package with library and header) in
	  order to be fully backward-compatible.

* filterkeys
  * New: a tool for filtering data streams using an external list of field
	  values to either keep or discard.

* mergekeys
  * Remove in-order requirement for auto-detecting keys.

* pivot
  * Bug fix: Do not reference invalid dbfr_t in pivot's output phase.

* Global
  * Distribution filename changed from "crush_<release>.tar.gz" to
	  "crush-tools_<release>.tar.gz".
  * Better error-checking for memory allocation.
	* General code cleanup.

* translate_field
	* Add a -k option for keeping the header row intact.
  * Add missing documentation for the -F option.


Changes in the "2009-01" release (2008-10-05 thru 2009-01-13):

* Field-label support: anywhere that you could use a field index as a command-
  line argument, there is now the option to use that field's label from
	the first line instead.

* Generate and install man pages.

* fieldsplit:  Add a "-b/--buckets" option, which limits the number of ouptut
  files which may be produced, while guaranteeing that field values are
  grouped together.  Performance enhancements.

* aggregate & aggregate2: -l/--labels and -L/--auto-labels options to
	control the headers for aggregated output fields.

* mergekeys: -D/--default option to specify the value to put into a
  mergeable field when there is no match in an outer join.

* Support stdin as a trailing filename option specified as "-" in several apps.

* translate_field: -x option to specify a substitution regular
  expression instead of a hard-coded mapping.


Changes in the "2008-10" release (2008-07-15 thru 2008-10-04):

* Make sure m4 is available at configure-time.  Previously it was assumed that
  the install host had m4 installed, but then the Perl scripts would fail to
  build.

* Check for presence of non-standard Perl modules, and only build scripts with
  those dependencies if the modules are installed.

* Allow escape sequences to be specified as delimiter arguments in utilities
  written in Perl.

* Add a "contrib" directory for non-core utilities, etc.

* Add options to mergekeys to allow user-specified key fields as an alternative
  to auto-detection of keys.  This currently does NOT remove the requirement
  that both files have a header line.

* Prepend all error messages with the name of the executable.

* Improve testing, and include test files in the distribution package.

* Bug-fix in find_not_processed - printed file names were not space-separated
  when -p option was specified.

* Avoid Perl warnings in csvformat when there is no linebreak at EOF, and fix
  commandline option specifications to avoid ambiguity.

* Make cutfield correctly handle empty fields.  It previously failed to output
  fields which were empty in the input.

* Fix a bug in reorder which causes a seg-fault when large ranges are 
  specified in the -f option.

* Bug fix in aggregate2 - print the header correctly line when the last field
  is one of the keys.  This bug was introducing a line break in the header line.

* Bug fix in aggregate2 - handle empty key fields correctly.

* Standardize and centralize the version reported by the applications.

* Add --Header option to dbstream to print the sql header fields if specified.


================================================
FILE: HACKING
================================================
-- Compilation --

To build CRUSH from a repository checkout...

1) install cgener (http://code.google.com/p/cgener/) at /usr/local/bin
2) ./bootstrap
3) ./configure && make
4) "make install" if desired.

To build from a distribution tarball, only steps 3 and 4 are necessary.


-- Contributer License Agreement --

Contributers must sign a CLA which defines the terms by which Google (the
copyright holder of CRUSH) can use the contributions.  If you would like to
submit patches, please read and sign

  http://code.google.com/legal/individual-cla-v1.0.html

This just documents that the project has the right to include the code you
send us.


-- Coding Standards --

CRUSH uses the portion of the Google C++ coding standards which applies to C.
(ref: http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml)

C files can automatically get *most* of this formatting by issuing the following
command:

  indent -br -brf -brs -cdw -ce -cli2 -i2 -l80 -lp -npcs -nprs -npsl -nut \
         -saf -sai -saw -ts2 <filename.c>

If you use this, it should only be done on new source files.  When modifying
existing files, maintain consistency with the surrounding code.


-- Source Repository --

Log messages in follow the convention used by the Subversion project.  See
http://subversion.tigris.org/hacking.html#log-messages


-- Release Schedule --

In order to avoid the tempation to cut a release after each feature or bug fix
is added to a single application, CRUSH will be released on a strictly
time-based schedule.  A release will be created every 3 months.  Whatever
features or fixes have been completed at that time will be included in the
new release.



================================================
FILE: INSTALL
================================================
Installation Instructions
*************************

Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
2006, 2007 Free Software Foundation, Inc.

This file is free documentation; the Free Software Foundation gives
unlimited permission to copy, distribute and modify it.

Basic Installation
==================

Briefly, the shell commands `./configure; make; make install' should
configure, build, and install this package.  The following
more-detailed instructions are generic; see the `README' file for
instructions specific to this package.

   The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation.  It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions.  Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, and a
file `config.log' containing compiler output (useful mainly for
debugging `configure').

   It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
the results of its tests to speed up reconfiguring.  Caching is
disabled by default to prevent problems with accidental use of stale
cache files.

   If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release.  If you are using the cache, and at
some point `config.cache' contains results you don't want to keep, you
may remove or edit it.

   The file `configure.ac' (or `configure.in') is used to create
`configure' by a program called `autoconf'.  You need `configure.ac' if
you want to change it or regenerate `configure' using a newer version
of `autoconf'.

The simplest way to compile this package is:

  1. `cd' to the directory containing the package's source code and type
     `./configure' to configure the package for your system.

     Running `configure' might take a while.  While running, it prints
     some messages telling which features it is checking for.

  2. Type `make' to compile the package.

  3. Optionally, type `make check' to run any self-tests that come with
     the package.

  4. Type `make install' to install the programs and any data files and
     documentation.

  5. You can remove the program binaries and object files from the
     source code directory by typing `make clean'.  To also remove the
     files that `configure' created (so you can compile the package for
     a different kind of computer), type `make distclean'.  There is
     also a `make maintainer-clean' target, but that is intended mainly
     for the package's developers.  If you use it, you may have to get
     all sorts of other programs in order to regenerate files that came
     with the distribution.

  6. Often, you can also type `make uninstall' to remove the installed
     files again.

Compilers and Options
=====================

Some systems require unusual options for compilation or linking that the
`configure' script does not know about.  Run `./configure --help' for
details on some of the pertinent environment variables.

   You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment.  Here
is an example:

     ./configure CC=c99 CFLAGS=-g LIBS=-lposix

   *Note Defining Variables::, for more details.

Compiling For Multiple Architectures
====================================

You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory.  To do this, you can use GNU `make'.  `cd' to the
directory where you want the object files and executables to go and run
the `configure' script.  `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.

   With a non-GNU `make', it is safer to compile the package for one
architecture at a time in the source code directory.  After you have
installed the package for one architecture, use `make distclean' before
reconfiguring for another architecture.

Installation Names
==================

By default, `make install' installs the package's commands under
`/usr/local/bin', include files under `/usr/local/include', etc.  You
can specify an installation prefix other than `/usr/local' by giving
`configure' the option `--prefix=PREFIX'.

   You can specify separate installation prefixes for
architecture-specific files and architecture-independent files.  If you
pass the option `--exec-prefix=PREFIX' to `configure', the package uses
PREFIX as the prefix for installing programs and libraries.
Documentation and other data files still use the regular prefix.

   In addition, if you use an unusual directory layout you can give
options like `--bindir=DIR' to specify different values for particular
kinds of files.  Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.

   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' cannot figure out automatically,
but needs to determine by the type of machine the package will run on.
Usually, assuming the package is built to be run on the _same_
architectures, `configure' can figure that out, but if it prints a
message saying it cannot guess the machine type, give it the
`--build=TYPE' option.  TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:

     CPU-COMPANY-SYSTEM

where SYSTEM can have one of these forms:

     OS KERNEL-OS

   See the file `config.sub' for the possible values of each field.  If
`config.sub' isn't included in this package, then this package doesn't
need to know the machine type.

   If you are _building_ compiler tools for cross-compiling, you should
use the option `--target=TYPE' to select the type of system they will
produce code for.

   If you want to _use_ a cross compiler, that generates code for a
platform different from the build platform, you should specify the
"host" platform (i.e., that on which the generated programs will
eventually be run) with `--host=TYPE'.

Sharing Defaults
================

If you want to set default values for `configure' scripts to share, you
can create a site shell script called `config.site' that gives default
values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists.  Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.

Defining Variables
==================

Variables not defined in a site shell script can be set in the
environment passed to `configure'.  However, some packages may run
configure again during the build, and the customized values of these
variables may be lost.  In order to avoid this problem, you should set
them in the `configure' command line, using `VAR=value'.  For example:

     ./configure CC=/usr/local2/bin/gcc

causes the specified `gcc' to be used as the C compiler (unless it is
overridden in the site shell script).

Unfortunately, this technique does not work for `CONFIG_SHELL' due to
an Autoconf bug.  Until the bug is fixed you can use this workaround:

     CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash

`configure' Invocation
======================

`configure' recognizes the following options to control how it operates.

`--help'
`-h'
     Print a summary of the options to `configure', and exit.

`--version'
`-V'
     Print the version of Autoconf used to generate the `configure'
     script, and exit.

`--cache-file=FILE'
     Enable the cache: use and save the results of the tests in FILE,
     traditionally `config.cache'.  FILE defaults to `/dev/null' to
     disable caching.

`--config-cache'
`-C'
     Alias for `--cache-file=config.cache'.

`--quiet'
`--silent'
`-q'
     Do not print messages saying which checks are being made.  To
     suppress all normal output, redirect it to `/dev/null' (any error
     messages will still be shown).

`--srcdir=DIR'
     Look for the package's source code in directory DIR.  Usually
     `configure' can determine that directory automatically.

`configure' also accepts some other, not widely useful, options.  Run
`configure --help' for more details.



================================================
FILE: Makefile.am
================================================

AUX_DIST = $(ac_aux_dir)/config.guess \
					 $(ac_aux_dir)/config.sub \
					 $(ac_aux_dir)/depcomp \
					 $(ac_aux_dir)/install-sh \
					 $(ac_aux_dir)/ltmain.sh \
					 $(ac_aux_dir)/missing

EXTRA_DIST = COPYING cgener

# make sure the AUX files get included in the distribution package
dist-hook:
	(cd $(distdir) && if ! test -d $(ac_aux_dir); then mkdir $(ac_aux_dir); fi)
	for file in $(AUX_DIST); do \
		cp $$file $(distdir)/$$file; \
	done

SUBDIRS = src contrib
PERL = @PERL@

libtool: $(LIBTOOL_DEPS)
	$(SHELL) ./config.status --recheck


================================================
FILE: README
================================================
CRUSH is a free, open-source collection of Custom Reporting Utilities for SHell.

Home page: http://code.google.com/p/crush-tools/

See COPYING for copyright information.

See INSTALL for installation instructions.

CRUSH has been tested and is believed to work on

  Linux (32- and 64-bit)
  Cygwin
  Mac OSX

Please contact crush-tools@googlegroups.com to discuss questions or problems
which may arise.


================================================
FILE: TODO
================================================
$LastChangedDate$
$Author$

./bootstrap:

  Only certain versions of libtoolize require adding file content to aclocal.m4.
  v 2.2.2 requires it (tested on cygwin).  v. 1.5.24 does not (tested on
  linux), and v. 1.5.27a does not (tested on cygwin).

  Need to figure out a) if the "cat >> aclocal.m4" can be avoided altogether;
  and b) if not, exactly which versions of libtoolize need it.


* "make dist" is broken when run from directories containing spaces in the
  path.


* These utilities need tests:

  src/buffer/
  src/dates_in_range/
  src/deltadays/
  src/findfiles/
  src/range/
  src/tochar/


* 2008-12-02: malformatted man page for convdate.



================================================
FILE: acinclude.m4
================================================

# check to see if a Perl module is installed, and fail if it is not
AC_DEFUN([CRUSH_REQUIRE_PERL_MODULE],[dnl
  AC_MSG_CHECKING([for perl module $1])
  $PERL -M$1 -e exit >/dev/null 2>&1
  if test $? -ne 0; then
    AC_MSG_RESULT([no])
    AC_MSG_ERROR([you should fire up "$PERL -MCPAN -e 'install $1'", and then re-run configure])
  else
    AC_MSG_RESULT([yes])
  fi
])

# check to see if a Perl module is installed and set a variable and
# conditional if it is
AC_DEFUN([CRUSH_CHECK_PERL_MODULE],[dnl
  AC_MSG_CHECKING([for perl module $1])
  $PERL -M$1 -e exit >/dev/null 2>&1
  if test $? -ne 0; then
    AC_MSG_RESULT([no])
    AC_SUBST($2, "no")
  else
    AC_MSG_RESULT([yes])
    AC_SUBST($2, "yes")
  fi
  AM_CONDITIONAL([COND_$2], [test x$$2 = xyes])
])



================================================
FILE: bootstrap
================================================
#!/bin/sh

OS=`uname`

set -x
aclocal
LIBTOOL="libtoolize"

if [[ ${OS} = 'Darwin' ]]; then
  LIBTOOL="glibtoolize"
fi
${LIBTOOL} --force --copy

# cat /usr/share/aclocal/libtool.m4 \
#     /usr/share/aclocal/ltoptions.m4 \
#     /usr/share/aclocal/ltversion.m4 \
#     /usr/share/aclocal/ltsugar.m4 \
#     /usr/share/aclocal/lt~obsolete.m4 \
#   >> aclocal.m4

autoheader
automake --foreign --add-missing --copy
autoconf


================================================
FILE: build/config.guess
================================================
#! /bin/sh
# Attempt to guess a canonical system name.
#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
#   2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
#   Inc.

timestamp='2007-07-22'

# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
# 02110-1301, USA.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.


# Originally written by Per Bothner <per@bothner.com>.
# Please send patches to <config-patches@gnu.org>.  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 <config-patches@gnu.org>."

version="\
GNU config.guess ($timestamp)

Originally written by Per Bothner.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.

This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."

help="
Try \`$me --help' for more information."

# Parse command line
while test $# -gt 0 ; do
  case $1 in
    --time-stamp | --time* | -t )
       echo "$timestamp" ; exit ;;
    --version | -v )
       echo "$version" ; exit ;;
    --help | --h* | -h )
       echo "$usage"; exit ;;
    -- )     # Stop option processing
       shift; break ;;
    - )	# Use stdin as input.
       break ;;
    -* )
       echo "$me: invalid option $1$help" >&2
       exit 1 ;;
    * )
       break ;;
  esac
done

if test $# != 0; then
  echo "$me: too many arguments$help" >&2
  exit 1
fi

trap 'exit 1' 1 2 15

# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
# compiler to aid in system detection is discouraged as it requires
# temporary files to be created and, as you can see below, it is a
# headache to deal with in a portable fashion.

# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
# use `HOST_CC' if defined, but it is deprecated.

# Portable tmp directory creation inspired by the Autoconf team.

set_cc_for_build='
trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
: ${TMPDIR=/tmp} ;
 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
 { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
 { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
 { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
dummy=$tmp/dummy ;
tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
case $CC_FOR_BUILD,$HOST_CC,$CC in
 ,,)    echo "int x;" > $dummy.c ;
	for c in cc gcc c89 c99 ; do
	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
	     CC_FOR_BUILD="$c"; break ;
	  fi ;
	done ;
	if test x"$CC_FOR_BUILD" = x ; then
	  CC_FOR_BUILD=no_compiler_found ;
	fi
	;;
 ,,*)   CC_FOR_BUILD=$CC ;;
 ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
esac ; set_cc_for_build= ;'

# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 1994-08-24)
if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
	PATH=$PATH:/.attbin ; export PATH
fi

UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown

# Note: order is significant - the case branches are not exclusive.

case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
    *:NetBSD:*:*)
	# NetBSD (nbsd) targets should (where applicable) match one or
	# more of the 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 ;;
	    sh5el) machine=sh5le-unknown ;;
	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
	esac
	# The Operating System including object format, if it has switched
	# to ELF recently, or will in the future.
	case "${UNAME_MACHINE_ARCH}" in
	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
		eval $set_cc_for_build
		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
			| grep __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
	# Debian GNU/NetBSD machines have a different userland, and
	# thus, need a distinct triplet. However, they do not need
	# kernel version information, so it can be replaced with a
	# suitable tag, in the style of linux-gnu.
	case "${UNAME_VERSION}" in
	    Debian*)
		release='-gnu'
		;;
	    *)
		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
		;;
	esac
	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
	# contains redundant information, the shorter form:
	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
	echo "${machine}-${os}${release}"
	exit ;;
    *:OpenBSD:*:*)
	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
	exit ;;
    *:ekkoBSD:*:*)
	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
	exit ;;
    *:SolidBSD:*:*)
	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
	exit ;;
    macppc:MirBSD:*:*)
	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
	exit ;;
    *:MirBSD:*:*)
	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
	exit ;;
    alpha:OSF1:*:*)
	case $UNAME_RELEASE in
	*4.0)
		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
		;;
	*5.*)
	        UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
		;;
	esac
	# According to Compaq, /usr/sbin/psrinfo has been available on
	# OSF/1 and Tru64 systems produced since 1995.  I hope that
	# covers most systems running today.  This code pipes the CPU
	# types through head -n 1, so we only detect the type of CPU 0.
	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
	case "$ALPHA_CPU_TYPE" in
	    "EV4 (21064)")
		UNAME_MACHINE="alpha" ;;
	    "EV4.5 (21064)")
		UNAME_MACHINE="alpha" ;;
	    "LCA4 (21066/21068)")
		UNAME_MACHINE="alpha" ;;
	    "EV5 (21164)")
		UNAME_MACHINE="alphaev5" ;;
	    "EV5.6 (21164A)")
		UNAME_MACHINE="alphaev56" ;;
	    "EV5.6 (21164PC)")
		UNAME_MACHINE="alphapca56" ;;
	    "EV5.7 (21164PC)")
		UNAME_MACHINE="alphapca57" ;;
	    "EV6 (21264)")
		UNAME_MACHINE="alphaev6" ;;
	    "EV6.7 (21264A)")
		UNAME_MACHINE="alphaev67" ;;
	    "EV6.8CB (21264C)")
		UNAME_MACHINE="alphaev68" ;;
	    "EV6.8AL (21264B)")
		UNAME_MACHINE="alphaev68" ;;
	    "EV6.8CX (21264D)")
		UNAME_MACHINE="alphaev68" ;;
	    "EV6.9A (21264/EV69A)")
		UNAME_MACHINE="alphaev69" ;;
	    "EV7 (21364)")
		UNAME_MACHINE="alphaev7" ;;
	    "EV7.9 (21364A)")
		UNAME_MACHINE="alphaev79" ;;
	esac
	# A Pn.n version is a patched version.
	# A Vn.n version is a released version.
	# A Tn.n version is a released field test version.
	# A Xn.n version is an unreleased experimental baselevel.
	# 1.2 uses "1.2" for uname -r.
	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
	exit ;;
    Alpha\ *:Windows_NT*:*)
	# How do we know it's Interix rather than the generic POSIX subsystem?
	# Should we change UNAME_MACHINE based on the output of uname instead
	# of the specific Alpha model?
	echo alpha-pc-interix
	exit ;;
    21064:Windows_NT:50:3)
	echo alpha-dec-winnt3.5
	exit ;;
    Amiga*:UNIX_System_V:4.0:*)
	echo m68k-unknown-sysv4
	exit ;;
    *:[Aa]miga[Oo][Ss]:*:*)
	echo ${UNAME_MACHINE}-unknown-amigaos
	exit ;;
    *:[Mm]orph[Oo][Ss]:*:*)
	echo ${UNAME_MACHINE}-unknown-morphos
	exit ;;
    *:OS/390:*:*)
	echo i370-ibm-openedition
	exit ;;
    *:z/VM:*:*)
	echo s390-ibm-zvmoe
	exit ;;
    *:OS400:*:*)
        echo powerpc-ibm-os400
	exit ;;
    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
	echo arm-acorn-riscix${UNAME_RELEASE}
	exit ;;
    arm:riscos:*:*|arm:RISCOS:*:*)
	echo arm-unknown-riscos
	exit ;;
    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
	echo hppa1.1-hitachi-hiuxmpp
	exit ;;
    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
	if test "`(/bin/universe) 2>/dev/null`" = att ; then
		echo pyramid-pyramid-sysv3
	else
		echo pyramid-pyramid-bsd
	fi
	exit ;;
    NILE*:*:*:dcosx)
	echo pyramid-pyramid-svr4
	exit ;;
    DRS?6000:unix:4.0:6*)
	echo sparc-icl-nx6
	exit ;;
    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
	case `/usr/bin/uname -p` in
	    sparc) echo sparc-icl-nx7; exit ;;
	esac ;;
    sun4H:SunOS:5.*:*)
	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
	exit ;;
    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
	exit ;;
    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
	echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
	exit ;;
    sun4*:SunOS:6*:*)
	# According to config.sub, this is the proper way to canonicalize
	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
	# it's likely to be more like Solaris than SunOS4.
	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
	exit ;;
    sun4*:SunOS:*:*)
	case "`/usr/bin/arch -k`" in
	    Series*|S4*)
		UNAME_RELEASE=`uname -v`
		;;
	esac
	# Japanese Language versions have a version number like `4.1.3-JL'.
	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
	exit ;;
    sun3*:SunOS:*:*)
	echo m68k-sun-sunos${UNAME_RELEASE}
	exit ;;
    sun*:*:4.2BSD:*)
	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
	case "`/bin/arch`" in
	    sun3)
		echo m68k-sun-sunos${UNAME_RELEASE}
		;;
	    sun4)
		echo sparc-sun-sunos${UNAME_RELEASE}
		;;
	esac
	exit ;;
    aushp:SunOS:*:*)
	echo sparc-auspex-sunos${UNAME_RELEASE}
	exit ;;
    # The situation for MiNT is a little confusing.  The machine name
    # can be virtually everything (everything which is not
    # "atarist" or "atariste" at least should have a processor
    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
    # to the lowercase version "mint" (or "freemint").  Finally
    # the system name "TOS" denotes a system which is actually not
    # MiNT.  But MiNT is downward compatible to TOS, so this should
    # be no problem.
    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
        echo m68k-atari-mint${UNAME_RELEASE}
	exit ;;
    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
	echo m68k-atari-mint${UNAME_RELEASE}
        exit ;;
    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
        echo m68k-atari-mint${UNAME_RELEASE}
	exit ;;
    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
        echo m68k-milan-mint${UNAME_RELEASE}
        exit ;;
    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
        echo m68k-hades-mint${UNAME_RELEASE}
        exit ;;
    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
        echo m68k-unknown-mint${UNAME_RELEASE}
        exit ;;
    m68k:machten:*:*)
	echo m68k-apple-machten${UNAME_RELEASE}
	exit ;;
    powerpc:machten:*:*)
	echo powerpc-apple-machten${UNAME_RELEASE}
	exit ;;
    RISC*:Mach:*:*)
	echo mips-dec-mach_bsd4.3
	exit ;;
    RISC*:ULTRIX:*:*)
	echo mips-dec-ultrix${UNAME_RELEASE}
	exit ;;
    VAX*:ULTRIX*:*:*)
	echo vax-dec-ultrix${UNAME_RELEASE}
	exit ;;
    2020:CLIX:*:* | 2430:CLIX:*:*)
	echo clipper-intergraph-clix${UNAME_RELEASE}
	exit ;;
    mips:*:*:UMIPS | mips:*:*:RISCos)
	eval $set_cc_for_build
	sed 's/^	//' << EOF >$dummy.c
#ifdef __cplusplus
#include <stdio.h>  /* for printf() prototype */
	int main (int argc, char *argv[]) {
#else
	int main (argc, argv) int argc; char *argv[]; {
#endif
	#if defined (host_mips) && defined (MIPSEB)
	#if defined (SYSTYPE_SYSV)
	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
	#endif
	#if defined (SYSTYPE_SVR4)
	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
	#endif
	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
	#endif
	#endif
	  exit (-1);
	}
EOF
	$CC_FOR_BUILD -o $dummy $dummy.c &&
	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
	  SYSTEM_NAME=`$dummy $dummyarg` &&
	    { echo "$SYSTEM_NAME"; exit; }
	echo mips-mips-riscos${UNAME_RELEASE}
	exit ;;
    Motorola:PowerMAX_OS:*:*)
	echo powerpc-motorola-powermax
	exit ;;
    Motorola:*:4.3:PL8-*)
	echo powerpc-harris-powermax
	exit ;;
    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
	echo powerpc-harris-powermax
	exit ;;
    Night_Hawk:Power_UNIX:*:*)
	echo powerpc-harris-powerunix
	exit ;;
    m88k:CX/UX:7*:*)
	echo m88k-harris-cxux7
	exit ;;
    m88k:*:4*:R4*)
	echo m88k-motorola-sysv4
	exit ;;
    m88k:*:3*:R3*)
	echo m88k-motorola-sysv3
	exit ;;
    AViiON:dgux:*:*)
        # DG/UX returns AViiON for all architectures
        UNAME_PROCESSOR=`/usr/bin/uname -p`
	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
	then
	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
	       [ ${TARGET_BINARY_INTERFACE}x = x ]
	    then
		echo m88k-dg-dgux${UNAME_RELEASE}
	    else
		echo m88k-dg-dguxbcs${UNAME_RELEASE}
	    fi
	else
	    echo i586-dg-dgux${UNAME_RELEASE}
	fi
 	exit ;;
    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
	echo m88k-dolphin-sysv3
	exit ;;
    M88*:*:R3*:*)
	# Delta 88k system running SVR3
	echo m88k-motorola-sysv3
	exit ;;
    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
	echo m88k-tektronix-sysv3
	exit ;;
    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
	echo m68k-tektronix-bsd
	exit ;;
    *:IRIX*:*:*)
	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
	exit ;;
    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
    i*86:AIX:*:*)
	echo i386-ibm-aix
	exit ;;
    ia64:AIX:*:*)
	if [ -x /usr/bin/oslevel ] ; then
		IBM_REV=`/usr/bin/oslevel`
	else
		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
	fi
	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
	exit ;;
    *:AIX:2:3)
	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
		eval $set_cc_for_build
		sed 's/^		//' << EOF >$dummy.c
		#include <sys/systemcfg.h>

		main()
			{
			if (!__power_pc())
				exit(1);
			puts("powerpc-ibm-aix3.2.5");
			exit(0);
			}
EOF
		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
		then
			echo "$SYSTEM_NAME"
		else
			echo rs6000-ibm-aix3.2.5
		fi
	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
		echo rs6000-ibm-aix3.2.4
	else
		echo rs6000-ibm-aix3.2
	fi
	exit ;;
    *:AIX:*:[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 ;;
    *:AIX:*:*)
	echo rs6000-ibm-aix
	exit ;;
    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
	echo romp-ibm-bsd4.4
	exit ;;
    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
	exit ;;                             # report: romp-ibm BSD 4.3
    *:BOSX:*:*)
	echo rs6000-bull-bosx
	exit ;;
    DPX/2?00:B.O.S.:*:*)
	echo m68k-bull-sysv3
	exit ;;
    9000/[34]??:4.3bsd:1.*:*)
	echo m68k-hp-bsd
	exit ;;
    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
	echo m68k-hp-bsd4.4
	exit ;;
    9000/[34678]??:HP-UX:*:*)
	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
	case "${UNAME_MACHINE}" in
	    9000/31? )            HP_ARCH=m68000 ;;
	    9000/[34]?? )         HP_ARCH=m68k ;;
	    9000/[678][0-9][0-9])
		if [ -x /usr/bin/getconf ]; then
		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
                    case "${sc_cpu_version}" in
                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
                      532)                      # CPU_PA_RISC2_0
                        case "${sc_kernel_bits}" in
                          32) HP_ARCH="hppa2.0n" ;;
                          64) HP_ARCH="hppa2.0w" ;;
			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
                        esac ;;
                    esac
		fi
		if [ "${HP_ARCH}" = "" ]; then
		    eval $set_cc_for_build
		    sed 's/^              //' << EOF >$dummy.c

              #define _HPUX_SOURCE
              #include <stdlib.h>
              #include <unistd.h>

              int main ()
              {
              #if defined(_SC_KERNEL_BITS)
                  long bits = sysconf(_SC_KERNEL_BITS);
              #endif
                  long cpu  = sysconf (_SC_CPU_VERSION);

                  switch (cpu)
              	{
              	case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
              	case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
              	case CPU_PA_RISC2_0:
              #if defined(_SC_KERNEL_BITS)
              	    switch (bits)
              		{
              		case 64: puts ("hppa2.0w"); break;
              		case 32: puts ("hppa2.0n"); break;
              		default: puts ("hppa2.0"); break;
              		} break;
              #else  /* !defined(_SC_KERNEL_BITS) */
              	    puts ("hppa2.0"); break;
              #endif
              	default: puts ("hppa1.0"); break;
              	}
                  exit (0);
              }
EOF
		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
		    test -z "$HP_ARCH" && HP_ARCH=hppa
		fi ;;
	esac
	if [ ${HP_ARCH} = "hppa2.0w" ]
	then
	    eval $set_cc_for_build

	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
	    # generating 64-bit code.  GNU and HP use different nomenclature:
	    #
	    # $ CC_FOR_BUILD=cc ./config.guess
	    # => hppa2.0w-hp-hpux11.23
	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
	    # => hppa64-hp-hpux11.23

	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
		grep __LP64__ >/dev/null
	    then
		HP_ARCH="hppa2.0w"
	    else
		HP_ARCH="hppa64"
	    fi
	fi
	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
	exit ;;
    ia64:HP-UX:*:*)
	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
	echo ia64-hp-hpux${HPUX_REV}
	exit ;;
    3050*:HI-UX:*:*)
	eval $set_cc_for_build
	sed 's/^	//' << EOF >$dummy.c
	#include <unistd.h>
	int
	main ()
	{
	  long cpu = sysconf (_SC_CPU_VERSION);
	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
	     results, however.  */
	  if (CPU_IS_PA_RISC (cpu))
	    {
	      switch (cpu)
		{
		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
		  default: puts ("hppa-hitachi-hiuxwe2"); break;
		}
	    }
	  else if (CPU_IS_HP_MC68K (cpu))
	    puts ("m68k-hitachi-hiuxwe2");
	  else puts ("unknown-hitachi-hiuxwe2");
	  exit (0);
	}
EOF
	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
		{ echo "$SYSTEM_NAME"; exit; }
	echo unknown-hitachi-hiuxwe2
	exit ;;
    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
	echo hppa1.1-hp-bsd
	exit ;;
    9000/8??:4.3bsd:*:*)
	echo hppa1.0-hp-bsd
	exit ;;
    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
	echo hppa1.0-hp-mpeix
	exit ;;
    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
	echo hppa1.1-hp-osf
	exit ;;
    hp8??:OSF1:*:*)
	echo hppa1.0-hp-osf
	exit ;;
    i*86:OSF1:*:*)
	if [ -x /usr/sbin/sysversion ] ; then
	    echo ${UNAME_MACHINE}-unknown-osf1mk
	else
	    echo ${UNAME_MACHINE}-unknown-osf1
	fi
	exit ;;
    parisc*:Lites*:*:*)
	echo hppa1.1-hp-lites
	exit ;;
    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
	echo c1-convex-bsd
        exit ;;
    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
	if getsysinfo -f scalar_acc
	then echo c32-convex-bsd
	else echo c2-convex-bsd
	fi
        exit ;;
    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
	echo c34-convex-bsd
        exit ;;
    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
	echo c38-convex-bsd
        exit ;;
    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
	echo c4-convex-bsd
        exit ;;
    CRAY*Y-MP:*:*:*)
	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
	exit ;;
    CRAY*[A-Z]90:*:*:*)
	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
	      -e 's/\.[^.]*$/.X/'
	exit ;;
    CRAY*TS:*:*:*)
	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
	exit ;;
    CRAY*T3E:*:*:*)
	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
	exit ;;
    CRAY*SV1:*:*:*)
	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
	exit ;;
    *:UNICOS/mp:*:*)
	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
	exit ;;
    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
        exit ;;
    5000:UNIX_System_V:4.*:*)
        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
	exit ;;
    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
	exit ;;
    sparc*:BSD/OS:*:*)
	echo sparc-unknown-bsdi${UNAME_RELEASE}
	exit ;;
    *:BSD/OS:*:*)
	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
	exit ;;
    *:FreeBSD:*:*)
	case ${UNAME_MACHINE} in
	    pc98)
		echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
	    amd64)
		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
	    *)
		echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
	esac
	exit ;;
    i*:CYGWIN*:*)
	echo ${UNAME_MACHINE}-pc-cygwin
	exit ;;
    *:MINGW*:*)
	echo ${UNAME_MACHINE}-pc-mingw32
	exit ;;
    i*:windows32*:*)
    	# uname -m includes "-pc" on this system.
    	echo ${UNAME_MACHINE}-mingw32
	exit ;;
    i*:PW*:*)
	echo ${UNAME_MACHINE}-pc-pw32
	exit ;;
    *:Interix*:[3456]*)
    	case ${UNAME_MACHINE} in
	    x86)
		echo i586-pc-interix${UNAME_RELEASE}
		exit ;;
	    EM64T | authenticamd)
		echo x86_64-unknown-interix${UNAME_RELEASE}
		exit ;;
	esac ;;
    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
	echo i${UNAME_MACHINE}-pc-mks
	exit ;;
    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
	# How do we know it's Interix rather than the generic POSIX subsystem?
	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
	# UNAME_MACHINE based on the output of uname instead of i386?
	echo i586-pc-interix
	exit ;;
    i*:UWIN*:*)
	echo ${UNAME_MACHINE}-pc-uwin
	exit ;;
    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
	echo x86_64-unknown-cygwin
	exit ;;
    p*:CYGWIN*:*)
	echo powerpcle-unknown-cygwin
	exit ;;
    prep*:SunOS:5.*:*)
	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
	exit ;;
    *:GNU:*:*)
	# the GNU system
	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
	exit ;;
    *:GNU/*:*:*)
	# other systems with GNU libc and userland
	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
	exit ;;
    i*86:Minix:*:*)
	echo ${UNAME_MACHINE}-pc-minix
	exit ;;
    arm*:Linux:*:*)
	echo ${UNAME_MACHINE}-unknown-linux-gnu
	exit ;;
    avr32*:Linux:*:*)
	echo ${UNAME_MACHINE}-unknown-linux-gnu
	exit ;;
    cris:Linux:*:*)
	echo cris-axis-linux-gnu
	exit ;;
    crisv32:Linux:*:*)
	echo crisv32-axis-linux-gnu
	exit ;;
    frv:Linux:*:*)
    	echo frv-unknown-linux-gnu
	exit ;;
    ia64:Linux:*:*)
	echo ${UNAME_MACHINE}-unknown-linux-gnu
	exit ;;
    m32r*:Linux:*:*)
	echo ${UNAME_MACHINE}-unknown-linux-gnu
	exit ;;
    m68*:Linux:*:*)
	echo ${UNAME_MACHINE}-unknown-linux-gnu
	exit ;;
    mips:Linux:*:*)
	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 | sed -n '
	    /^CPU/{
		s: ::g
		p
	    }'`"
	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
	;;
    mips64:Linux:*:*)
	eval $set_cc_for_build
	sed 's/^	//' << EOF >$dummy.c
	#undef CPU
	#undef mips64
	#undef mips64el
	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
	CPU=mips64el
	#else
	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
	CPU=mips64
	#else
	CPU=
	#endif
	#endif
EOF
	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
	    /^CPU/{
		s: ::g
		p
	    }'`"
	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
	;;
    or32:Linux:*:*)
	echo or32-unknown-linux-gnu
	exit ;;
    ppc:Linux:*:*)
	echo powerpc-unknown-linux-gnu
	exit ;;
    ppc64:Linux:*:*)
	echo powerpc64-unknown-linux-gnu
	exit ;;
    alpha:Linux:*:*)
	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
	  EV5)   UNAME_MACHINE=alphaev5 ;;
	  EV56)  UNAME_MACHINE=alphaev56 ;;
	  PCA56) UNAME_MACHINE=alphapca56 ;;
	  PCA57) UNAME_MACHINE=alphapca56 ;;
	  EV6)   UNAME_MACHINE=alphaev6 ;;
	  EV67)  UNAME_MACHINE=alphaev67 ;;
	  EV68*) UNAME_MACHINE=alphaev68 ;;
        esac
	objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
	exit ;;
    parisc:Linux:*:* | hppa:Linux:*:*)
	# Look for CPU level
	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
	  *)    echo hppa-unknown-linux-gnu ;;
	esac
	exit ;;
    parisc64:Linux:*:* | hppa64:Linux:*:*)
	echo hppa64-unknown-linux-gnu
	exit ;;
    s390:Linux:*:* | s390x:Linux:*:*)
	echo ${UNAME_MACHINE}-ibm-linux
	exit ;;
    sh64*:Linux:*:*)
    	echo ${UNAME_MACHINE}-unknown-linux-gnu
	exit ;;
    sh*:Linux:*:*)
	echo ${UNAME_MACHINE}-unknown-linux-gnu
	exit ;;
    sparc:Linux:*:* | sparc64:Linux:*:*)
	echo ${UNAME_MACHINE}-unknown-linux-gnu
	exit ;;
    vax:Linux:*:*)
	echo ${UNAME_MACHINE}-dec-linux-gnu
	exit ;;
    x86_64:Linux:*:*)
	echo x86_64-unknown-linux-gnu
	exit ;;
    xtensa:Linux:*:*)
    	echo xtensa-unknown-linux-gnu
	exit ;;
    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 ;;
	  coff-i386)
		echo "${UNAME_MACHINE}-pc-linux-gnucoff"
		exit ;;
	  "")
		# 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 ;;
	esac
	# Determine whether the default compiler is a.out or elf
	eval $set_cc_for_build
	sed 's/^	//' << EOF >$dummy.c
	#include <features.h>
	#ifdef __ELF__
	# ifdef __GLIBC__
	#  if __GLIBC__ >= 2
	LIBC=gnu
	#  else
	LIBC=gnulibc1
	#  endif
	# else
	LIBC=gnulibc1
	# endif
	#else
	#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
	LIBC=gnu
	#else
	LIBC=gnuaout
	#endif
	#endif
	#ifdef __dietlibc__
	LIBC=dietlibc
	#endif
EOF
	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
	    /^LIBC/{
		s: ::g
		p
	    }'`"
	test x"${LIBC}" != x && {
		echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
		exit
	}
	test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
	;;
    i*86:DYNIX/ptx:4*:*)
	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
	# earlier versions are messed up and put the nodename in both
	# sysname and nodename.
	echo i386-sequent-sysv4
	exit ;;
    i*86:UNIX_SV:4.2MP:2.*)
        # Unixware is an offshoot of SVR4, but it has its own version
        # number series starting with 2...
        # I am not positive that other SVR4 systems won't match this,
	# I just have to hope.  -- rms.
        # Use sysv4.2uw... so that sysv4* matches it.
	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
	exit ;;
    i*86:OS/2:*:*)
	# If we were able to find `uname', then EMX Unix compatibility
	# is probably installed.
	echo ${UNAME_MACHINE}-pc-os2-emx
	exit ;;
    i*86:XTS-300:*:STOP)
	echo ${UNAME_MACHINE}-unknown-stop
	exit ;;
    i*86:atheos:*:*)
	echo ${UNAME_MACHINE}-unknown-atheos
	exit ;;
    i*86:syllable:*:*)
	echo ${UNAME_MACHINE}-pc-syllable
	exit ;;
    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
	echo i386-unknown-lynxos${UNAME_RELEASE}
	exit ;;
    i*86:*DOS:*:*)
	echo ${UNAME_MACHINE}-pc-msdosdjgpp
	exit ;;
    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
	else
		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
	fi
	exit ;;
    i*86:*:5:[678]*)
    	# UnixWare 7.x, OpenUNIX and OpenServer 6.
	case `/bin/uname -X | grep "^Machine"` in
	    *486*)	     UNAME_MACHINE=i486 ;;
	    *Pentium)	     UNAME_MACHINE=i586 ;;
	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
	esac
	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
	exit ;;
    i*86:*:3.2:*)
	if test -f /usr/options/cb.name; then
		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
	elif /bin/uname -X 2>/dev/null >/dev/null ; then
		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
			&& UNAME_MACHINE=i586
		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
			&& UNAME_MACHINE=i686
		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
			&& UNAME_MACHINE=i686
		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
	else
		echo ${UNAME_MACHINE}-pc-sysv32
	fi
	exit ;;
    pc:*:*:*)
	# Left here for compatibility:
        # uname -m prints for DJGPP always 'pc', but it prints nothing about
        # the processor, so we play safe by assuming i386.
	echo i386-pc-msdosdjgpp
        exit ;;
    Intel:Mach:3*:*)
	echo i386-pc-mach3
	exit ;;
    paragon:*:*:*)
	echo i860-intel-osf1
	exit ;;
    i860:*:4.*:*) # i860-SVR4
	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
	else # Add other i860-SVR4 vendors below as they are discovered.
	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
	fi
	exit ;;
    mini*:CTIX:SYS*5:*)
	# "miniframe"
	echo m68010-convergent-sysv
	exit ;;
    mc68k:UNIX:SYSTEM5:3.51m)
	echo m68k-convergent-sysv
	exit ;;
    M680?0:D-NIX:5.3:*)
	echo m68k-diab-dnix
	exit ;;
    M68*:*:R3V[5678]*:*)
	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
    3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
	OS_REL=''
	test -r /etc/.relid \
	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
          && { echo i486-ncr-sysv4; exit; } ;;
    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
	echo m68k-unknown-lynxos${UNAME_RELEASE}
	exit ;;
    mc68030:UNIX_System_V:4.*:*)
	echo m68k-atari-sysv4
	exit ;;
    TSUNAMI:LynxOS:2.*:*)
	echo sparc-unknown-lynxos${UNAME_RELEASE}
	exit ;;
    rs6000:LynxOS:2.*:*)
	echo rs6000-unknown-lynxos${UNAME_RELEASE}
	exit ;;
    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
	echo powerpc-unknown-lynxos${UNAME_RELEASE}
	exit ;;
    SM[BE]S:UNIX_SV:*:*)
	echo mips-dde-sysv${UNAME_RELEASE}
	exit ;;
    RM*:ReliantUNIX-*:*:*)
	echo mips-sni-sysv4
	exit ;;
    RM*:SINIX-*:*:*)
	echo mips-sni-sysv4
	exit ;;
    *:SINIX-*:*:*)
	if uname -p 2>/dev/null >/dev/null ; then
		UNAME_MACHINE=`(uname -p) 2>/dev/null`
		echo ${UNAME_MACHINE}-sni-sysv4
	else
		echo ns32k-sni-sysv
	fi
	exit ;;
    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
                      # says <Richard.M.Bartel@ccMail.Census.GOV>
        echo i586-unisys-sysv4
        exit ;;
    *:UNIX_System_V:4*:FTX*)
	# From Gerald Hewes <hewes@openmarket.com>.
	# How about differentiating between stratus architectures? -djm
	echo hppa1.1-stratus-sysv4
	exit ;;
    *:*:*:FTX*)
	# From seanf@swdc.stratus.com.
	echo i860-stratus-sysv4
	exit ;;
    i*86:VOS:*:*)
	# From Paul.Green@stratus.com.
	echo ${UNAME_MACHINE}-stratus-vos
	exit ;;
    *:VOS:*:*)
	# From Paul.Green@stratus.com.
	echo hppa1.1-stratus-vos
	exit ;;
    mc68*:A/UX:*:*)
	echo m68k-apple-aux${UNAME_RELEASE}
	exit ;;
    news*:NEWS-OS:6*:*)
	echo mips-sony-newsos6
	exit ;;
    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
	if [ -d /usr/nec ]; then
	        echo mips-nec-sysv${UNAME_RELEASE}
	else
	        echo mips-unknown-sysv${UNAME_RELEASE}
	fi
        exit ;;
    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
	echo powerpc-be-beos
	exit ;;
    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
	echo powerpc-apple-beos
	exit ;;
    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
	echo i586-pc-beos
	exit ;;
    SX-4:SUPER-UX:*:*)
	echo sx4-nec-superux${UNAME_RELEASE}
	exit ;;
    SX-5:SUPER-UX:*:*)
	echo sx5-nec-superux${UNAME_RELEASE}
	exit ;;
    SX-6:SUPER-UX:*:*)
	echo sx6-nec-superux${UNAME_RELEASE}
	exit ;;
    SX-7:SUPER-UX:*:*)
	echo sx7-nec-superux${UNAME_RELEASE}
	exit ;;
    SX-8:SUPER-UX:*:*)
	echo sx8-nec-superux${UNAME_RELEASE}
	exit ;;
    SX-8R:SUPER-UX:*:*)
	echo sx8r-nec-superux${UNAME_RELEASE}
	exit ;;
    Power*:Rhapsody:*:*)
	echo powerpc-apple-rhapsody${UNAME_RELEASE}
	exit ;;
    *:Rhapsody:*:*)
	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
	exit ;;
    *:Darwin:*:*)
	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
	case $UNAME_PROCESSOR in
	    unknown) UNAME_PROCESSOR=powerpc ;;
	esac
	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
	exit ;;
    *:procnto*:*:* | *:QNX:[0123456789]*:*)
	UNAME_PROCESSOR=`uname -p`
	if test "$UNAME_PROCESSOR" = "x86"; then
		UNAME_PROCESSOR=i386
		UNAME_MACHINE=pc
	fi
	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
	exit ;;
    *:QNX:*:4*)
	echo i386-pc-qnx
	exit ;;
    NSE-?:NONSTOP_KERNEL:*:*)
	echo nse-tandem-nsk${UNAME_RELEASE}
	exit ;;
    NSR-?:NONSTOP_KERNEL:*:*)
	echo nsr-tandem-nsk${UNAME_RELEASE}
	exit ;;
    *:NonStop-UX:*:*)
	echo mips-compaq-nonstopux
	exit ;;
    BS2000:POSIX*:*:*)
	echo bs2000-siemens-sysv
	exit ;;
    DS/*:UNIX_System_V:*:*)
	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
	exit ;;
    *:Plan9:*:*)
	# "uname -m" is not consistent, so use $cputype instead. 386
	# is converted to i386 for consistency with other x86
	# operating systems.
	if test "$cputype" = "386"; then
	    UNAME_MACHINE=i386
	else
	    UNAME_MACHINE="$cputype"
	fi
	echo ${UNAME_MACHINE}-unknown-plan9
	exit ;;
    *:TOPS-10:*:*)
	echo pdp10-unknown-tops10
	exit ;;
    *:TENEX:*:*)
	echo pdp10-unknown-tenex
	exit ;;
    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
	echo pdp10-dec-tops20
	exit ;;
    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
	echo pdp10-xkl-tops20
	exit ;;
    *:TOPS-20:*:*)
	echo pdp10-unknown-tops20
	exit ;;
    *:ITS:*:*)
	echo pdp10-unknown-its
	exit ;;
    SEI:*:*:SEIUX)
        echo mips-sei-seiux${UNAME_RELEASE}
	exit ;;
    *:DragonFly:*:*)
	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
	exit ;;
    *:*VMS:*:*)
    	UNAME_MACHINE=`(uname -p) 2>/dev/null`
	case "${UNAME_MACHINE}" in
	    A*) echo alpha-dec-vms ; exit ;;
	    I*) echo ia64-dec-vms ; exit ;;
	    V*) echo vax-dec-vms ; exit ;;
	esac ;;
    *:XENIX:*:SysV)
	echo i386-pc-xenix
	exit ;;
    i*86:skyos:*:*)
	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
	exit ;;
    i*86:rdos:*:*)
	echo ${UNAME_MACHINE}-pc-rdos
	exit ;;
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 <<EOF
#ifdef _SEQUENT_
# include <sys/types.h>
# include <sys/utsname.h>
#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 <sys/param.h>
  printf ("m68k-sony-newsos%s\n",
#ifdef NEWSOS4
          "4"
#else
	  ""
#endif
         ); exit (0);
#endif
#endif

#if defined (__arm) && defined (__acorn) && defined (__unix)
  printf ("arm-acorn-riscix\n"); exit (0);
#endif

#if defined (hp300) && !defined (hpux)
  printf ("m68k-hp-bsd\n"); exit (0);
#endif

#if defined (NeXT)
#if !defined (__ARCHITECTURE__)
#define __ARCHITECTURE__ "m68k"
#endif
  int version;
  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
  if (version < 4)
    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
  else
    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
  exit (0);
#endif

#if defined (MULTIMAX) || defined (n16)
#if defined (UMAXV)
  printf ("ns32k-encore-sysv\n"); exit (0);
#else
#if defined (CMU)
  printf ("ns32k-encore-mach\n"); exit (0);
#else
  printf ("ns32k-encore-bsd\n"); exit (0);
#endif
#endif
#endif

#if defined (__386BSD__)
  printf ("i386-pc-bsd\n"); exit (0);
#endif

#if defined (sequent)
#if defined (i386)
  printf ("i386-sequent-dynix\n"); exit (0);
#endif
#if defined (ns32000)
  printf ("ns32k-sequent-dynix\n"); exit (0);
#endif
#endif

#if defined (_SEQUENT_)
    struct utsname un;

    uname(&un);

    if (strncmp(un.version, "V2", 2) == 0) {
	printf ("i386-sequent-ptx2\n"); exit (0);
    }
    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
	printf ("i386-sequent-ptx1\n"); exit (0);
    }
    printf ("i386-sequent-ptx\n"); exit (0);

#endif

#if defined (vax)
# if !defined (ultrix)
#  include <sys/param.h>
#  if defined (BSD)
#   if BSD == 43
      printf ("vax-dec-bsd4.3\n"); exit (0);
#   else
#    if BSD == 199006
      printf ("vax-dec-bsd4.3reno\n"); exit (0);
#    else
      printf ("vax-dec-bsd\n"); exit (0);
#    endif
#   endif
#  else
    printf ("vax-dec-bsd\n"); exit (0);
#  endif
# else
    printf ("vax-dec-ultrix\n"); exit (0);
# endif
#endif

#if defined (alliant) && defined (i860)
  printf ("i860-alliant-bsd\n"); exit (0);
#endif

  exit (1);
}
EOF

$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
	{ echo "$SYSTEM_NAME"; exit; }

# Apollos put the system type in the environment.

test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }

# Convex versions that predate uname can use getsysinfo(1)

if [ -x /usr/convex/getsysinfo ]
then
    case `getsysinfo -f cpu_type` in
    c1*)
	echo c1-convex-bsd
	exit ;;
    c2*)
	if getsysinfo -f scalar_acc
	then echo c32-convex-bsd
	else echo c2-convex-bsd
	fi
	exit ;;
    c34*)
	echo c34-convex-bsd
	exit ;;
    c38*)
	echo c38-convex-bsd
	exit ;;
    c4*)
	echo c4-convex-bsd
	exit ;;
    esac
fi

cat >&2 <<EOF
$0: unable to guess system type

This script, last modified $timestamp, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from

  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
and
  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub

If the version you run ($0) is already up to date, please
send the following data and any information you think might be
pertinent to <config-patches@gnu.org> 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:


================================================
FILE: build/config.sub
================================================
#! /bin/sh
# Configuration validation subroutine script.
#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
#   2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
#   Inc.

timestamp='2007-06-28'

# 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., 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.


# Please send patches to <config-patches@gnu.org>.  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 <config-patches@gnu.org>."

version="\
GNU config.sub ($timestamp)

Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.

This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."

help="
Try \`$me --help' for more information."

# Parse command line
while test $# -gt 0 ; do
  case $1 in
    --time-stamp | --time* | -t )
       echo "$timestamp" ; exit ;;
    --version | -v )
       echo "$version" ; exit ;;
    --help | --h* | -h )
       echo "$usage"; exit ;;
    -- )     # Stop option processing
       shift; break ;;
    - )	# Use stdin as input.
       break ;;
    -* )
       echo "$me: invalid option $1$help"
       exit 1 ;;

    *local*)
       # First pass through any local machine types.
       echo $1
       exit ;;

    * )
       break ;;
  esac
done

case $# in
 0) echo "$me: missing argument$help" >&2
    exit 1;;
 1) ;;
 *) echo "$me: too many arguments$help" >&2
    exit 1;;
esac

# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
  nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
  storm-chaos* | os2-emx* | rtmk-nova*)
    os=-$maybe_os
    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
    ;;
  *)
    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
    if [ $basic_machine != $1 ]
    then os=`echo $1 | sed 's/.*-/-/'`
    else os=; fi
    ;;
esac

### Let's recognize common machines as not being operating systems so
### that things like config.sub decstation-3100 work.  We also
### recognize some manufacturers as not being operating systems, so we
### can provide default operating systems below.
case $os in
	-sun*os*)
		# Prevent following clause from handling this invalid input.
		;;
	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
	-apple | -axis | -knuth | -cray)
		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
		;;
	-sco6)
		os=-sco5v6
		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
		;;
	-sco5)
		os=-sco3.2v5
		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
		;;
	-sco4)
		os=-sco3.2v4
		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
		;;
	-sco3.2.[4-9]*)
		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
		;;
	-sco3.2v[4-9]*)
		# Don't forget version if it is 3.2v4 or newer.
		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
		;;
	-sco5v6*)
		# Don't forget version if it is 3.2v4 or newer.
		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
		;;
	-sco*)
		os=-sco3.2v2
		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
		;;
	-udk*)
		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
		;;
	-isc)
		os=-isc2.2
		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
		;;
	-clix*)
		basic_machine=clipper-intergraph
		;;
	-isc*)
		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
		;;
	-lynx*)
		os=-lynxos
		;;
	-ptx*)
		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
		;;
	-windowsnt*)
		os=`echo $os | sed -e 's/windowsnt/winnt/'`
		;;
	-psos*)
		os=-psos
		;;
	-mint | -mint[0-9]*)
		basic_machine=m68k-atari
		os=-mint
		;;
esac

# Decode aliases for certain CPU-COMPANY combinations.
case $basic_machine in
	# Recognize the basic CPU types without company name.
	# Some are omitted here because they have special meanings below.
	1750a | 580 \
	| a29k \
	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
	| am33_2.0 \
	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
	| bfin \
	| c4x | clipper \
	| d10v | d30v | dlx | dsp16xx \
	| fido | fr30 | frv \
	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
	| i370 | i860 | i960 | ia64 \
	| ip2k | iq2000 \
	| m32c | m32r | m32rle | m68000 | m68k | m88k \
	| maxq | mb | microblaze | mcore | mep \
	| mips | mipsbe | mipseb | mipsel | mipsle \
	| mips16 \
	| mips64 | mips64el \
	| mips64vr | mips64vrel \
	| mips64orion | mips64orionel \
	| mips64vr4100 | mips64vr4100el \
	| mips64vr4300 | mips64vr4300el \
	| mips64vr5000 | mips64vr5000el \
	| mips64vr5900 | mips64vr5900el \
	| mipsisa32 | mipsisa32el \
	| mipsisa32r2 | mipsisa32r2el \
	| mipsisa64 | mipsisa64el \
	| mipsisa64r2 | mipsisa64r2el \
	| mipsisa64sb1 | mipsisa64sb1el \
	| mipsisa64sr71k | mipsisa64sr71kel \
	| mipstx39 | mipstx39el \
	| mn10200 | mn10300 \
	| mt \
	| msp430 \
	| nios | nios2 \
	| ns16k | ns32k \
	| or32 \
	| pdp10 | pdp11 | pj | pjl \
	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
	| pyramid \
	| score \
	| sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
	| sh64 | sh64le \
	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
	| spu | strongarm \
	| tahoe | thumb | tic4x | tic80 | tron \
	| v850 | v850e \
	| we32k \
	| x86 | xc16x | xscale | xscalee[bl] | 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)
		;;
	ms1)
		basic_machine=mt-unknown
		;;

	# We use `pc' rather than `unknown'
	# because (1) that's what they normally are, and
	# (2) the word "unknown" tends to confuse beginning users.
	i*86 | x86_64)
	  basic_machine=$basic_machine-pc
	  ;;
	# Object if more than one company name word.
	*-*-*)
		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
		exit 1
		;;
	# Recognize the basic CPU types with company name.
	580-* \
	| a29k-* \
	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
	| avr-* | avr32-* \
	| bfin-* | bs2000-* \
	| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
	| clipper-* | craynv-* | cydra-* \
	| d10v-* | d30v-* | dlx-* \
	| elxsi-* \
	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
	| h8300-* | h8500-* \
	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
	| i*86-* | i860-* | i960-* | ia64-* \
	| ip2k-* | iq2000-* \
	| m32c-* | m32r-* | m32rle-* \
	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
	| m88110-* | m88k-* | maxq-* | mcore-* \
	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
	| mips16-* \
	| mips64-* | mips64el-* \
	| mips64vr-* | mips64vrel-* \
	| mips64orion-* | mips64orionel-* \
	| mips64vr4100-* | mips64vr4100el-* \
	| mips64vr4300-* | mips64vr4300el-* \
	| mips64vr5000-* | mips64vr5000el-* \
	| mips64vr5900-* | mips64vr5900el-* \
	| mipsisa32-* | mipsisa32el-* \
	| mipsisa32r2-* | mipsisa32r2el-* \
	| mipsisa64-* | mipsisa64el-* \
	| mipsisa64r2-* | mipsisa64r2el-* \
	| mipsisa64sb1-* | mipsisa64sb1el-* \
	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
	| mipstx39-* | mipstx39el-* \
	| mmix-* \
	| mt-* \
	| msp430-* \
	| nios-* | nios2-* \
	| none-* | np1-* | ns16k-* | ns32k-* \
	| orion-* \
	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
	| pyramid-* \
	| romp-* | rs6000-* \
	| sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
	| sparclite-* \
	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
	| tahoe-* | thumb-* \
	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
	| tron-* \
	| v850-* | v850e-* | vax-* \
	| we32k-* \
	| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
	| 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
		;;
    	abacus)
		basic_machine=abacus-unknown
		;;
	adobe68k)
		basic_machine=m68010-adobe
		os=-scout
		;;
	alliant | fx80)
		basic_machine=fx80-alliant
		;;
	altos | altos3068)
		basic_machine=m68k-altos
		;;
	am29k)
		basic_machine=a29k-none
		os=-bsd
		;;
	amd64)
		basic_machine=x86_64-pc
		;;
	amd64-*)
		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
		;;
	amdahl)
		basic_machine=580-amdahl
		os=-sysv
		;;
	amiga | amiga-*)
		basic_machine=m68k-unknown
		;;
	amigaos | amigados)
		basic_machine=m68k-unknown
		os=-amigaos
		;;
	amigaunix | amix)
		basic_machine=m68k-unknown
		os=-sysv4
		;;
	apollo68)
		basic_machine=m68k-apollo
		os=-sysv
		;;
	apollo68bsd)
		basic_machine=m68k-apollo
		os=-bsd
		;;
	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
		;;
	craynv)
		basic_machine=craynv-cray
		os=-unicosmp
		;;
	cr16)
		basic_machine=cr16-unknown
		os=-elf
		;;
	crds | unos)
		basic_machine=m68k-crds
		;;
	crisv32 | crisv32-* | etraxfs*)
		basic_machine=crisv32-axis
		;;
	cris | cris-* | etrax*)
		basic_machine=cris-axis
		;;
	crx)
		basic_machine=crx-unknown
		os=-elf
		;;
	da30 | da30-*)
		basic_machine=m68k-da30
		;;
	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
		basic_machine=mips-dec
		;;
	decsystem10* | dec10*)
		basic_machine=pdp10-dec
		os=-tops10
		;;
	decsystem20* | dec20*)
		basic_machine=pdp10-dec
		os=-tops20
		;;
	delta | 3300 | motorola-3300 | motorola-delta \
	      | 3300-motorola | delta-motorola)
		basic_machine=m68k-motorola
		;;
	delta88)
		basic_machine=m88k-motorola
		os=-sysv3
		;;
	djgpp)
		basic_machine=i586-pc
		os=-msdosdjgpp
		;;
	dpx20 | dpx20-*)
		basic_machine=rs6000-bull
		os=-bosx
		;;
	dpx2* | dpx2*-bull)
		basic_machine=m68k-bull
		os=-sysv3
		;;
	ebmon29k)
		basic_machine=a29k-amd
		os=-ebmon
		;;
	elxsi)
		basic_machine=elxsi-elxsi
		os=-bsd
		;;
	encore | umax | mmax)
		basic_machine=ns32k-encore
		;;
	es1800 | OSE68k | ose68k | ose | OSE)
		basic_machine=m68k-ericsson
		os=-ose
		;;
	fx2800)
		basic_machine=i860-alliant
		;;
	genix)
		basic_machine=ns32k-ns
		;;
	gmicro)
		basic_machine=tron-gmicro
		os=-sysv
		;;
	go32)
		basic_machine=i386-pc
		os=-go32
		;;
	h3050r* | hiux*)
		basic_machine=hppa1.1-hitachi
		os=-hiuxwe2
		;;
	h8300hms)
		basic_machine=h8300-hitachi
		os=-hms
		;;
	h8300xray)
		basic_machine=h8300-hitachi
		os=-xray
		;;
	h8500hms)
		basic_machine=h8500-hitachi
		os=-hms
		;;
	harris)
		basic_machine=m88k-harris
		os=-sysv3
		;;
	hp300-*)
		basic_machine=m68k-hp
		;;
	hp300bsd)
		basic_machine=m68k-hp
		os=-bsd
		;;
	hp300hpux)
		basic_machine=m68k-hp
		os=-hpux
		;;
	hp3k9[0-9][0-9] | hp9[0-9][0-9])
		basic_machine=hppa1.0-hp
		;;
	hp9k2[0-9][0-9] | hp9k31[0-9])
		basic_machine=m68000-hp
		;;
	hp9k3[2-9][0-9])
		basic_machine=m68k-hp
		;;
	hp9k6[0-9][0-9] | hp6[0-9][0-9])
		basic_machine=hppa1.0-hp
		;;
	hp9k7[0-79][0-9] | hp7[0-79][0-9])
		basic_machine=hppa1.1-hp
		;;
	hp9k78[0-9] | hp78[0-9])
		# FIXME: really hppa2.0-hp
		basic_machine=hppa1.1-hp
		;;
	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
		# FIXME: really hppa2.0-hp
		basic_machine=hppa1.1-hp
		;;
	hp9k8[0-9][13679] | hp8[0-9][13679])
		basic_machine=hppa1.1-hp
		;;
	hp9k8[0-9][0-9] | hp8[0-9][0-9])
		basic_machine=hppa1.0-hp
		;;
	hppa-next)
		os=-nextstep3
		;;
	hppaosf)
		basic_machine=hppa1.1-hp
		os=-osf
		;;
	hppro)
		basic_machine=hppa1.1-hp
		os=-proelf
		;;
	i370-ibm* | ibm*)
		basic_machine=i370-ibm
		;;
# I'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
		;;
	mingw32ce)
		basic_machine=arm-unknown
		os=-mingw32ce
		;;
	miniframe)
		basic_machine=m68000-convergent
		;;
	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
		basic_machine=m68k-atari
		os=-mint
		;;
	mips3*-*)
		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
		;;
	mips3*)
		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
		;;
	monitor)
		basic_machine=m68k-rom68k
		os=-coff
		;;
	morphos)
		basic_machine=powerpc-unknown
		os=-morphos
		;;
	msdos)
		basic_machine=i386-pc
		os=-msdos
		;;
	ms1-*)
		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
		;;
	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
		;;
	openrisc | openrisc-*)
		basic_machine=or32-unknown
		;;
	os400)
		basic_machine=powerpc-ibm
		os=-os400
		;;
	OSE68000 | ose68000)
		basic_machine=m68000-ericsson
		os=-ose
		;;
	os68k)
		basic_machine=m68k-none
		os=-os68k
		;;
	pa-hitachi)
		basic_machine=hppa1.1-hitachi
		os=-hiuxwe2
		;;
	paragon)
		basic_machine=i860-intel
		os=-osf
		;;
	pbd)
		basic_machine=sparc-tti
		;;
	pbb)
		basic_machine=m68k-tti
		;;
	pc532 | pc532-*)
		basic_machine=ns32k-pc532
		;;
	pc98)
		basic_machine=i386-pc
		;;
	pc98-*)
		basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
		;;
	pentium | p5 | k5 | k6 | nexgen | viac3)
		basic_machine=i586-pc
		;;
	pentiumpro | p6 | 6x86 | athlon | athlon_*)
		basic_machine=i686-pc
		;;
	pentiumii | pentium2 | pentiumiii | pentium3)
		basic_machine=i686-pc
		;;
	pentium4)
		basic_machine=i786-pc
		;;
	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
		;;
	pentiumpro-* | p6-* | 6x86-* | athlon-*)
		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
		;;
	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
		;;
	pentium4-*)
		basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
		;;
	pn)
		basic_machine=pn-gould
		;;
	power)	basic_machine=power-ibm
		;;
	ppc)	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
		;;
	rdos)
		basic_machine=i386-pc
		os=-rdos
		;;
	rom68k)
		basic_machine=m68k-rom68k
		os=-coff
		;;
	rm[46]00)
		basic_machine=mips-siemens
		;;
	rtpc | rtpc-*)
		basic_machine=romp-ibm
		;;
	s390 | s390-*)
		basic_machine=s390-ibm
		;;
	s390x | s390x-*)
		basic_machine=s390x-ibm
		;;
	sa29200)
		basic_machine=a29k-amd
		os=-udi
		;;
	sb1)
		basic_machine=mipsisa64sb1-unknown
		;;
	sb1el)
		basic_machine=mipsisa64sb1el-unknown
		;;
	sde)
		basic_machine=mipsisa32-sde
		os=-elf
		;;
	sei)
		basic_machine=mips-sei
		os=-seiux
		;;
	sequent)
		basic_machine=i386-sequent
		;;
	sh)
		basic_machine=sh-hitachi
		os=-hms
		;;
	sh5el)
		basic_machine=sh5le-unknown
		;;
	sh64)
		basic_machine=sh64-unknown
		;;
	sparclite-wrs | simso-wrs)
		basic_machine=sparclite-wrs
		os=-vxworks
		;;
	sps7)
		basic_machine=m68k-bull
		os=-sysv2
		;;
	spur)
		basic_machine=spur-unknown
		;;
	st2000)
		basic_machine=m68k-tandem
		;;
	stratus)
		basic_machine=i860-stratus
		os=-sysv4
		;;
	sun2)
		basic_machine=m68000-sun
		;;
	sun2os3)
		basic_machine=m68000-sun
		os=-sunos3
		;;
	sun2os4)
		basic_machine=m68000-sun
		os=-sunos4
		;;
	sun3os3)
		basic_machine=m68k-sun
		os=-sunos3
		;;
	sun3os4)
		basic_machine=m68k-sun
		os=-sunos4
		;;
	sun4os3)
		basic_machine=sparc-sun
		os=-sunos3
		;;
	sun4os4)
		basic_machine=sparc-sun
		os=-sunos4
		;;
	sun4sol2)
		basic_machine=sparc-sun
		os=-solaris2
		;;
	sun3 | sun3-*)
		basic_machine=m68k-sun
		;;
	sun4)
		basic_machine=sparc-sun
		;;
	sun386 | sun386i | roadrunner)
		basic_machine=i386-sun
		;;
	sv1)
		basic_machine=sv1-cray
		os=-unicos
		;;
	symmetry)
		basic_machine=i386-sequent
		os=-dynix
		;;
	t3e)
		basic_machine=alphaev5-cray
		os=-unicos
		;;
	t90)
		basic_machine=t90-cray
		os=-unicos
		;;
	tic54x | c54x*)
		basic_machine=tic54x-unknown
		os=-coff
		;;
	tic55x | c55x*)
		basic_machine=tic55x-unknown
		os=-coff
		;;
	tic6x | c6x*)
		basic_machine=tic6x-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
		;;
	tpf)
		basic_machine=s390x-ibm
		os=-tpf
		;;
	udi29k)
		basic_machine=a29k-amd
		os=-udi
		;;
	ultra3)
		basic_machine=a29k-nyu
		os=-sym1
		;;
	v810 | necv810)
		basic_machine=v810-nec
		os=-none
		;;
	vaxv)
		basic_machine=vax-dec
		os=-sysv
		;;
	vms)
		basic_machine=vax-dec
		os=-vms
		;;
	vpp*|vx|vx-*)
		basic_machine=f301-fujitsu
		;;
	vxworks960)
		basic_machine=i960-wrs
		os=-vxworks
		;;
	vxworks68)
		basic_machine=m68k-wrs
		os=-vxworks
		;;
	vxworks29k)
		basic_machine=a29k-wrs
		os=-vxworks
		;;
	w65*)
		basic_machine=w65-wdc
		os=-none
		;;
	w89k-*)
		basic_machine=hppa1.1-winbond
		os=-proelf
		;;
	xbox)
		basic_machine=i686-pc
		os=-mingw32
		;;
	xps | xps100)
		basic_machine=xps100-honeywell
		;;
	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
		;;
	mmix)
		basic_machine=mmix-knuth
		;;
	rs6000)
		basic_machine=rs6000-ibm
		;;
	vax)
		basic_machine=vax-dec
		;;
	pdp10)
		# there are many clones, so DEC is not a safe bet
		basic_machine=pdp10-unknown
		;;
	pdp11)
		basic_machine=pdp11-dec
		;;
	we32k)
		basic_machine=we32k-att
		;;
	sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
		basic_machine=sh-unknown
		;;
	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
		basic_machine=sparc-sun
		;;
	cydra)
		basic_machine=cydra-cydrome
		;;
	orion)
		basic_machine=orion-highlevel
		;;
	orion105)
		basic_machine=clipper-highlevel
		;;
	mac | mpw | mac-mpw)
		basic_machine=m68k-apple
		;;
	pmac | pmac-mpw)
		basic_machine=powerpc-apple
		;;
	*-unknown)
		# Make sure to match an already-canonicalized machine name.
		;;
	*)
		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
		exit 1
		;;
esac

# Here we canonicalize certain aliases for manufacturers.
case $basic_machine in
	*-digital*)
		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
		;;
	*-commodore*)
		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
		;;
	*)
		;;
esac

# Decode manufacturer-specific aliases for certain operating systems.

if [ x"$os" != x"" ]
then
case $os in
        # First match some system type aliases
        # that might get confused with valid system types.
	# -solaris* is a basic system type, with this one exception.
	-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* | -knetbsd* | -mirbsd* | -netbsd* \
	      | -openbsd* | -solidbsd* \
	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
	      | -chorusos* | -chorusrdb* \
	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
	      | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
	      | -uxpv* | -beos* | -mpeix* | -udk* \
	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
	# Remember, each alternative MUST END IN *, to match a version number.
		;;
	-qnx*)
		case $basic_machine in
		    x86-* | i*86-*)
			;;
		    *)
			os=-nto$os
			;;
		esac
		;;
	-nto-qnx*)
		;;
	-nto*)
		os=`echo $os | sed -e 's|nto|nto-qnx|'`
		;;
	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
		;;
	-mac*)
		os=`echo $os | sed -e 's|mac|macos|'`
		;;
	-linux-dietlibc)
		os=-linux-dietlibc
		;;
	-linux*)
		os=`echo $os | sed -e 's|linux|linux-gnu|'`
		;;
	-sunos5*)
		os=`echo $os | sed -e 's|sunos5|solaris2|'`
		;;
	-sunos6*)
		os=`echo $os | sed -e 's|sunos6|solaris3|'`
		;;
	-opened*)
		os=-openedition
		;;
        -os400*)
		os=-os400
		;;
	-wince*)
		os=-wince
		;;
	-osfrose*)
		os=-osfrose
		;;
	-osf*)
		os=-osf
		;;
	-utek*)
		os=-bsd
		;;
	-dynix*)
		os=-bsd
		;;
	-acis*)
		os=-aos
		;;
	-atheos*)
		os=-atheos
		;;
	-syllable*)
		os=-syllable
		;;
	-386bsd)
		os=-bsd
		;;
	-ctix* | -uts*)
		os=-sysv
		;;
	-nova*)
		os=-rtmk-nova
		;;
	-ns2 )
		os=-nextstep2
		;;
	-nsk*)
		os=-nsk
		;;
	# Preserve the version number of sinix5.
	-sinix5.*)
		os=`echo $os | sed -e 's|sinix|sysv|'`
		;;
	-sinix*)
		os=-sysv4
		;;
        -tpf*)
		os=-tpf
		;;
	-triton*)
		os=-sysv3
		;;
	-oss*)
		os=-sysv3
		;;
	-svr4)
		os=-sysv4
		;;
	-svr3)
		os=-sysv3
		;;
	-sysvr4)
		os=-sysv4
		;;
	# This must come after -sysvr4.
	-sysv*)
		;;
	-ose*)
		os=-ose
		;;
	-es1800*)
		os=-ose
		;;
	-xenix)
		os=-xenix
		;;
	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
		os=-mint
		;;
	-aros*)
		os=-aros
		;;
	-kaos*)
		os=-kaos
		;;
	-zvmoe)
		os=-zvmoe
		;;
	-none)
		;;
	*)
		# Get rid of the `-' at the beginning of $os.
		os=`echo $os | sed 's/[^-]*-//'`
		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
		exit 1
		;;
esac
else

# Here we handle the default operating systems that come with various machines.
# The value should be what the vendor currently ships out the door with their
# machine or put another way, the most popular os provided with the machine.

# Note that if you're going to try to match "-MANUFACTURER" here (say,
# "-sun"), then you have to tell the case statement up towards the top
# that MANUFACTURER isn't an operating system.  Otherwise, code above
# will signal an error saying that MANUFACTURER isn't an operating
# system, and we'll never get to this point.

case $basic_machine in
        score-*)
		os=-elf
		;;
        spu-*)
		os=-elf
		;;
	*-acorn)
		os=-riscix1.2
		;;
	arm*-rebel)
		os=-linux
		;;
	arm*-semi)
		os=-aout
		;;
        c4x-* | tic4x-*)
        	os=-coff
		;;
	# 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
		;;
        mep-*)
		os=-elf
		;;
	mips*-cisco)
		os=-elf
		;;
	mips*-*)
		os=-elf
		;;
	or32-*)
		os=-coff
		;;
	*-tti)	# must be before sparc entry or we get the wrong os.
		os=-sysv3
		;;
	sparc-* | *-sun)
		os=-sunos4.1.1
		;;
	*-be)
		os=-beos
		;;
	*-haiku)
		os=-haiku
		;;
	*-ibm)
		os=-aix
		;;
    	*-knuth)
		os=-mmixware
		;;
	*-wec)
		os=-proelf
		;;
	*-winbond)
		os=-proelf
		;;
	*-oki)
		os=-proelf
		;;
	*-hp)
		os=-hpux
		;;
	*-hitachi)
		os=-hiux
		;;
	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
		os=-sysv
		;;
	*-cbm)
		os=-amigaos
		;;
	*-dg)
		os=-dgux
		;;
	*-dolphin)
		os=-sysv3
		;;
	m68k-ccur)
		os=-rtu
		;;
	m88k-omron*)
		os=-luna
		;;
	*-next )
		os=-nextstep
		;;
	*-sequent)
		os=-ptx
		;;
	*-crds)
		os=-unos
		;;
	*-ns)
		os=-genix
		;;
	i370-*)
		os=-mvs
		;;
	*-next)
		os=-nextstep3
		;;
	*-gould)
		os=-sysv
		;;
	*-highlevel)
		os=-bsd
		;;
	*-encore)
		os=-bsd
		;;
	*-sgi)
		os=-irix
		;;
	*-siemens)
		os=-sysv4
		;;
	*-masscomp)
		os=-rtu
		;;
	f30[01]-fujitsu | f700-fujitsu)
		os=-uxpv
		;;
	*-rom68k)
		os=-coff
		;;
	*-*bug)
		os=-coff
		;;
	*-apple)
		os=-macos
		;;
	*-atari*)
		os=-mint
		;;
	*)
		os=-none
		;;
esac
fi

# Here we handle the case where we know the os, and the CPU type, but not the
# manufacturer.  We pick the logical manufacturer.
vendor=unknown
case $basic_machine in
	*-unknown)
		case $os in
			-riscix*)
				vendor=acorn
				;;
			-sunos*)
				vendor=sun
				;;
			-aix*)
				vendor=ibm
				;;
			-beos*)
				vendor=be
				;;
			-hpux*)
				vendor=hp
				;;
			-mpeix*)
				vendor=hp
				;;
			-hiux*)
				vendor=hitachi
				;;
			-unos*)
				vendor=crds
				;;
			-dgux*)
				vendor=dg
				;;
			-luna*)
				vendor=omron
				;;
			-genix*)
				vendor=ns
				;;
			-mvs* | -opened*)
				vendor=ibm
				;;
			-os400*)
				vendor=ibm
				;;
			-ptx*)
				vendor=sequent
				;;
			-tpf*)
				vendor=ibm
				;;
			-vxsim* | -vxworks* | -windiss*)
				vendor=wrs
				;;
			-aux*)
				vendor=apple
				;;
			-hms*)
				vendor=hitachi
				;;
			-mpw* | -macos*)
				vendor=apple
				;;
			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
				vendor=atari
				;;
			-vos*)
				vendor=stratus
				;;
		esac
		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
		;;
esac

echo $basic_machine$os
exit

# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
# End:


================================================
FILE: build/depcomp
================================================
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects

scriptversion=2007-03-29.01

# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 Free Software
# Foundation, Inc.

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.

# 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 <oliva@dcc.unicamp.br>.

case $1 in
  '')
     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
     exit 1;
     ;;
  -h | --h*)
    cat <<\EOF
Usage: depcomp [--help] [--version] PROGRAM [ARGS]

Run PROGRAMS ARGS to compile a file, generating dependencies
as side-effects.

Environment variables:
  depmode     Dependency tracking mode.
  source      Source file read by `PROGRAMS ARGS'.
  object      Object file output by `PROGRAMS ARGS'.
  DEPDIR      directory where to store dependencies.
  depfile     Dependency file to output.
  tmpdepfile  Temporary file to use when outputing dependencies.
  libtool     Whether libtool is used (yes/no).

Report bugs to <bug-automake@gnu.org>.
EOF
    exit $?
    ;;
  -v | --v*)
    echo "depcomp $scriptversion"
    exit $?
    ;;
esac

if test -z "$depmode" || test -z "$source" || test -z "$object"; then
  echo "depcomp: Variables source, object and depmode must be set" 1>&2
  exit 1
fi

# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
depfile=${depfile-`echo "$object" |
  sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}

rm -f "$tmpdepfile"

# Some modes work just like other modes, but use different flags.  We
# parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write.  Note that we *cannot* use a case
# here, because this file can only contain one case statement.
if test "$depmode" = hp; then
  # HP compiler uses -M and no extra arg.
  gccflag=-M
  depmode=gcc
fi

if test "$depmode" = dashXmstdout; then
   # This is just like dashmstdout with a different argument.
   dashmflag=-xM
   depmode=dashmstdout
fi

case "$depmode" in
gcc3)
## gcc 3 implements dependency tracking that does exactly what
## we want.  Yay!  Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff.  Hmm.
## Unfortunately, FreeBSD c89 acceptance of flags depends upon
## the command line argument order; so add the flags where they
## appear in depend2.am.  Note that the slowdown incurred here
## affects only configure: in makefiles, %FASTDEP% shortcuts this.
  for arg
  do
    case $arg in
    -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
    *)  set fnord "$@" "$arg" ;;
    esac
    shift # fnord
    shift # $arg
  done
  "$@"
  stat=$?
  if test $stat -eq 0; then :
  else
    rm -f "$tmpdepfile"
    exit $stat
  fi
  mv "$tmpdepfile" "$depfile"
  ;;

gcc)
## There are various ways to get dependency output from gcc.  Here's
## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end
##   up in a subdir.  Having to rename by hand is ugly.
##   (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
##   -MM, not -M (despite what the docs say).
## - Using -M directly means running the compiler twice (even worse
##   than renaming).
  if test -z "$gccflag"; then
    gccflag=-MD,
  fi
  "$@" -Wp,"$gccflag$tmpdepfile"
  stat=$?
  if test $stat -eq 0; then :
  else
    rm -f "$tmpdepfile"
    exit $stat
  fi
  rm -f "$depfile"
  echo "$object : \\" > "$depfile"
  alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
## The second -e expression handles DOS-style file names with drive letters.
  sed -e 's/^[^:]*: / /' \
      -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
## This next piece of magic avoids the `deleted header file' problem.
## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header).  We avoid this by adding
## dummy dependencies for each header file.  Too bad gcc doesn't do
## this for us directly.
  tr ' ' '
' < "$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.  In older versions, this file always lives in the
  # current directory.  Also, the AIX compiler puts `$object:' at the
  # start of each line; $object doesn't have directory information.
  # Version 6 uses the directory in both cases.
  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
  test "x$dir" = "x$object" && dir=
  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
  if test "$libtool" = yes; then
    tmpdepfile1=$dir$base.u
    tmpdepfile2=$base.u
    tmpdepfile3=$dir.libs/$base.u
    "$@" -Wc,-M
  else
    tmpdepfile1=$dir$base.u
    tmpdepfile2=$dir$base.u
    tmpdepfile3=$dir$base.u
    "$@" -M
  fi
  stat=$?

  if test $stat -eq 0; then :
  else
    rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
    exit $stat
  fi

  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
  do
    test -f "$tmpdepfile" && break
  done
  if test -f "$tmpdepfile"; then
    # Each line is of the form `foo.o: dependent.h'.
    # Do two passes, one to just change these to
    # `$object: dependent.h' and one to simply `dependent.h:'.
    sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
    # That's a tab and a space in the [].
    sed -e 's,^.*\.[a-z]*:[	 ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
  else
    # The sourcefile does not contain any dependencies, so just
    # store a dummy comment line, to avoid errors with the Makefile
    # "include basename.Plo" scheme.
    echo "#dummy" > "$depfile"
  fi
  rm -f "$tmpdepfile"
  ;;

icc)
  # Intel's C compiler understands `-MD -MF file'.  However on
  #    icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
  # ICC 7.0 will fill foo.d with something like
  #    foo.o: sub/foo.c
  #    foo.o: sub/foo.h
  # which is wrong.  We want:
  #    sub/foo.o: sub/foo.c
  #    sub/foo.o: sub/foo.h
  #    sub/foo.c:
  #    sub/foo.h:
  # ICC 7.1 will output
  #    foo.o: sub/foo.c sub/foo.h
  # and will wrap long lines using \ :
  #    foo.o: sub/foo.c ... \
  #     sub/foo.h ... \
  #     ...

  "$@" -MD -MF "$tmpdepfile"
  stat=$?
  if test $stat -eq 0; then :
  else
    rm -f "$tmpdepfile"
    exit $stat
  fi
  rm -f "$depfile"
  # Each line is of the form `foo.o: dependent.h',
  # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
  # Do two passes, one to just change these to
  # `$object: dependent.h' and one to simply `dependent.h:'.
  sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
  # Some versions of the HPUX 10.20 sed can't process this invocation
  # correctly.  Breaking it into two sed invocations is a workaround.
  sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
    sed -e 's/$/ :/' >> "$depfile"
  rm -f "$tmpdepfile"
  ;;

hp2)
  # The "hp" stanza above does not work with aCC (C++) and HP's ia64
  # compilers, which have integrated preprocessors.  The correct option
  # to use with these is +Maked; it writes dependencies to a file named
  # 'foo.d', which lands next to the object file, wherever that
  # happens to be.
  # Much of this is similar to the tru64 case; see comments there.
  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
  test "x$dir" = "x$object" && dir=
  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
  if test "$libtool" = yes; then
    tmpdepfile1=$dir$base.d
    tmpdepfile2=$dir.libs/$base.d
    "$@" -Wc,+Maked
  else
    tmpdepfile1=$dir$base.d
    tmpdepfile2=$dir$base.d
    "$@" +Maked
  fi
  stat=$?
  if test $stat -eq 0; then :
  else
     rm -f "$tmpdepfile1" "$tmpdepfile2"
     exit $stat
  fi

  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
  do
    test -f "$tmpdepfile" && break
  done
  if test -f "$tmpdepfile"; then
    sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
    # Add `dependent.h:' lines.
    sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"
  else
    echo "#dummy" > "$depfile"
  fi
  rm -f "$tmpdepfile" "$tmpdepfile2"
  ;;

tru64)
   # The Tru64 compiler uses -MD to generate dependencies as a side
   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
   # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
   # dependencies in `foo.d' instead, so we check for that too.
   # Subdirectories are respected.
   dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
   test "x$dir" = "x$object" && dir=
   base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`

   if test "$libtool" = yes; then
      # With Tru64 cc, shared objects can also be used to make a
      # static library.  This mechanism is used in libtool 1.4 series to
      # handle both shared and static libraries in a single compilation.
      # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
      #
      # With libtool 1.5 this exception was removed, and libtool now
      # generates 2 separate objects for the 2 libraries.  These two
      # compilations output dependencies in $dir.libs/$base.o.d and
      # in $dir$base.o.d.  We have to check for both files, because
      # one of the two compilations can be disabled.  We should prefer
      # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
      # automatically cleaned when .libs/ is deleted, while ignoring
      # the former would cause a distcleancheck panic.
      tmpdepfile1=$dir.libs/$base.lo.d   # libtool 1.4
      tmpdepfile2=$dir$base.o.d          # libtool 1.5
      tmpdepfile3=$dir.libs/$base.o.d    # libtool 1.5
      tmpdepfile4=$dir.libs/$base.d      # Compaq CCC V6.2-504
      "$@" -Wc,-MD
   else
      tmpdepfile1=$dir$base.o.d
      tmpdepfile2=$dir$base.d
      tmpdepfile3=$dir$base.d
      tmpdepfile4=$dir$base.d
      "$@" -MD
   fi

   stat=$?
   if test $stat -eq 0; then :
   else
      rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
      exit $stat
   fi

   for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
   do
     test -f "$tmpdepfile" && break
   done
   if test -f "$tmpdepfile"; then
      sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
      # That's a tab and a space 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 preprocessed file to stdout, regardless of -o.
  "$@" || exit $?

  # Remove the call to Libtool.
  if test "$libtool" = yes; then
    while test $1 != '--mode=compile'; do
      shift
    done
    shift
  fi

  # Remove `-o $object'.
  IFS=" "
  for arg
  do
    case $arg in
    -o)
      shift
      ;;
    $object)
      shift
      ;;
    *)
      set fnord "$@" "$arg"
      shift # fnord
      shift # $arg
      ;;
    esac
  done

  test -z "$dashmflag" && dashmflag=-M
  # Require at least two characters before searching for `:'
  # in the target name.  This is to cope with DOS-style filenames:
  # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
  "$@" $dashmflag |
    sed 's:^[  ]*[^: ][^:][^:]*\:[    ]*:'"$object"'\: :' > "$tmpdepfile"
  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)
  "$@" || exit $?
  # Remove any Libtool call
  if test "$libtool" = yes; then
    while test $1 != '--mode=compile'; do
      shift
    done
    shift
  fi
  # 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 ;;
    # Strip any option that makedepend may not understand.  Remove
    # the object too, otherwise makedepend will parse it as a source file.
    -*|$object)
      ;;
    *)
      set fnord "$@" "$arg"; shift ;;
    esac
  done
  obj_suffix="`echo $object | sed 's/^.*\././'`"
  touch "$tmpdepfile"
  ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
  rm -f "$depfile"
  cat < "$tmpdepfile" > "$depfile"
  sed '1,2d' "$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 preprocessed file to stdout.
  "$@" || exit $?

  # Remove the call to Libtool.
  if test "$libtool" = yes; then
    while test $1 != '--mode=compile'; do
      shift
    done
    shift
  fi

  # Remove `-o $object'.
  IFS=" "
  for arg
  do
    case $arg in
    -o)
      shift
      ;;
    $object)
      shift
      ;;
    *)
      set fnord "$@" "$arg"
      shift # fnord
      shift # $arg
      ;;
    esac
  done

  "$@" -E |
    sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
       -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
    sed '$ s: \\$::' > "$tmpdepfile"
  rm -f "$depfile"
  echo "$object : \\" > "$depfile"
  cat < "$tmpdepfile" >> "$depfile"
  sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
  rm -f "$tmpdepfile"
  ;;

msvisualcpp)
  # Important note: in order to support this mode, a compiler *must*
  # always write the preprocessed file to stdout, regardless of -o,
  # because we must use -o when running libtool.
  "$@" || exit $?
  IFS=" "
  for arg
  do
    case "$arg" in
    "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
	set fnord "$@"
	shift
	shift
	;;
    *)
	set fnord "$@" "$arg"
	shift
	shift
	;;
    esac
  done
  "$@" -E |
  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
  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

# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:


================================================
FILE: build/install-sh
================================================
#!/bin/sh
# install - install a program, script, or datafile

scriptversion=2006-12-25.00

# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch.

nl='
'
IFS=" ""	$nl"

# set DOITPROG to echo to test this script

# Don't use :- since 4.3BSD and earlier shells don't like it.
doit=${DOITPROG-}
if test -z "$doit"; then
  doit_exec=exec
else
  doit_exec=$doit
fi

# Put in absolute file names if you don't have them in your path;
# or use environment vars.

chgrpprog=${CHGRPPROG-chgrp}
chmodprog=${CHMODPROG-chmod}
chownprog=${CHOWNPROG-chown}
cmpprog=${CMPPROG-cmp}
cpprog=${CPPROG-cp}
mkdirprog=${MKDIRPROG-mkdir}
mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}

posix_glob='?'
initialize_posix_glob='
  test "$posix_glob" != "?" || {
    if (set -f) 2>/dev/null; then
      posix_glob=
    else
      posix_glob=:
    fi
  }
'

posix_mkdir=

# Desired mode of installed file.
mode=0755

chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
mvcmd=$mvprog
rmcmd="$rmprog -f"
stripcmd=

src=
dst=
dir_arg=
dst_arg=

copy_on_change=false
no_target_directory=

usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
   or: $0 [OPTION]... SRCFILES... DIRECTORY
   or: $0 [OPTION]... -t DIRECTORY SRCFILES...
   or: $0 [OPTION]... -d DIRECTORIES...

In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.

Options:
     --help     display this help and exit.
     --version  display version info and exit.

  -c            (ignored)
  -C            install only if different (preserve the last data modification time)
  -d            create directories instead of installing files.
  -g GROUP      $chgrpprog installed files to GROUP.
  -m MODE       $chmodprog installed files to MODE.
  -o USER       $chownprog installed files to USER.
  -s            $stripprog installed files.
  -t DIRECTORY  install into DIRECTORY.
  -T            report an error if DSTFILE is a directory.

Environment variables override the default commands:
  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
  RMPROG STRIPPROG
"

while test $# -ne 0; do
  case $1 in
    -c) ;;

    -C) copy_on_change=true;;

    -d) dir_arg=true;;

    -g) chgrpcmd="$chgrpprog $2"
	shift;;

    --help) echo "$usage"; exit $?;;

    -m) mode=$2
	case $mode in
	  *' '* | *'	'* | *'
'*	  | *'*'* | *'?'* | *'['*)
	    echo "$0: invalid mode: $mode" >&2
	    exit 1;;
	esac
	shift;;

    -o) chowncmd="$chownprog $2"
	shift;;

    -s) stripcmd=$stripprog;;

    -t) dst_arg=$2
	shift;;

    -T) no_target_directory=true;;

    --version) echo "$0 $scriptversion"; exit $?;;

    --)	shift
	break;;

    -*)	echo "$0: invalid option: $1" >&2
	exit 1;;

    *)  break;;
  esac
  shift
done

if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
  # When -d is used, all remaining arguments are directories to create.
  # When -t is used, the destination is already specified.
  # Otherwise, the last argument is the destination.  Remove it from $@.
  for arg
  do
    if test -n "$dst_arg"; then
      # $@ is not empty: it contains at least $arg.
      set fnord "$@" "$dst_arg"
      shift # fnord
    fi
    shift # arg
    dst_arg=$arg
  done
fi

if test $# -eq 0; then
  if test -z "$dir_arg"; then
    echo "$0: no input file specified." >&2
    exit 1
  fi
  # It's OK to call `install-sh -d' without argument.
  # This can happen when creating conditional directories.
  exit 0
fi

if test -z "$dir_arg"; then
  trap '(exit $?); exit' 1 2 13 15

  # Set umask so as not to create temps with too-generous modes.
  # However, 'strip' requires both read and write access to temps.
  case $mode in
    # Optimize common cases.
    *644) cp_umask=133;;
    *755) cp_umask=22;;

    *[0-7])
      if test -z "$stripcmd"; then
	u_plus_rw=
      else
	u_plus_rw='% 200'
      fi
      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
    *)
      if test -z "$stripcmd"; then
	u_plus_rw=
      else
	u_plus_rw=,u+rw
      fi
      cp_umask=$mode$u_plus_rw;;
  esac
fi

for src
do
  # Protect names starting with `-'.
  case $src in
    -*) src=./$src;;
  esac

  if test -n "$dir_arg"; then
    dst=$src
    dstdir=$dst
    test -d "$dstdir"
    dstdir_status=$?
  else

    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
    # might cause directories to be created, which would be especially bad
    # if $src (and thus $dsttmp) contains '*'.
    if test ! -f "$src" && test ! -d "$src"; then
      echo "$0: $src does not exist." >&2
      exit 1
    fi

    if test -z "$dst_arg"; then
      echo "$0: no destination specified." >&2
      exit 1
    fi

    dst=$dst_arg
    # Protect names starting with `-'.
    case $dst in
      -*) dst=./$dst;;
    esac

    # If destination is a directory, append the input filename; won't work
    # if double slashes aren't ignored.
    if test -d "$dst"; then
      if test -n "$no_target_directory"; then
	echo "$0: $dst_arg: Is a directory" >&2
	exit 1
      fi
      dstdir=$dst
      dst=$dstdir/`basename "$src"`
      dstdir_status=0
    else
      # Prefer dirname, but fall back on a substitute if dirname fails.
      dstdir=`
	(dirname "$dst") 2>/dev/null ||
	expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
	     X"$dst" : 'X\(//\)[^/]' \| \
	     X"$dst" : 'X\(//\)$' \| \
	     X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
	echo X"$dst" |
	    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
		   s//\1/
		   q
		 }
		 /^X\(\/\/\)[^/].*/{
		   s//\1/
		   q
		 }
		 /^X\(\/\/\)$/{
		   s//\1/
		   q
		 }
		 /^X\(\/\).*/{
		   s//\1/
		   q
		 }
		 s/.*/./; q'
      `

      test -d "$dstdir"
      dstdir_status=$?
    fi
  fi

  obsolete_mkdir_used=false

  if test $dstdir_status != 0; then
    case $posix_mkdir in
      '')
	# Create intermediate dirs using mode 755 as modified by the umask.
	# This is like FreeBSD 'install' as of 1997-10-28.
	umask=`umask`
	case $stripcmd.$umask in
	  # Optimize common cases.
	  *[2367][2367]) mkdir_umask=$umask;;
	  .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;

	  *[0-7])
	    mkdir_umask=`expr $umask + 22 \
	      - $umask % 100 % 40 + $umask % 20 \
	      - $umask % 10 % 4 + $umask % 2
	    `;;
	  *) mkdir_umask=$umask,go-w;;
	esac

	# With -d, create the new directory with the user-specified mode.
	# Otherwise, rely on $mkdir_umask.
	if test -n "$dir_arg"; then
	  mkdir_mode=-m$mode
	else
	  mkdir_mode=
	fi

	posix_mkdir=false
	case $umask in
	  *[123567][0-7][0-7])
	    # POSIX mkdir -p sets u+wx bits regardless of umask, which
	    # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
	    ;;
	  *)
	    tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
	    trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0

	    if (umask $mkdir_umask &&
		exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
	    then
	      if test -z "$dir_arg" || {
		   # Check for POSIX incompatibilities with -m.
		   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
		   # other-writeable bit of parent directory when it shouldn't.
		   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
		   ls_ld_tmpdir=`ls -ld "$tmpdir"`
		   case $ls_ld_tmpdir in
		     d????-?r-*) different_mode=700;;
		     d????-?--*) different_mode=755;;
		     *) false;;
		   esac &&
		   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
		     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
		     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
		   }
		 }
	      then posix_mkdir=:
	      fi
	      rmdir "$tmpdir/d" "$tmpdir"
	    else
	      # Remove any dirs left behind by ancient mkdir implementations.
	      rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
	    fi
	    trap '' 0;;
	esac;;
    esac

    if
      $posix_mkdir && (
	umask $mkdir_umask &&
	$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
      )
    then :
    else

      # The umask is ridiculous, or mkdir does not conform to POSIX,
      # or it failed possibly due to a race condition.  Create the
      # directory the slow way, step by step, checking for races as we go.

      case $dstdir in
	/*) prefix='/';;
	-*) prefix='./';;
	*)  prefix='';;
      esac

      eval "$initialize_posix_glob"

      oIFS=$IFS
      IFS=/
      $posix_glob set -f
      set fnord $dstdir
      shift
      $posix_glob set +f
      IFS=$oIFS

      prefixes=

      for d
      do
	test -z "$d" && continue

	prefix=$prefix$d
	if test -d "$prefix"; then
	  prefixes=
	else
	  if $posix_mkdir; then
	    (umask=$mkdir_umask &&
	     $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
	    # Don't fail if two instances are running concurrently.
	    test -d "$prefix" || exit 1
	  else
	    case $prefix in
	      *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
	      *) qprefix=$prefix;;
	    esac
	    prefixes="$prefixes '$qprefix'"
	  fi
	fi
	prefix=$prefix/
      done

      if test -n "$prefixes"; then
	# Don't fail if two instances are running concurrently.
	(umask $mkdir_umask &&
	 eval "\$doit_exec \$mkdirprog $prefixes") ||
	  test -d "$dstdir" || exit 1
	obsolete_mkdir_used=true
      fi
    fi
  fi

  if test -n "$dir_arg"; then
    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
      test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
  else

    # Make a couple of temp file names in the proper directory.
    dsttmp=$dstdir/_inst.$$_
    rmtmp=$dstdir/_rm.$$_

    # Trap to clean up those temp files at exit.
    trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0

    # Copy the file name to the temp name.
    (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&

    # and set any options; do chmod last to preserve setuid bits.
    #
    # If any of these fail, we abort the whole thing.  If we want to
    # ignore errors from any of these, just make sure not to ignore
    # errors from the above "$doit $cpprog $src $dsttmp" command.
    #
    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
    { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
    { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&

    # If -C, don't bother to copy if it wouldn't change the file.
    if $copy_on_change &&
       old=`LC_ALL=C ls -dlL "$dst"	2>/dev/null` &&
       new=`LC_ALL=C ls -dlL "$dsttmp"	2>/dev/null` &&

       eval "$initialize_posix_glob" &&
       $posix_glob set -f &&
       set X $old && old=:$2:$4:$5:$6 &&
       set X $new && new=:$2:$4:$5:$6 &&
       $posix_glob set +f &&

       test "$old" = "$new" &&
       $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
    then
      rm -f "$dsttmp"
    else
      # Rename the file to the real destination.
      $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||

      # The rename failed, perhaps because mv can't rename something else
      # to itself, or perhaps because mv is so ancient that it does not
      # support -f.
      {
	# Now remove or move aside any old file at destination location.
	# We try this two ways since rm can't unlink itself on some
	# systems and the destination file might be busy for other
	# reasons.  In this case, the final cleanup might fail but the new
	# file should still install successfully.
	{
	  test ! -f "$dst" ||
	  $doit $rmcmd -f "$dst" 2>/dev/null ||
	  { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
	    { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
	  } ||
	  { echo "$0: cannot unlink or rename $dst" >&2
	    (exit 1); exit 1
	  }
	} &&

	# Now rename the file to the real destination.
	$doit $mvcmd "$dsttmp" "$dst"
      }
    fi || exit 1

    trap '' 0
  fi
done

# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:


================================================
FILE: build/ltmain.sh
================================================

# libtool (GNU libtool) 2.4.2
# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996

# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions.  There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

# GNU Libtool is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# As a special exception to the GNU General Public License,
# if you distribute this file as part of a program or library that
# is built using GNU Libtool, you may include this file under the
# same distribution terms that you use for the rest of that program.
#
# GNU Libtool is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Libtool; see the file COPYING.  If not, a copy
# can be downloaded from http://www.gnu.org/licenses/gpl.html,
# or obtained by writing to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

# Usage: $progname [OPTION]... [MODE-ARG]...
#
# Provide generalized library-building support services.
#
#       --config             show all configuration variables
#       --debug              enable verbose shell tracing
#   -n, --dry-run            display commands without modifying any files
#       --features           display basic configuration information and exit
#       --mode=MODE          use operation mode MODE
#       --preserve-dup-deps  don't remove duplicate dependency libraries
#       --quiet, --silent    don't print informational messages
#       --no-quiet, --no-silent
#                            print informational messages (default)
#       --no-warn            don't display warning messages
#       --tag=TAG            use configuration variables from tag TAG
#   -v, --verbose            print more informational messages than default
#       --no-verbose         don't print the extra informational messages
#       --version            print version information
#   -h, --help, --help-all   print short, long, or detailed help message
#
# MODE must be one of the following:
#
#         clean              remove files from the build directory
#         compile            compile a source file into a libtool object
#         execute            automatically set library path, then run a program
#         finish             complete the installation of libtool libraries
#         install            install libraries or executables
#         link               create a library or an executable
#         uninstall          remove libraries from an installed directory
#
# MODE-ARGS vary depending on the MODE.  When passed as first option,
# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
#
# When reporting a bug, please describe a test case to reproduce it and
# include the following information:
#
#         host-triplet:	$host
#         shell:		$SHELL
#         compiler:		$LTCC
#         compiler flags:		$LTCFLAGS
#         linker:		$LD (gnu? $with_gnu_ld)
#         $progname:	(GNU libtool) 2.4.2 Debian-2.4.2-1ubuntu1
#         automake:	$automake_version
#         autoconf:	$autoconf_version
#
# Report bugs to <bug-libtool@gnu.org>.
# GNU libtool home page: <http://www.gnu.org/software/libtool/>.
# General help using GNU software: <http://www.gnu.org/gethelp/>.

PROGRAM=libtool
PACKAGE=libtool
VERSION="2.4.2 Debian-2.4.2-1ubuntu1"
TIMESTAMP=""
package_revision=1.3337

# Be Bourne compatible
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
  emulate sh
  NULLCMD=:
  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
  # is contrary to our usage.  Disable this feature.
  alias -g '${1+"$@"}'='"$@"'
  setopt NO_GLOB_SUBST
else
  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
fi
BIN_SH=xpg4; export BIN_SH # for Tru64
DUALCASE=1; export DUALCASE # for MKS sh

# A function that is used when there is no print builtin or printf.
func_fallback_echo ()
{
  eval 'cat <<_LTECHO_EOF
$1
_LTECHO_EOF'
}

# NLS nuisances: We save the old values to restore during execute mode.
lt_user_locale=
lt_safe_locale=
for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
do
  eval "if test \"\${$lt_var+set}\" = set; then
          save_$lt_var=\$$lt_var
          $lt_var=C
	  export $lt_var
	  lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
	  lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
	fi"
done
LC_ALL=C
LANGUAGE=C
export LANGUAGE LC_ALL

$lt_unset CDPATH


# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
# is ksh but when the shell is invoked as "sh" and the current value of
# the _XPG environment variable is not equal to 1 (one), the special
# positional parameter $0, within a function call, is the name of the
# function.
progpath="$0"



: ${CP="cp -f"}
test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
: ${MAKE="make"}
: ${MKDIR="mkdir"}
: ${MV="mv -f"}
: ${RM="rm -f"}
: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
: ${Xsed="$SED -e 1s/^X//"}

# Global variables:
EXIT_SUCCESS=0
EXIT_FAILURE=1
EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
EXIT_SKIP=77	  # $? = 77 is used to indicate a skipped test to automake.

exit_status=$EXIT_SUCCESS

# Make sure IFS has a sensible default
lt_nl='
'
IFS=" 	$lt_nl"

dirname="s,/[^/]*$,,"
basename="s,^.*/,,"

# func_dirname file append nondir_replacement
# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
# otherwise set result to NONDIR_REPLACEMENT.
func_dirname ()
{
    func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
    if test "X$func_dirname_result" = "X${1}"; then
      func_dirname_result="${3}"
    else
      func_dirname_result="$func_dirname_result${2}"
    fi
} # func_dirname may be replaced by extended shell implementation


# func_basename file
func_basename ()
{
    func_basename_result=`$ECHO "${1}" | $SED "$basename"`
} # func_basename may be replaced by extended shell implementation


# func_dirname_and_basename file append nondir_replacement
# perform func_basename and func_dirname in a single function
# call:
#   dirname:  Compute the dirname of FILE.  If nonempty,
#             add APPEND to the result, otherwise set result
#             to NONDIR_REPLACEMENT.
#             value returned in "$func_dirname_result"
#   basename: Compute filename of FILE.
#             value retuned in "$func_basename_result"
# Implementation must be kept synchronized with func_dirname
# and func_basename. For efficiency, we do not delegate to
# those functions but instead duplicate the functionality here.
func_dirname_and_basename ()
{
    # Extract subdirectory from the argument.
    func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
    if test "X$func_dirname_result" = "X${1}"; then
      func_dirname_result="${3}"
    else
      func_dirname_result="$func_dirname_result${2}"
    fi
    func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
} # func_dirname_and_basename may be replaced by extended shell implementation


# func_stripname prefix suffix name
# strip PREFIX and SUFFIX off of NAME.
# PREFIX and SUFFIX must not contain globbing or regex special
# characters, hashes, percent signs, but SUFFIX may contain a leading
# dot (in which case that matches only a dot).
# func_strip_suffix prefix name
func_stripname ()
{
    case ${2} in
      .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
      *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
    esac
} # func_stripname may be replaced by extended shell implementation


# These SED scripts presuppose an absolute path with a trailing slash.
pathcar='s,^/\([^/]*\).*$,\1,'
pathcdr='s,^/[^/]*,,'
removedotparts=':dotsl
		s@/\./@/@g
		t dotsl
		s,/\.$,/,'
collapseslashes='s@/\{1,\}@/@g'
finalslash='s,/*$,/,'

# func_normal_abspath PATH
# Remove doubled-up and trailing slashes, "." path components,
# and cancel out any ".." path components in PATH after making
# it an absolute path.
#             value returned in "$func_normal_abspath_result"
func_normal_abspath ()
{
  # Start from root dir and reassemble the path.
  func_normal_abspath_result=
  func_normal_abspath_tpath=$1
  func_normal_abspath_altnamespace=
  case $func_normal_abspath_tpath in
    "")
      # Empty path, that just means $cwd.
      func_stripname '' '/' "`pwd`"
      func_normal_abspath_result=$func_stripname_result
      return
    ;;
    # The next three entries are used to spot a run of precisely
    # two leading slashes without using negated character classes;
    # we take advantage of case's first-match behaviour.
    ///*)
      # Unusual form of absolute path, do nothing.
    ;;
    //*)
      # Not necessarily an ordinary path; POSIX reserves leading '//'
      # and for example Cygwin uses it to access remote file shares
      # over CIFS/SMB, so we conserve a leading double slash if found.
      func_normal_abspath_altnamespace=/
    ;;
    /*)
      # Absolute path, do nothing.
    ;;
    *)
      # Relative path, prepend $cwd.
      func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
    ;;
  esac
  # Cancel out all the simple stuff to save iterations.  We also want
  # the path to end with a slash for ease of parsing, so make sure
  # there is one (and only one) here.
  func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
        -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
  while :; do
    # Processed it all yet?
    if test "$func_normal_abspath_tpath" = / ; then
      # If we ascended to the root using ".." the result may be empty now.
      if test -z "$func_normal_abspath_result" ; then
        func_normal_abspath_result=/
      fi
      break
    fi
    func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
        -e "$pathcar"`
    func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
        -e "$pathcdr"`
    # Figure out what to do with it
    case $func_normal_abspath_tcomponent in
      "")
        # Trailing empty path component, ignore it.
      ;;
      ..)
        # Parent dir; strip last assembled component from result.
        func_dirname "$func_normal_abspath_result"
        func_normal_abspath_result=$func_dirname_result
      ;;
      *)
        # Actual path component, append it.
        func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
      ;;
    esac
  done
  # Restore leading double-slash if one was found on entry.
  func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
}

# func_relative_path SRCDIR DSTDIR
# generates a relative path from SRCDIR to DSTDIR, with a trailing
# slash if non-empty, suitable for immediately appending a filename
# without needing to append a separator.
#             value returned in "$func_relative_path_result"
func_relative_path ()
{
  func_relative_path_result=
  func_normal_abspath "$1"
  func_relative_path_tlibdir=$func_normal_abspath_result
  func_normal_abspath "$2"
  func_relative_path_tbindir=$func_normal_abspath_result

  # Ascend the tree starting from libdir
  while :; do
    # check if we have found a prefix of bindir
    case $func_relative_path_tbindir in
      $func_relative_path_tlibdir)
        # found an exact match
        func_relative_path_tcancelled=
        break
        ;;
      $func_relative_path_tlibdir*)
        # found a matching prefix
        func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
        func_relative_path_tcancelled=$func_stripname_result
        if test -z "$func_relative_path_result"; then
          func_relative_path_result=.
        fi
        break
        ;;
      *)
        func_dirname $func_relative_path_tlibdir
        func_relative_path_tlibdir=${func_dirname_result}
        if test "x$func_relative_path_tlibdir" = x ; then
          # Have to descend all the way to the root!
          func_relative_path_result=../$func_relative_path_result
          func_relative_path_tcancelled=$func_relative_path_tbindir
          break
        fi
        func_relative_path_result=../$func_relative_path_result
        ;;
    esac
  done

  # Now calculate path; take care to avoid doubling-up slashes.
  func_stripname '' '/' "$func_relative_path_result"
  func_relative_path_result=$func_stripname_result
  func_stripname '/' '/' "$func_relative_path_tcancelled"
  if test "x$func_stripname_result" != x ; then
    func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
  fi

  # Normalisation. If bindir is libdir, return empty string,
  # else relative path ending with a slash; either way, target
  # file name can be directly appended.
  if test ! -z "$func_relative_path_result"; then
    func_stripname './' '' "$func_relative_path_result/"
    func_relative_path_result=$func_stripname_result
  fi
}

# The name of this program:
func_dirname_and_basename "$progpath"
progname=$func_basename_result

# Make sure we have an absolute path for reexecution:
case $progpath in
  [\\/]*|[A-Za-z]:\\*) ;;
  *[\\/]*)
     progdir=$func_dirname_result
     progdir=`cd "$progdir" && pwd`
     progpath="$progdir/$progname"
     ;;
  *)
     save_IFS="$IFS"
     IFS=${PATH_SEPARATOR-:}
     for progdir in $PATH; do
       IFS="$save_IFS"
       test -x "$progdir/$progname" && break
     done
     IFS="$save_IFS"
     test -n "$progdir" || progdir=`pwd`
     progpath="$progdir/$progname"
     ;;
esac

# Sed substitution that helps us do robust quoting.  It backslashifies
# metacharacters that are still active within double-quoted strings.
Xsed="${SED}"' -e 1s/^X//'
sed_quote_subst='s/\([`"$\\]\)/\\\1/g'

# Same as above, but do not quote variable references.
double_quote_subst='s/\(["`\\]\)/\\\1/g'

# Sed substitution that turns a string into a regex matching for the
# string literally.
sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'

# Sed substitution that converts a w32 file name or path
# which contains forward slashes, into one that contains
# (escaped) backslashes.  A very naive implementation.
lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'

# Re-`\' parameter expansions in output of double_quote_subst that were
# `\'-ed in input to the same.  If an odd number of `\' preceded a '$'
# in input to double_quote_subst, that '$' was protected from expansion.
# Since each input `\' is now two `\'s, look for any number of runs of
# four `\'s followed by two `\'s and then a '$'.  `\' that '$'.
bs='\\'
bs2='\\\\'
bs4='\\\\\\\\'
dollar='\$'
sed_double_backslash="\
  s/$bs4/&\\
/g
  s/^$bs2$dollar/$bs&/
  s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
  s/\n//g"

# Standard options:
opt_dry_run=false
opt_help=false
opt_quiet=false
opt_verbose=false
opt_warning=:

# func_echo arg...
# Echo program name prefixed message, along with the current mode
# name if it has been set yet.
func_echo ()
{
    $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
}

# func_verbose arg...
# Echo program name prefixed message in verbose mode only.
func_verbose ()
{
    $opt_verbose && func_echo ${1+"$@"}

    # A bug in bash halts the script if the last line of a function
    # fails when set -e is in force, so we need another command to
    # work around that:
    :
}

# func_echo_all arg...
# Invoke $ECHO with all args, space-separated.
func_echo_all ()
{
    $ECHO "$*"
}

# func_error arg...
# Echo program name prefixed message to standard error.
func_error ()
{
    $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
}

# func_warning arg...
# Echo program name prefixed warning message to standard error.
func_warning ()
{
    $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2

    # bash bug again:
    :
}

# func_fatal_error arg...
# Echo program name prefixed message to standard error, and exit.
func_fatal_error ()
{
    func_error ${1+"$@"}
    exit $EXIT_FAILURE
}

# func_fatal_help arg...
# Echo program name prefixed message to standard error, followed by
# a help hint, and exit.
func_fatal_help ()
{
    func_error ${1+"$@"}
    func_fatal_error "$help"
}
help="Try \`$progname --help' for more information."  ## default


# func_grep expression filename
# Check whether EXPRESSION matches any line of FILENAME, without output.
func_grep ()
{
    $GREP "$1" "$2" >/dev/null 2>&1
}


# func_mkdir_p directory-path
# Make sure the entire path to DIRECTORY-PATH is available.
func_mkdir_p ()
{
    my_directory_path="$1"
    my_dir_list=

    if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then

      # Protect directory names starting with `-'
      case $my_directory_path in
        -*) my_directory_path="./$my_directory_path" ;;
      esac

      # While some portion of DIR does not yet exist...
      while test ! -d "$my_directory_path"; do
        # ...make a list in topmost first order.  Use a colon delimited
	# list incase some portion of path contains whitespace.
        my_dir_list="$my_directory_path:$my_dir_list"

        # If the last portion added has no slash in it, the list is done
        case $my_directory_path in */*) ;; *) break ;; esac

        # ...otherwise throw away the child directory and loop
        my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
      done
      my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`

      save_mkdir_p_IFS="$IFS"; IFS=':'
      for my_dir in $my_dir_list; do
	IFS="$save_mkdir_p_IFS"
        # mkdir can fail with a `File exist' error if two processes
        # try to create one of the directories concurrently.  Don't
        # stop in that case!
        $MKDIR "$my_dir" 2>/dev/null || :
      done
      IFS="$save_mkdir_p_IFS"

      # Bail out if we (or some other process) failed to create a directory.
      test -d "$my_directory_path" || \
        func_fatal_error "Failed to create \`$1'"
    fi
}


# func_mktempdir [string]
# Make a temporary directory that won't clash with other running
# libtool processes, and avoids race conditions if possible.  If
# given, STRING is the basename for that directory.
func_mktempdir ()
{
    my_template="${TMPDIR-/tmp}/${1-$progname}"

    if test "$opt_dry_run" = ":"; then
      # Return a directory name, but don't create it in dry-run mode
      my_tmpdir="${my_template}-$$"
    else

      # If mktemp works, use that first and foremost
      my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`

      if test ! -d "$my_tmpdir"; then
        # Failing that, at least try and use $RANDOM to avoid a race
        my_tmpdir="${my_template}-${RANDOM-0}$$"

        save_mktempdir_umask=`umask`
        umask 0077
        $MKDIR "$my_tmpdir"
        umask $save_mktempdir_umask
      fi

      # If we're not in dry-run mode, bomb out on failure
      test -d "$my_tmpdir" || \
        func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
    fi

    $ECHO "$my_tmpdir"
}


# func_quote_for_eval arg
# Aesthetically quote ARG to be evaled later.
# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
# is double-quoted, suitable for a subsequent eval, whereas
# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
# which are still active within double quotes backslashified.
func_quote_for_eval ()
{
    case $1 in
      *[\\\`\"\$]*)
	func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
      *)
        func_quote_for_eval_unquoted_result="$1" ;;
    esac

    case $func_quote_for_eval_unquoted_result in
      # Double-quote args containing shell metacharacters to delay
      # word splitting, command substitution and and variable
      # expansion for a subsequent eval.
      # Many Bourne shells cannot handle close brackets correctly
      # in scan sets, so we specify it separately.
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
        func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
        ;;
      *)
        func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
    esac
}


# func_quote_for_expand arg
# Aesthetically quote ARG to be evaled later; same as above,
# but do not quote variable references.
func_quote_for_expand ()
{
    case $1 in
      *[\\\`\"]*)
	my_arg=`$ECHO "$1" | $SED \
	    -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
      *)
        my_arg="$1" ;;
    esac

    case $my_arg in
      # Double-quote args containing shell metacharacters to delay
      # word splitting and command substitution for a subsequent eval.
      # Many Bourne shells cannot handle close brackets correctly
      # in scan sets, so we specify it separately.
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
        my_arg="\"$my_arg\""
        ;;
    esac

    func_quote_for_expand_result="$my_arg"
}


# func_show_eval cmd [fail_exp]
# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
# is given, then evaluate it.
func_show_eval ()
{
    my_cmd="$1"
    my_fail_exp="${2-:}"

    ${opt_silent-false} || {
      func_quote_for_expand "$my_cmd"
      eval "func_echo $func_quote_for_expand_result"
    }

    if ${opt_dry_run-false}; then :; else
      eval "$my_cmd"
      my_status=$?
      if test "$my_status" -eq 0; then :; else
	eval "(exit $my_status); $my_fail_exp"
      fi
    fi
}


# func_show_eval_locale cmd [fail_exp]
# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
# is given, then evaluate it.  Use the saved locale for evaluation.
func_show_eval_locale ()
{
    my_cmd="$1"
    my_fail_exp="${2-:}"

    ${opt_silent-false} || {
      func_quote_for_expand "$my_cmd"
      eval "func_echo $func_quote_for_expand_result"
    }

    if ${opt_dry_run-false}; then :; else
      eval "$lt_user_locale
	    $my_cmd"
      my_status=$?
      eval "$lt_safe_locale"
      if test "$my_status" -eq 0; then :; else
	eval "(exit $my_status); $my_fail_exp"
      fi
    fi
}

# func_tr_sh
# Turn $1 into a string suitable for a shell variable name.
# Result is stored in $func_tr_sh_result.  All characters
# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
# if $1 begins with a digit, a '_' is prepended as well.
func_tr_sh ()
{
  case $1 in
  [0-9]* | *[!a-zA-Z0-9_]*)
    func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
    ;;
  * )
    func_tr_sh_result=$1
    ;;
  esac
}


# func_version
# Echo version message to standard output and exit.
func_version ()
{
    $opt_debug

    $SED -n '/(C)/!b go
	:more
	/\./!{
	  N
	  s/\n# / /
	  b more
	}
	:go
	/^# '$PROGRAM' (GNU /,/# warranty; / {
        s/^# //
	s/^# *$//
        s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
        p
     }' < "$progpath"
     exit $?
}

# func_usage
# Echo short help message to standard output and exit.
func_usage ()
{
    $opt_debug

    $SED -n '/^# Usage:/,/^#  *.*--help/ {
        s/^# //
	s/^# *$//
	s/\$progname/'$progname'/
	p
    }' < "$progpath"
    echo
    $ECHO "run \`$progname --help | more' for full usage"
    exit $?
}

# func_help [NOEXIT]
# Echo long help message to standard output and exit,
# unless 'noexit' is passed as argument.
func_help ()
{
    $opt_debug

    $SED -n '/^# Usage:/,/# Report bugs to/ {
	:print
        s/^# //
	s/^# *$//
	s*\$progname*'$progname'*
	s*\$host*'"$host"'*
	s*\$SHELL*'"$SHELL"'*
	s*\$LTCC*'"$LTCC"'*
	s*\$LTCFLAGS*'"$LTCFLAGS"'*
	s*\$LD*'"$LD"'*
	s/\$with_gnu_ld/'"$with_gnu_ld"'/
	s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
	s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
	p
	d
     }
     /^# .* home page:/b print
     /^# General help using/b print
     ' < "$progpath"
    ret=$?
    if test -z "$1"; then
      exit $ret
    fi
}

# func_missing_arg argname
# Echo program name prefixed message to standard error and set global
# exit_cmd.
func_missing_arg ()
{
    $opt_debug

    func_error "missing argument for $1."
    exit_cmd=exit
}


# func_split_short_opt shortopt
# Set func_split_short_opt_name and func_split_short_opt_arg shell
# variables after splitting SHORTOPT after the 2nd character.
func_split_short_opt ()
{
    my_sed_short_opt='1s/^\(..\).*$/\1/;q'
    my_sed_short_rest='1s/^..\(.*\)$/\1/;q'

    func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
    func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
} # func_split_short_opt may be replaced by extended shell implementation


# func_split_long_opt longopt
# Set func_split_long_opt_name and func_split_long_opt_arg shell
# variables after splitting LONGOPT at the `=' sign.
func_split_long_opt ()
{
    my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
    my_sed_long_arg='1s/^--[^=]*=//'

    func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
    func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
} # func_split_long_opt may be replaced by extended shell implementation

exit_cmd=:





magic="%%%MAGIC variable%%%"
magic_exe="%%%MAGIC EXE variable%%%"

# Global variables.
nonopt=
preserve_args=
lo2o="s/\\.lo\$/.${objext}/"
o2lo="s/\\.${objext}\$/.lo/"
extracted_archives=
extracted_serial=0

# If this variable is set in any of the actions, the command in it
# will be execed at the end.  This prevents here-documents from being
# left over by shells.
exec_cmd=

# func_append var value
# Append VALUE to the end of shell variable VAR.
func_append ()
{
    eval "${1}=\$${1}\${2}"
} # func_append may be replaced by extended shell implementation

# func_append_quoted var value
# Quote VALUE and append to the end of shell variable VAR, separated
# by a space.
func_append_quoted ()
{
    func_quote_for_eval "${2}"
    eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
} # func_append_quoted may be replaced by extended shell implementation


# func_arith arithmetic-term...
func_arith ()
{
    func_arith_result=`expr "${@}"`
} # func_arith may be replaced by extended shell implementation


# func_len string
# STRING may not start with a hyphen.
func_len ()
{
    func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
} # func_len may be replaced by extended shell implementation


# func_lo2o object
func_lo2o ()
{
    func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
} # func_lo2o may be replaced by extended shell implementation


# func_xform libobj-or-source
func_xform ()
{
    func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
} # func_xform may be replaced by extended shell implementation


# func_fatal_configuration arg...
# Echo program name prefixed message to standard error, followed by
# a configuration failure hint, and exit.
func_fatal_configuration ()
{
    func_error ${1+"$@"}
    func_error "See the $PACKAGE documentation for more information."
    func_fatal_error "Fatal configuration error."
}


# func_config
# Display the configuration for all the tags in this script.
func_config ()
{
    re_begincf='^# ### BEGIN LIBTOOL'
    re_endcf='^# ### END LIBTOOL'

    # Default configuration.
    $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"

    # Now print the configurations for the tags.
    for tagname in $taglist; do
      $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
    done

    exit $?
}

# func_features
# Display the features supported by this script.
func_features ()
{
    echo "host: $host"
    if test "$build_libtool_libs" = yes; then
      echo "enable shared libraries"
    else
      echo "disable shared libraries"
    fi
    if test "$build_old_libs" = yes; then
      echo "enable static libraries"
    else
      echo "disable static libraries"
    fi

    exit $?
}

# func_enable_tag tagname
# Verify that TAGNAME is valid, and either flag an error and exit, or
# enable the TAGNAME tag.  We also add TAGNAME to the global $taglist
# variable here.
func_enable_tag ()
{
  # Global variable:
  tagname="$1"

  re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
  re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
  sed_extractcf="/$re_begincf/,/$re_endcf/p"

  # Validate tagname.
  case $tagname in
    *[!-_A-Za-z0-9,/]*)
      func_fatal_error "invalid tag name: $tagname"
      ;;
  esac

  # Don't test for the "default" C tag, as we know it's
  # there but not specially marked.
  case $tagname in
    CC) ;;
    *)
      if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
	taglist="$taglist $tagname"

	# Evaluate the configuration.  Be careful to quote the path
	# and the sed script, to avoid splitting on whitespace, but
	# also don't use non-portable quotes within backquotes within
	# quotes we have to do it in 2 steps:
	extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
	eval "$extractedcf"
      else
	func_error "ignoring unknown tag $tagname"
      fi
      ;;
  esac
}

# func_check_version_match
# Ensure that we are using m4 macros, and libtool script from the same
# release of libtool.
func_check_version_match ()
{
  if test "$package_revision" != "$macro_revision"; then
    if test "$VERSION" != "$macro_version"; then
      if test -z "$macro_version"; then
        cat >&2 <<_LT_EOF
$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
$progname: definition of this LT_INIT comes from an older release.
$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
$progname: and run autoconf again.
_LT_EOF
      else
        cat >&2 <<_LT_EOF
$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
$progname: and run autoconf again.
_LT_EOF
      fi
    else
      cat >&2 <<_LT_EOF
$progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
$progname: but the definition of this LT_INIT comes from revision $macro_revision.
$progname: You should recreate aclocal.m4 with macros from revision $package_revision
$progname: of $PACKAGE $VERSION and run autoconf again.
_LT_EOF
    fi

    exit $EXIT_MISMATCH
  fi
}


# Shorthand for --mode=foo, only valid as the first argument
case $1 in
clean|clea|cle|cl)
  shift; set dummy --mode clean ${1+"$@"}; shift
  ;;
compile|compil|compi|comp|com|co|c)
  shift; set dummy --mode compile ${1+"$@"}; shift
  ;;
execute|execut|execu|exec|exe|ex|e)
  shift; set dummy --mode execute ${1+"$@"}; shift
  ;;
finish|finis|fini|fin|fi|f)
  shift; set dummy --mode finish ${1+"$@"}; shift
  ;;
install|instal|insta|inst|ins|in|i)
  shift; set dummy --mode install ${1+"$@"}; shift
  ;;
link|lin|li|l)
  shift; set dummy --mode link ${1+"$@"}; shift
  ;;
uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
  shift; set dummy --mode uninstall ${1+"$@"}; shift
  ;;
esac



# Option defaults:
opt_debug=:
opt_dry_run=false
opt_config=false
opt_preserve_dup_deps=false
opt_features=false
opt_finish=false
opt_help=false
opt_help_all=false
opt_silent=:
opt_warning=:
opt_verbose=:
opt_silent=false
opt_verbose=false


# Parse options once, thoroughly.  This comes as soon as possible in the
# script to make things like `--version' happen as quickly as we can.
{
  # this just eases exit handling
  while test $# -gt 0; do
    opt="$1"
    shift
    case $opt in
      --debug|-x)	opt_debug='set -x'
			func_echo "enabling shell trace mode"
			$opt_debug
			;;
      --dry-run|--dryrun|-n)
			opt_dry_run=:
			;;
      --config)
			opt_config=:
func_config
			;;
      --dlopen|-dlopen)
			optarg="$1"
			opt_dlopen="${opt_dlopen+$opt_dlopen
}$optarg"
			shift
			;;
      --preserve-dup-deps)
			opt_preserve_dup_deps=:
			;;
      --features)
			opt_features=:
func_features
			;;
      --finish)
			opt_finish=:
set dummy --mode finish ${1+"$@"}; shift
			;;
      --help)
			opt_help=:
			;;
      --help-all)
			opt_help_all=:
opt_help=': help-all'
			;;
      --mode)
			test $# = 0 && func_missing_arg $opt && break
			optarg="$1"
			opt_mode="$optarg"
case $optarg in
  # Valid mode arguments:
  clean|compile|execute|finish|install|link|relink|uninstall) ;;

  # Catch anything else as an error
  *) func_error "invalid argument for $opt"
     exit_cmd=exit
     break
     ;;
esac
			shift
			;;
      --no-silent|--no-quiet)
			opt_silent=false
func_append preserve_args " $opt"
			;;
      --no-warning|--no-warn)
			opt_warning=false
func_append preserve_args " $opt"
			;;
      --no-verbose)
			opt_verbose=false
func_append preserve_args " $opt"
			;;
      --silent|--quiet)
			opt_silent=:
func_append preserve_args " $opt"
        opt_verbose=false
			;;
      --verbose|-v)
			opt_verbose=:
func_append preserve_args " $opt"
opt_silent=false
			;;
      --tag)
			test $# = 0 && func_missing_arg $opt && break
			optarg="$1"
			opt_tag="$optarg"
func_append preserve_args " $opt $optarg"
func_enable_tag "$optarg"
			shift
			;;

      -\?|-h)		func_usage				;;
      --help)		func_help				;;
      --version)	func_version				;;

      # Separate optargs to long options:
      --*=*)
			func_split_long_opt "$opt"
			set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
			shift
			;;

      # Separate non-argument short options:
      -\?*|-h*|-n*|-v*)
			func_split_short_opt "$opt"
			set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
			shift
			;;

      --)		break					;;
      -*)		func_fatal_help "unrecognized option \`$opt'" ;;
      *)		set dummy "$opt" ${1+"$@"};	shift; break  ;;
    esac
  done

  # Validate options:

  # save first non-option argument
  if test "$#" -gt 0; then
    nonopt="$opt"
    shift
  fi

  # preserve --debug
  test "$opt_debug" = : || func_append preserve_args " --debug"

  case $host in
    *cygwin* | *mingw* | *pw32* | *cegcc*)
      # don't eliminate duplications in $postdeps and $predeps
      opt_duplicate_compiler_generated_deps=:
      ;;
    *)
      opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
      ;;
  esac

  $opt_help || {
    # Sanity checks first:
    func_check_version_match

    if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
      func_fatal_configuration "not configured to build any kind of library"
    fi

    # Darwin sucks
    eval std_shrext=\"$shrext_cmds\"

    # Only execute mode is allowed to have -dlopen flags.
    if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
      func_error "unrecognized option \`-dlopen'"
      $ECHO "$help" 1>&2
      exit $EXIT_FAILURE
    fi

    # Change the help message to a mode-specific one.
    generic_help="$help"
    help="Try \`$progname --help --mode=$opt_mode' for more information."
  }


  # Bail if the options were screwed
  $exit_cmd $EXIT_FAILURE
}




## ----------- ##
##    Main.    ##
## ----------- ##

# func_lalib_p file
# True iff FILE is a libtool `.la' library or `.lo' object file.
# This function is only a basic sanity check; it will hardly flush out
# determined imposters.
func_lalib_p ()
{
    test -f "$1" &&
      $SED -e 4q "$1" 2>/dev/null \
        | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
}

# func_lalib_unsafe_p file
# True iff FILE is a libtool `.la' library or `.lo' object file.
# This function implements the same check as func_lalib_p without
# resorting to external programs.  To this end, it redirects stdin and
# closes it afterwards, without saving the original file descriptor.
# As a safety measure, use it only where a negative result would be
# fatal anyway.  Works if `file' does not exist.
func_lalib_unsafe_p ()
{
    lalib_p=no
    if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
	for lalib_p_l in 1 2 3 4
	do
	    read lalib_p_line
	    case "$lalib_p_line" in
		\#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
	    esac
	done
	exec 0<&5 5<&-
    fi
    test "$lalib_p" = yes
}

# func_ltwrapper_script_p file
# True iff FILE is a libtool wrapper script
# This function is only a basic sanity check; it will hardly flush out
# determined imposters.
func_ltwrapper_script_p ()
{
    func_lalib_p "$1"
}

# func_ltwrapper_executable_p file
# True iff FILE is a libtool wrapper executable
# This function is only a basic sanity check; it will hardly flush out
# determined imposters.
func_ltwrapper_executable_p ()
{
    func_ltwrapper_exec_suffix=
    case $1 in
    *.exe) ;;
    *) func_ltwrapper_exec_suffix=.exe ;;
    esac
    $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
}

# func_ltwrapper_scriptname file
# Assumes file is an ltwrapper_executable
# uses $file to determine the appropriate filename for a
# temporary ltwrapper_script.
func_ltwrapper_scriptname ()
{
    func_dirname_and_basename "$1" "" "."
    func_stripname '' '.exe' "$func_basename_result"
    func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
}

# func_ltwrapper_p file
# True iff FILE is a libtool wrapper script or wrapper executable
# This function is only a basic sanity check; it will hardly flush out
# determined imposters.
func_ltwrapper_p ()
{
    func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
}


# func_execute_cmds commands fail_cmd
# Execute tilde-delimited COMMANDS.
# If FAIL_CMD is given, eval that upon failure.
# FAIL_CMD may read-access the current command in variable CMD!
func_execute_cmds ()
{
    $opt_debug
    save_ifs=$IFS; IFS='~'
    for cmd in $1; do
      IFS=$save_ifs
      eval cmd=\"$cmd\"
      func_show_eval "$cmd" "${2-:}"
    done
    IFS=$save_ifs
}


# func_source file
# Source FILE, adding directory component if necessary.
# Note that it is not necessary on cygwin/mingw to append a dot to
# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
# behavior happens only for exec(3), not for open(2)!  Also, sourcing
# `FILE.' does not work on cygwin managed mounts.
func_source ()
{
    $opt_debug
    case $1 in
    */* | *\\*)	. "$1" ;;
    *)		. "./$1" ;;
    esac
}


# func_resolve_sysroot PATH
# Replace a leading = in PATH with a sysroot.  Store the result into
# func_resolve_sysroot_result
func_resolve_sysroot ()
{
  func_resolve_sysroot_result=$1
  case $func_resolve_sysroot_result in
  =*)
    func_stripname '=' '' "$func_resolve_sysroot_result"
    func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
    ;;
  esac
}

# func_replace_sysroot PATH
# If PATH begins with the sysroot, replace it with = and
# store the result into func_replace_sysroot_result.
func_replace_sysroot ()
{
  case "$lt_sysroot:$1" in
  ?*:"$lt_sysroot"*)
    func_stripname "$lt_sysroot" '' "$1"
    func_replace_sysroot_result="=$func_stripname_result"
    ;;
  *)
    # Including no sysroot.
    func_replace_sysroot_result=$1
    ;;
  esac
}

# func_infer_tag arg
# Infer tagged configuration to use if any are available and
# if one wasn't chosen via the "--tag" command line option.
# Only attempt this if the compiler in the base compile
# command doesn't match the default compiler.
# arg is usually of the form 'gcc ...'
func_infer_tag ()
{
    $opt_debug
    if test -n "$available_tags" && test -z "$tagname"; then
      CC_quoted=
      for arg in $CC; do
	func_append_quoted CC_quoted "$arg"
      done
      CC_expanded=`func_echo_all $CC`
      CC_quoted_expanded=`func_echo_all $CC_quoted`
      case $@ in
      # Blanks in the command may have been stripped by the calling shell,
      # but not from the CC environment variable when configure was run.
      " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
      " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
      # Blanks at the start of $base_compile will cause this to fail
      # if we don't check for them as well.
      *)
	for z in $available_tags; do
	  if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
	    # Evaluate the configuration.
	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
	    CC_quoted=
	    for arg in $CC; do
	      # Double-quote args containing other shell metacharacters.
	      func_append_quoted CC_quoted "$arg"
	    done
	    CC_expanded=`func_echo_all $CC`
	    CC_quoted_expanded=`func_echo_all $CC_quoted`
	    case "$@ " in
	    " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
	    " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
	      # The compiler in the base compile command matches
	      # the one in the tagged configuration.
	      # Assume this is the tagged configuration we want.
	      tagname=$z
	      break
	      ;;
	    esac
	  fi
	done
	# If $tagname still isn't set, then no tagged configuration
	# was found and let the user know that the "--tag" command
	# line option must be used.
	if test -z "$tagname"; then
	  func_echo "unable to infer tagged configuration"
	  func_fatal_error "specify a tag with \`--tag'"
#	else
#	  func_verbose "using $tagname tagged configuration"
	fi
	;;
      esac
    fi
}



# func_write_libtool_object output_name pic_name nonpic_name
# Create a libtool object file (analogous to a ".la" file),
# but don't create it if we're doing a dry run.
func_write_libtool_object ()
{
    write_libobj=${1}
    if test "$build_libtool_libs" = yes; then
      write_lobj=\'${2}\'
    else
      write_lobj=none
    fi

    if test "$build_old_libs" = yes; then
      write_oldobj=\'${3}\'
    else
      write_oldobj=none
    fi

    $opt_dry_run || {
      cat >${write_libobj}T <<EOF
# $write_libobj - a libtool object file
# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
#
# Please DO NOT delete this file!
# It is necessary for linking the library.

# Name of the PIC object.
pic_object=$write_lobj

# Name of the non-PIC object
non_pic_object=$write_oldobj

EOF
      $MV "${write_libobj}T" "${write_libobj}"
    }
}


##################################################
# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
##################################################

# func_convert_core_file_wine_to_w32 ARG
# Helper function used by file name conversion functions when $build is *nix,
# and $host is mingw, cygwin, or some other w32 environment. Relies on a
# correctly configured wine environment available, with the winepath program
# in $build's $PATH.
#
# ARG is the $build file name to be converted to w32 format.
# Result is available in $func_convert_core_file_wine_to_w32_result, and will
# be empty on error (or when ARG is empty)
func_convert_core_file_wine_to_w32 ()
{
  $opt_debug
  func_convert_core_file_wine_to_w32_result="$1"
  if test -n "$1"; then
    # Unfortunately, winepath does not exit with a non-zero error code, so we
    # are forced to check the contents of stdout. On the other hand, if the
    # command is not found, the shell will set an exit code of 127 and print
    # *an error message* to stdout. So we must check for both error code of
    # zero AND non-empty stdout, which explains the odd construction:
    func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
    if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
      func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
        $SED -e "$lt_sed_naive_backslashify"`
    else
      func_convert_core_file_wine_to_w32_result=
    fi
  fi
}
# end: func_convert_core_file_wine_to_w32


# func_convert_core_path_wine_to_w32 ARG
# Helper function used by path conversion functions when $build is *nix, and
# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
# configured wine environment available, with the winepath program in $build's
# $PATH. Assumes ARG has no leading or trailing path separator characters.
#
# ARG is path to be converted from $build format to win32.
# Result is available in $func_convert_core_path_wine_to_w32_result.
# Unconvertible file (directory) names in ARG are skipped; if no directory names
# are convertible, then the result may be empty.
func_convert_core_path_wine_to_w32 ()
{
  $opt_debug
  # unfortunately, winepath doesn't convert paths, only file names
  func_convert_core_path_wine_to_w32_result=""
  if test -n "$1"; then
    oldIFS=$IFS
    IFS=:
    for func_convert_core_path_wine_to_w32_f in $1; do
      IFS=$oldIFS
      func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
      if test -n "$func_convert_core_file_wine_to_w32_result" ; then
        if test -z "$func_convert_core_path_wine_to_w32_result"; then
          func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
        else
          func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
        fi
      fi
    done
    IFS=$oldIFS
  fi
}
# end: func_convert_core_path_wine_to_w32


# func_cygpath ARGS...
# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
# (2), returns the Cygwin file name or path in func_cygpath_result (input
# file name or path is assumed to be in w32 format, as previously converted
# from $build's *nix or MSYS format). In case (3), returns the w32 file name
# or path in func_cygpath_result (input file name or path is assumed to be in
# Cygwin format). Returns an empty string on error.
#
# ARGS are passed to cygpath, with the last one being the file name or path to
# be converted.
#
# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
# environment variable; do not put it in $PATH.
func_cygpath ()
{
  $opt_debug
  if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
    func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
    if test "$?" -ne 0; then
      # on failure, ensure result is empty
      func_cygpath_result=
    fi
  else
    func_cygpath_result=
    func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
  fi
}
#end: func_cygpath


# func_convert_core_msys_to_w32 ARG
# Convert file name or path ARG from MSYS format to w32 format.  Return
# result in func_convert_core_msys_to_w32_result.
func_convert_core_msys_to_w32 ()
{
  $opt_debug
  # awkward: cmd appends spaces to result
  func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
    $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
}
#end: func_convert_core_msys_to_w32


# func_convert_file_check ARG1 ARG2
# Verify that ARG1 (a file name in $build format) was converted to $host
# format in ARG2. Otherwise, emit an error message, but continue (resetting
# func_to_host_file_result to ARG1).
func_convert_file_check ()
{
  $opt_debug
  if test -z "$2" && test -n "$1" ; then
    func_error "Could not determine host file name corresponding to"
    func_error "  \`$1'"
    func_error "Continuing, but uninstalled executables may not work."
    # Fallback:
    func_to_host_file_result="$1"
  fi
}
# end func_convert_file_check


# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
# Verify that FROM_PATH (a path in $build format) was converted to $host
# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
# func_to_host_file_result to a simplistic fallback value (see below).
func_convert_path_check ()
{
  $opt_debug
  if test -z "$4" && test -n "$3"; then
    func_error "Could not determine the host path corresponding to"
    func_error "  \`$3'"
    func_error "Continuing, but uninstalled executables may not work."
    # Fallback.  This is a deliberately simplistic "conversion" and
    # should not be "improved".  See libtool.info.
    if test "x$1" != "x$2"; then
      lt_replace_pathsep_chars="s|$1|$2|g"
      func_to_host_path_result=`echo "$3" |
        $SED -e "$lt_replace_pathsep_chars"`
    else
      func_to_host_path_result="$3"
    fi
  fi
}
# end func_convert_path_check


# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
# and appending REPL if ORIG matches BACKPAT.
func_convert_path_front_back_pathsep ()
{
  $opt_debug
  case $4 in
  $1 ) func_to_host_path_result="$3$func_to_host_path_result"
    ;;
  esac
  case $4 in
  $2 ) func_append func_to_host_path_result "$3"
    ;;
  esac
}
# end func_convert_path_front_back_pathsep


##################################################
# $build to $host FILE NAME CONVERSION FUNCTIONS #
##################################################
# invoked via `$to_host_file_cmd ARG'
#
# In each case, ARG is the path to be converted from $build to $host format.
# Result will be available in $func_to_host_file_result.


# func_to_host_file ARG
# Converts the file name ARG from $build format to $host format. Return result
# in func_to_host_file_result.
func_to_host_file ()
{
  $opt_debug
  $to_host_file_cmd "$1"
}
# end func_to_host_file


# func_to_tool_file ARG LAZY
# converts the file name ARG from $build format to toolchain format. Return
# result in func_to_tool_file_result.  If the conversion in use is listed
# in (the comma separated) LAZY, no conversion takes place.
func_to_tool_file ()
{
  $opt_debug
  case ,$2, in
    *,"$to_tool_file_cmd",*)
      func_to_tool_file_result=$1
      ;;
    *)
      $to_tool_file_cmd "$1"
      func_to_tool_file_result=$func_to_host_file_result
      ;;
  esac
}
# end func_to_tool_file


# func_convert_file_noop ARG
# Copy ARG to func_to_host_file_result.
func_convert_file_noop ()
{
  func_to_host_file_result="$1"
}
# end func_convert_file_noop


# func_convert_file_msys_to_w32 ARG
# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
# conversion to w32 is not available inside the cwrapper.  Returns result in
# func_to_host_file_result.
func_convert_file_msys_to_w32 ()
{
  $opt_debug
  func_to_host_file_result="$1"
  if test -n "$1"; then
    func_convert_core_msys_to_w32 "$1"
    func_to_host_file_result="$func_convert_core_msys_to_w32_result"
  fi
  func_convert_file_check "$1" "$func_to_host_file_result"
}
# end func_convert_file_msys_to_w32


# func_convert_file_cygwin_to_w32 ARG
# Convert file name ARG from Cygwin to w32 format.  Returns result in
# func_to_host_file_result.
func_convert_file_cygwin_to_w32 ()
{
  $opt_debug
  func_to_host_file_result="$1"
  if test -n "$1"; then
    # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
    # LT_CYGPATH in this case.
    func_to_host_file_result=`cygpath -m "$1"`
  fi
  func_convert_file_check "$1" "$func_to_host_file_result"
}
# end func_convert_file_cygwin_to_w32


# func_convert_file_nix_to_w32 ARG
# Convert file name ARG from *nix to w32 format.  Requires a wine environment
# and a working winepath. Returns result in func_to_host_file_result.
func_convert_file_nix_to_w32 ()
{
  $opt_debug
  func_to_host_file_result="$1"
  if test -n "$1"; then
    func_convert_core_file_wine_to_w32 "$1"
    func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
  fi
  func_convert_file_check "$1" "$func_to_host_file_result"
}
# end func_convert_file_nix_to_w32


# func_convert_file_msys_to_cygwin ARG
# Convert file name ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
# Returns result in func_to_host_file_result.
func_convert_file_msys_to_cygwin ()
{
  $opt_debug
  func_to_host_file_result="$1"
  if test -n "$1"; then
    func_convert_core_msys_to_w32 "$1"
    func_cygpath -u "$func_convert_core_msys_to_w32_result"
    func_to_host_file_result="$func_cygpath_result"
  fi
  func_convert_file_check "$1" "$func_to_host_file_result"
}
# end func_convert_file_msys_to_cygwin


# func_convert_file_nix_to_cygwin ARG
# Convert file name ARG from *nix to Cygwin format.  Requires Cygwin installed
# in a wine environment, working winepath, and LT_CYGPATH set.  Returns result
# in func_to_host_file_result.
func_convert_file_nix_to_cygwin ()
{
  $opt_debug
  func_to_host_file_result="$1"
  if test -n "$1"; then
    # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
    func_convert_core_file_wine_to_w32 "$1"
    func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
    func_to_host_file_result="$func_cygpath_result"
  fi
  func_convert_file_check "$1" "$func_to_host_file_result"
}
# end func_convert_file_nix_to_cygwin


#############################################
# $build to $host PATH CONVERSION FUNCTIONS #
#############################################
# invoked via `$to_host_path_cmd ARG'
#
# In each case, ARG is the path to be converted from $build to $host format.
# The result will be available in $func_to_host_path_result.
#
# Path separators are also converted from $build format to $host format.  If
# ARG begins or ends with a path separator character, it is preserved (but
# converted to $host format) on output.
#
# All path conversion functions are named using the following convention:
#   file name conversion function    : func_convert_file_X_to_Y ()
#   path conversion function         : func_convert_path_X_to_Y ()
# where, for any given $build/$host combination the 'X_to_Y' value is the
# same.  If conversion functions are added for new $build/$host combinations,
# the two new functions must follow this pattern, or func_init_to_host_path_cmd
# will break.


# func_init_to_host_path_cmd
# Ensures that function "pointer" variable $to_host_path_cmd is set to the
# appropriate value, based on the value of $to_host_file_cmd.
to_host_path_cmd=
func_init_to_host_path_cmd ()
{
  $opt_debug
  if test -z "$to_host_path_cmd"; then
    func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
    to_host_path_cmd="func_convert_path_${func_stripname_result}"
  fi
}


# func_to_host_path ARG
# Converts the path ARG from $build format to $host format. Return result
# in func_to_host_path_result.
func_to_host_path ()
{
  $opt_debug
  func_init_to_host_path_cmd
  $to_host_path_cmd "$1"
}
# end func_to_host_path


# func_convert_path_noop ARG
# Copy ARG to func_to_host_path_result.
func_convert_path_noop ()
{
  func_to_host_path_result="$1"
}
# end func_convert_path_noop


# func_convert_path_msys_to_w32 ARG
# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
# conversion to w32 is not available inside the cwrapper.  Returns result in
# func_to_host_path_result.
func_convert_path_msys_to_w32 ()
{
  $opt_debug
  func_to_host_path_result="$1"
  if test -n "$1"; then
    # Remove leading and trailing path separator characters from ARG.  MSYS
    # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
    # and winepath ignores them completely.
    func_stripname : : "$1"
    func_to_host_path_tmp1=$func_stripname_result
    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
    func_to_host_path_result="$func_convert_core_msys_to_w32_result"
    func_convert_path_check : ";" \
      "$func_to_host_path_tmp1" "$func_to_host_path_result"
    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
  fi
}
# end func_convert_path_msys_to_w32


# func_convert_path_cygwin_to_w32 ARG
# Convert path ARG from Cygwin to w32 format.  Returns result in
# func_to_host_file_result.
func_convert_path_cygwin_to_w32 ()
{
  $opt_debug
  func_to_host_path_result="$1"
  if test -n "$1"; then
    # See func_convert_path_msys_to_w32:
    func_stripname : : "$1"
    func_to_host_path_tmp1=$func_stripname_result
    func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
    func_convert_path_check : ";" \
      "$func_to_host_path_tmp1" "$func_to_host_path_result"
    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
  fi
}
# end func_convert_path_cygwin_to_w32


# func_convert_path_nix_to_w32 ARG
# Convert path ARG from *nix to w32 format.  Requires a wine environment and
# a working winepath.  Returns result in func_to_host_file_result.
func_convert_path_nix_to_w32 ()
{
  $opt_debug
  func_to_host_path_result="$1"
  if test -n "$1"; then
    # See func_convert_path_msys_to_w32:
    func_stripname : : "$1"
    func_to_host_path_tmp1=$func_stripname_result
    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
    func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
    func_convert_path_check : ";" \
      "$func_to_host_path_tmp1" "$func_to_host_path_result"
    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
  fi
}
# end func_convert_path_nix_to_w32


# func_convert_path_msys_to_cygwin ARG
# Convert path ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
# Returns result in func_to_host_file_result.
func_convert_path_msys_to_cygwin ()
{
  $opt_debug
  func_to_host_path_result="$1"
  if test -n "$1"; then
    # See func_convert_path_msys_to_w32:
    func_stripname : : "$1"
    func_to_host_path_tmp1=$func_stripname_result
    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
    func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
    func_to_host_path_result="$func_cygpath_result"
    func_convert_path_check : : \
      "$func_to_host_path_tmp1" "$func_to_host_path_result"
    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
  fi
}
# end func_convert_path_msys_to_cygwin


# func_convert_path_nix_to_cygwin ARG
# Convert path ARG from *nix to Cygwin format.  Requires Cygwin installed in a
# a wine environment, working winepath, and LT_CYGPATH set.  Returns result in
# func_to_host_file_result.
func_convert_path_nix_to_cygwin ()
{
  $opt_debug
  func_to_host_path_result="$1"
  if test -n "$1"; then
    # Remove leading and trailing path separator characters from
    # ARG. msys behavior is inconsistent here, cygpath turns them
    # into '.;' and ';.', and winepath ignores them completely.
    func_stripname : : "$1"
    func_to_host_path_tmp1=$func_stripname_result
    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
    func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
    func_to_host_path_result="$func_cygpath_result"
    func_convert_path_check : : \
      "$func_to_host_path_tmp1" "$func_to_host_path_result"
    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
  fi
}
# end func_convert_path_nix_to_cygwin


# func_mode_compile arg...
func_mode_compile ()
{
    $opt_debug
    # Get the compilation command and the source file.
    base_compile=
    srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
    suppress_opt=yes
    suppress_output=
    arg_mode=normal
    libobj=
    later=
    pie_flag=

    for arg
    do
      case $arg_mode in
      arg  )
	# do not "continue".  Instead, add this to base_compile
	lastarg="$arg"
	arg_mode=normal
	;;

      target )
	libobj="$arg"
	arg_mode=normal
	continue
	;;

      normal )
	# Accept any command-line options.
	case $arg in
	-o)
	  test -n "$libobj" && \
	    func_fatal_error "you cannot specify \`-o' more than once"
	  arg_mode=target
	  continue
	  ;;

	-pie | -fpie | -fPIE)
          func_append pie_flag " $arg"
	  continue
	  ;;

	-shared | -static | -prefer-pic | -prefer-non-pic)
	  func_append later " $arg"
	  continue
	  ;;

	-no-suppress)
	  suppress_opt=no
	  continue
	  ;;

	-Xcompiler)
	  arg_mode=arg  #  the next one goes into the "base_compile" arg list
	  continue      #  The current "srcfile" will either be retained or
	  ;;            #  replaced later.  I would guess that would be a bug.

	-Wc,*)
	  func_stripname '-Wc,' '' "$arg"
	  args=$func_stripname_result
	  lastarg=
	  save_ifs="$IFS"; IFS=','
	  for arg in $args; do
	    IFS="$save_ifs"
	    func_append_quoted lastarg "$arg"
	  done
	  IFS="$save_ifs"
	  func_stripname ' '
Download .txt
gitextract_vuzdkc56/

├── AUTHORS
├── COPYING
├── ChangeLog
├── HACKING
├── INSTALL
├── Makefile.am
├── README
├── TODO
├── acinclude.m4
├── bootstrap
├── build/
│   ├── config.guess
│   ├── config.sub
│   ├── depcomp
│   ├── install-sh
│   ├── ltmain.sh
│   └── missing
├── cgener
├── configure.ac
├── contrib/
│   ├── Makefile.am
│   ├── crushlib-test.sh
│   ├── crushlib.sh
│   └── csv2d
├── dev_tools/
│   ├── argstab2wiki.pl
│   ├── datagen
│   └── rebuild_userdocs.sh
└── src/
    ├── Makefile.am
    ├── add_field/
    │   ├── Makefile.am
    │   ├── add_field.in
    │   ├── args.tab
    │   ├── test.conf
    │   └── tests/
    │       ├── test.first.expect
    │       ├── test.in
    │       ├── test.last.expect
    │       ├── test.second.expect
    │       ├── test.third.expect
    │       ├── test_00.sh
    │       ├── test_01.sh
    │       ├── test_02.sh
    │       ├── test_03.0.expect
    │       ├── test_03.1.expect
    │       ├── test_03.2.expect
    │       └── test_03.sh
    ├── aggregate/
    │   ├── Makefile.am
    │   ├── aggregate.c
    │   ├── aggregate.h
    │   ├── args.tab
    │   ├── bak/
    │   │   ├── aggregate
    │   │   └── aggregate.alt
    │   ├── example.html
    │   ├── test/
    │   │   ├── test.in
    │   │   ├── test.in2
    │   │   ├── test.in3
    │   │   ├── test_00.expected
    │   │   ├── test_00.sh
    │   │   ├── test_01.expected
    │   │   ├── test_01.sh
    │   │   ├── test_02.expected
    │   │   ├── test_02.sh
    │   │   ├── test_03.expected
    │   │   ├── test_03.sh
    │   │   ├── test_04.expected
    │   │   ├── test_04.sh
    │   │   ├── test_05.0.C.expected
    │   │   ├── test_05.0.en_US.utf8.expected
    │   │   ├── test_05.0.es_AR.utf8.expected
    │   │   ├── test_05.1.C.expected
    │   │   ├── test_05.1.en_US.utf8.expected
    │   │   ├── test_05.1.es_AR.utf8.expected
    │   │   ├── test_05.2.C.expected
    │   │   ├── test_05.2.en_US.utf8.expected
    │   │   ├── test_05.2.es_AR.utf8.expected
    │   │   ├── test_05.sh
    │   │   ├── test_06.0.expected
    │   │   ├── test_06.1.expected
    │   │   ├── test_06.2.expected
    │   │   ├── test_06.sh
    │   │   ├── test_07.expected
    │   │   ├── test_07.sh
    │   │   ├── test_08.expected
    │   │   ├── test_08.sh
    │   │   ├── test_09.sh
    │   │   ├── test_10.sh
    │   │   ├── test_11.expected
    │   │   └── test_11.sh
    │   └── test.conf
    ├── aggregate2/
    │   ├── Makefile.am
    │   ├── aggregate2.c
    │   ├── args.tab
    │   ├── test/
    │   │   ├── test.in
    │   │   ├── test.in2
    │   │   ├── test_00.expected
    │   │   ├── test_00.sh
    │   │   ├── test_01.expected
    │   │   ├── test_01.sh
    │   │   ├── test_02.expected
    │   │   ├── test_02.sh
    │   │   ├── test_03.expected
    │   │   ├── test_03.sh
    │   │   ├── test_04.sh
    │   │   ├── test_05.expected
    │   │   ├── test_05.sh
    │   │   ├── test_06.expected
    │   │   ├── test_06.sh
    │   │   ├── test_07.expected
    │   │   └── test_07.sh
    │   └── test.conf
    ├── bin/
    │   ├── Makefile.am
    │   ├── genman.pl
    │   └── testharness.sh
    ├── buffer/
    │   ├── Makefile.am
    │   ├── args.tab
    │   └── buffer.c
    ├── calcfield/
    │   ├── Makefile.am
    │   ├── args.tab
    │   ├── calcfield.in
    │   ├── test/
    │   │   ├── imps_clks.log
    │   │   ├── test.txt
    │   │   ├── test_00.expected
    │   │   ├── test_00.sh
    │   │   ├── test_01.expected
    │   │   ├── test_01.sh
    │   │   ├── test_02.expected
    │   │   ├── test_02.sh
    │   │   ├── test_03.expected
    │   │   ├── test_03.sh
    │   │   ├── test_04.0.expected
    │   │   ├── test_04.1.expected
    │   │   ├── test_04.2.expected
    │   │   ├── test_04.3.expected
    │   │   ├── test_04.sh
    │   │   ├── test_05.expected
    │   │   └── test_05.sh
    │   └── test.conf
    ├── convdate/
    │   ├── Makefile.am
    │   ├── args.tab
    │   ├── convdate.c
    │   ├── convdate.h
    │   ├── example.html
    │   ├── test/
    │   │   ├── test_01.sh
    │   │   ├── test_02.sh
    │   │   ├── test_03.sh
    │   │   └── test_04.sh
    │   └── test.conf
    ├── csvformat/
    │   ├── Makefile.am
    │   ├── args.tab
    │   ├── csvformat.in
    │   ├── test.conf
    │   └── tests/
    │       ├── test_00.expected
    │       ├── test_00.sh
    │       ├── test_01.sh
    │       ├── test_02.sh
    │       ├── test_03.expected
    │       ├── test_03.in
    │       ├── test_03.sh
    │       └── test_04.sh
    ├── cutfield/
    │   ├── Makefile.am
    │   ├── args.tab
    │   ├── cutfield.c
    │   ├── test/
    │   │   ├── test_01.sh
    │   │   ├── test_02.sh
    │   │   ├── test_03.sh
    │   │   ├── test_04.sh
    │   │   └── test_05.sh
    │   └── test.conf
    ├── dates_in_range/
    │   ├── Makefile.am
    │   ├── args.tab
    │   └── dates_in_range.in
    ├── dbstream/
    │   ├── Makefile.am
    │   ├── args.tab
    │   ├── dbstream.in
    │   ├── test.conf
    │   └── tests/
    │       ├── setup.pl
    │       ├── test_00.sh
    │       ├── test_01.sh
    │       ├── test_02.sh
    │       ├── test_03.sh
    │       ├── test_04.sh
    │       ├── test_05.sh
    │       ├── test_06.sh
    │       ├── test_07.sh
    │       └── test_08.sh
    ├── deltadays/
    │   ├── Makefile.am
    │   ├── args.tab
    │   └── deltadays.in
    ├── deltaforce/
    │   ├── Makefile.am
    │   ├── args.tab
    │   ├── deltaforce.c
    │   ├── deltaforce.h
    │   ├── test.conf
    │   └── tests/
    │       ├── test_00-delta.txt
    │       ├── test_00-full.txt
    │       ├── test_00.expected
    │       ├── test_00.sh
    │       ├── test_01-delta.txt
    │       ├── test_01-full.txt
    │       ├── test_01.expected
    │       ├── test_01.sh
    │       ├── test_02-delta.txt
    │       ├── test_02-full.txt
    │       ├── test_02.expected
    │       ├── test_02.sh
    │       ├── test_03-delta.txt
    │       ├── test_03-full.txt
    │       ├── test_03.expected
    │       ├── test_03.sh
    │       ├── test_04-delta.txt
    │       ├── test_04-full.txt
    │       ├── test_04.expected
    │       └── test_04.sh
    ├── fieldsplit/
    │   ├── Makefile.am
    │   ├── args.tab
    │   ├── fieldsplit.c
    │   ├── test/
    │   │   ├── 001/
    │   │   │   ├── 2008-01.expected
    │   │   │   └── 2008-02.expected
    │   │   ├── 001-transform-key.txt
    │   │   ├── 002-data.txt
    │   │   ├── 003/
    │   │   │   ├── 2008-01-29.expected
    │   │   │   ├── 2008-02-01.expected
    │   │   │   └── 2008-02-09.expected
    │   │   ├── 004/
    │   │   │   ├── 1.expected
    │   │   │   └── 2.expected
    │   │   ├── 005/
    │   │   │   ├── 10.expected
    │   │   │   ├── 11.expected
    │   │   │   └── _blank_value.expected
    │   │   ├── 006/
    │   │   │   ├── 0.expected
    │   │   │   ├── 1.expected
    │   │   │   └── 2.expected
    │   │   ├── 007/
    │   │   │   ├── 1.expected
    │   │   │   └── 2.expected
    │   │   ├── 008/
    │   │   │   ├── 10.expected
    │   │   │   ├── 11.expected
    │   │   │   └── _blank_value.expected
    │   │   ├── test_001.sh
    │   │   ├── test_002.sh
    │   │   ├── test_003.sh
    │   │   ├── test_004.sh
    │   │   ├── test_005.sh
    │   │   ├── test_006.sh
    │   │   ├── test_007.sh
    │   │   └── test_008.sh
    │   └── test.conf
    ├── filterkeys/
    │   ├── Makefile.am
    │   ├── args.tab
    │   ├── filterkeys.c
    │   ├── filterkeys.h
    │   ├── test/
    │   │   ├── test-1.in
    │   │   ├── test-2.in
    │   │   ├── test-3.in
    │   │   ├── test-4.in
    │   │   ├── test-filter-2.in
    │   │   ├── test-filter-3.in
    │   │   ├── test-filter.in
    │   │   ├── test_00.expected
    │   │   ├── test_00.sh
    │   │   ├── test_01.expected
    │   │   ├── test_01.sh
    │   │   ├── test_02.expected
    │   │   ├── test_02.sh
    │   │   ├── test_03.expected
    │   │   ├── test_03.sh
    │   │   ├── test_04.expected
    │   │   ├── test_04.sh
    │   │   ├── test_05.expected
    │   │   ├── test_05.sh
    │   │   ├── test_06.expected
    │   │   ├── test_06.sh
    │   │   ├── test_07.expected
    │   │   └── test_07.sh
    │   └── test.conf
    ├── find_not_processed/
    │   ├── Makefile.am
    │   ├── args.tab
    │   ├── find_not_processed.in
    │   └── test.sh
    ├── findfiles/
    │   ├── Makefile.am
    │   ├── args.tab
    │   └── findfiles.in
    ├── foreach_parallel/
    │   ├── Makefile.am
    │   ├── args.tab
    │   ├── foreach_parallel.c
    │   └── test/
    │       └── echo.sh
    ├── funiq/
    │   ├── Makefile.am
    │   ├── args.tab
    │   ├── example.html
    │   ├── funiq.c
    │   ├── test/
    │   │   ├── test_01.sh
    │   │   ├── test_02.sh
    │   │   ├── test_03.sh
    │   │   ├── test_04.sh
    │   │   └── test_05.sh
    │   └── test.conf
    ├── grepfield/
    │   ├── Makefile.am
    │   ├── args.tab
    │   ├── example.html
    │   ├── grepfield.c
    │   ├── grepfield.h
    │   ├── test/
    │   │   ├── test.in
    │   │   ├── test_00.expected
    │   │   ├── test_00.sh
    │   │   ├── test_01.expected
    │   │   ├── test_01.sh
    │   │   ├── test_02.expected
    │   │   ├── test_02.sh
    │   │   ├── test_03.expected
    │   │   ├── test_03.sh
    │   │   ├── test_04.expected
    │   │   ├── test_04.sh
    │   │   ├── test_05.1.expected
    │   │   ├── test_05.2.expected
    │   │   ├── test_05.3.expected
    │   │   ├── test_05.in
    │   │   └── test_05.sh
    │   └── test.conf
    ├── hashjoin/
    │   ├── Makefile.am
    │   ├── args.tab
    │   ├── hashjoin.c
    │   ├── test/
    │   │   ├── dimension_header.log
    │   │   ├── dimension_no_header.log
    │   │   ├── input_header.log
    │   │   ├── input_no_header.log
    │   │   ├── test_00.expected
    │   │   ├── test_00.sh
    │   │   ├── test_01.expected
    │   │   ├── test_01.sh
    │   │   ├── test_02.expected
    │   │   ├── test_02.sh
    │   │   ├── test_03.expected
    │   │   ├── test_03.sh
    │   │   ├── test_04.sh
    │   │   ├── test_05.1.expected
    │   │   ├── test_05.2.expected
    │   │   ├── test_05.3.expected
    │   │   ├── test_05.sh
    │   │   ├── test_06.sh
    │   │   ├── test_07.expected
    │   │   ├── test_07.sh
    │   │   ├── test_08.expected
    │   │   ├── test_08.sh
    │   │   ├── test_09.1.expected
    │   │   ├── test_09.2.expected
    │   │   └── test_09.sh
    │   └── test.conf
    ├── indexof/
    │   ├── Makefile.am
    │   ├── args.tab
    │   ├── example.html
    │   ├── indexof.c
    │   ├── indexof.h
    │   ├── test/
    │   │   ├── test_01.sh
    │   │   ├── test_02.sh
    │   │   └── test_03.sh
    │   └── test.conf
    ├── libcrush/
    │   ├── GeneralHashFunctions.c
    │   ├── Makefile.am
    │   ├── bstree.c
    │   ├── crush/
    │   │   ├── Makefile.am
    │   │   ├── bstree.h
    │   │   ├── crush_version.h.in
    │   │   ├── crushstr.h
    │   │   ├── dbfr.h
    │   │   ├── ffutils.h
    │   │   ├── general.h
    │   │   ├── hashfuncs.h
    │   │   ├── hashtbl.h
    │   │   ├── hashtbl2.h
    │   │   ├── ht2_GeneralHashFunctions.h
    │   │   ├── linklist.h
    │   │   ├── mempool.h
    │   │   ├── qsort_helper.h
    │   │   ├── queue.h
    │   │   └── reutils.h
    │   ├── crushstr.c
    │   ├── dbfr.c
    │   ├── ffutils.c
    │   ├── general.c
    │   ├── hashfuncs.c
    │   ├── hashtbl.c
    │   ├── hashtbl2.c
    │   ├── linklist.c
    │   ├── mempool.c
    │   ├── qsort_helper.c
    │   ├── queue.c
    │   ├── reutils.c
    │   └── test/
    │       ├── bstree_test.c
    │       ├── crushstr_test.c
    │       ├── datecmp_test.c
    │       ├── datecmp_test.dmy.in
    │       ├── datecmp_test.in
    │       ├── dbfr_test.c
    │       ├── ffutils_test.c
    │       ├── hashtbl_test.c
    │       ├── mempool_test.c
    │       ├── qsort_helper_test.c
    │       ├── reutils_test.c
    │       └── unittest.h
    ├── mergekeys/
    │   ├── Makefile.am
    │   ├── args.tab
    │   ├── example.html
    │   ├── mergekeys.c
    │   ├── mergekeys.h
    │   ├── test.conf
    │   └── tests/
    │       ├── test_00.a
    │       ├── test_00.b
    │       ├── test_00.expected
    │       ├── test_00.sh
    │       ├── test_01.a
    │       ├── test_01.b
    │       ├── test_01.expected
    │       ├── test_01.sh
    │       ├── test_02.-i.expected
    │       ├── test_02.-l.expected
    │       ├── test_02.-r.expected
    │       ├── test_02..expected
    │       ├── test_02.a
    │       ├── test_02.b
    │       ├── test_02.sh
    │       ├── test_03.-i.expected
    │       ├── test_03.-l.expected
    │       ├── test_03.-r.expected
    │       ├── test_03..expected
    │       ├── test_03.a
    │       ├── test_03.b
    │       ├── test_03.sh
    │       ├── test_04.-i.expected
    │       ├── test_04.-l.expected
    │       ├── test_04.-r.expected
    │       ├── test_04..expected
    │       ├── test_04.a
    │       ├── test_04.b
    │       ├── test_04.sh
    │       ├── test_05.-i.expected
    │       ├── test_05.-l.expected
    │       ├── test_05.-r.expected
    │       ├── test_05..expected
    │       ├── test_05.a
    │       ├── test_05.b
    │       ├── test_05.sh
    │       ├── test_06.-i.expected
    │       ├── test_06.-l.expected
    │       ├── test_06.-r.expected
    │       ├── test_06..expected
    │       ├── test_06.a
    │       ├── test_06.b
    │       ├── test_06.sh
    │       ├── test_07.-i.expected
    │       ├── test_07.-l.expected
    │       ├── test_07.-r.expected
    │       ├── test_07..expected
    │       ├── test_07.a
    │       ├── test_07.b
    │       ├── test_07.sh
    │       ├── test_08.-i.expected
    │       ├── test_08.-l.expected
    │       ├── test_08.-r.expected
    │       ├── test_08..expected
    │       ├── test_08.a
    │       ├── test_08.b
    │       ├── test_08.sh
    │       ├── test_09.a
    │       ├── test_09.b
    │       ├── test_09.expected
    │       ├── test_09.sh
    │       ├── test_10.-i.expected
    │       ├── test_10.-l.expected
    │       ├── test_10.-r.expected
    │       ├── test_10..expected
    │       ├── test_10.a
    │       ├── test_10.b
    │       ├── test_10.sh
    │       ├── test_11.a
    │       ├── test_11.b
    │       ├── test_11.expected
    │       ├── test_11.sh
    │       ├── test_12.-i.expected
    │       ├── test_12.-l.expected
    │       ├── test_12.-r.expected
    │       ├── test_12..expected
    │       ├── test_12.a
    │       ├── test_12.b
    │       ├── test_12.sh
    │       ├── test_13.-i.expected
    │       ├── test_13.-l.expected
    │       ├── test_13.-r.expected
    │       ├── test_13..expected
    │       ├── test_13.a
    │       ├── test_13.b
    │       ├── test_13.sh
    │       ├── test_14.a
    │       ├── test_14.b
    │       ├── test_14.expected
    │       ├── test_14.sh
    │       ├── test_15.-i.expected
    │       ├── test_15.-l.expected
    │       ├── test_15.-r.expected
    │       ├── test_15..expected
    │       ├── test_15.a
    │       ├── test_15.b
    │       ├── test_15.sh
    │       ├── test_16.a
    │       ├── test_16.b
    │       ├── test_16.expected
    │       └── test_16.sh
    ├── perllib/
    │   ├── Makefile.am
    │   ├── crush_version.pl.in
    │   ├── date_parse_format.pl
    │   ├── date_parse_format_test.pl
    │   ├── hackery.m4
    │   ├── utils.pl
    │   └── utils_test.pl
    ├── pivot/
    │   ├── Makefile.am
    │   ├── README.functional
    │   ├── args.tab
    │   ├── example.html
    │   ├── pivot.c
    │   ├── prototype/
    │   │   └── pivot.pl
    │   ├── test.conf
    │   └── tests/
    │       ├── test_00.expected
    │       ├── test_00.in
    │       ├── test_00.sh
    │       ├── test_01.expected
    │       ├── test_01.in
    │       ├── test_01.sh
    │       ├── test_02.expected
    │       ├── test_02.in
    │       └── test_02.sh
    ├── range/
    │   ├── Makefile.am
    │   ├── args.tab
    │   └── range.c
    ├── reorder/
    │   ├── Makefile.am
    │   ├── args.tab
    │   ├── example.html
    │   ├── reorder.c
    │   ├── reorder.h
    │   ├── reorder.test.sh
    │   ├── test.conf
    │   └── tests/
    │       ├── test.in0
    │       ├── test.in1
    │       ├── test.in2
    │       ├── test_00.sh
    │       ├── test_01.0.expected
    │       ├── test_01.sh
    │       ├── test_02.1.expected
    │       ├── test_02.sh
    │       ├── test_03.expected
    │       ├── test_03.sh
    │       ├── test_04.0.expected
    │       ├── test_04.1.expected
    │       ├── test_04.2.expected
    │       ├── test_04.3.expected
    │       ├── test_04.4.expected
    │       ├── test_04.5.expected
    │       ├── test_04.sh
    │       ├── test_05.0.expected
    │       ├── test_05.1.expected
    │       ├── test_05.2.expected
    │       ├── test_05.in
    │       ├── test_05.sh
    │       └── test_labeled.in
    ├── subtotal/
    │   ├── Makefile.am
    │   ├── args.tab
    │   ├── example.html
    │   ├── subtotal.c
    │   ├── test/
    │   │   ├── test_01.sh
    │   │   ├── test_02.sh
    │   │   ├── test_03.sh
    │   │   └── test_04.sh
    │   └── test.conf
    ├── tochar/
    │   ├── Makefile.am
    │   ├── args.tab
    │   └── tochar.c
    ├── translate_field/
    │   ├── Makefile.am
    │   ├── args.tab
    │   ├── test.conf
    │   ├── tests/
    │   │   ├── test.in
    │   │   ├── test_00.expected
    │   │   ├── test_00.sh
    │   │   ├── test_01.expected
    │   │   ├── test_01.sh
    │   │   ├── test_02.expected
    │   │   ├── test_02.sh
    │   │   ├── test_03.expected
    │   │   ├── test_03.sh
    │   │   ├── test_04.expected
    │   │   ├── test_04.sh
    │   │   ├── test_05.expected
    │   │   └── test_05.sh
    │   └── translate_field.in
    └── truncfield/
        ├── Makefile.am
        ├── args.tab
        ├── test/
        │   ├── test_01.sh
        │   ├── test_02.sh
        │   └── test_03.sh
        ├── test.conf
        └── truncfield.c
Download .txt
SYMBOL INDEX (275 symbols across 56 files)

FILE: src/aggregate/aggregate.c
  type agg_conf (line 25) | struct agg_conf
  function configure_aggregation (line 27) | int configure_aggregation(struct agg_conf *conf, struct cmdargs *args,
  function aggregate (line 132) | int aggregate(struct cmdargs *args, int argc, char *argv[], int optind) {
  function key_strcmp (line 415) | int key_strcmp(char **a, char **b) {
  function float_str_precision (line 442) | int float_str_precision(char *d) {
  function print_keys_and_agg_vals (line 456) | int print_keys_and_agg_vals(char *key, struct aggregation *val) {
  function ht_print_keys_and_agg_vals (line 488) | void ht_print_keys_and_agg_vals(void *htelem) {
  function extract_fields_to_string (line 496) | void extract_fields_to_string(char *line, char *destbuf, size_t destbuf_sz,
  function decrement_values (line 525) | void decrement_values(int *array, size_t sz) {
  type aggregation (line 534) | struct aggregation
  type aggregation (line 536) | struct aggregation
  type aggregation (line 538) | struct aggregation
  type aggregation (line 539) | struct aggregation
  function free_agg (line 575) | void free_agg(struct aggregation *agg) {

FILE: src/aggregate/aggregate.h
  type agg_conf_field (line 30) | struct agg_conf_field {
  type agg_conf (line 39) | struct agg_conf {
  type aggregation (line 48) | struct aggregation {
  type agg_conf (line 63) | struct agg_conf
  type cmdargs (line 63) | struct cmdargs
  type aggregation (line 69) | struct aggregation
  type aggregation (line 82) | struct aggregation
  type aggregation (line 85) | struct aggregation

FILE: src/aggregate2/aggregate2.c
  type agg_conf (line 22) | struct agg_conf {
  type agg_conf (line 42) | struct agg_conf
  type cmdargs (line 42) | struct cmdargs
  function aggregate2 (line 66) | int aggregate2(struct cmdargs *args, int argc, char *argv[], int optind) {
  function decrement_values (line 263) | static void decrement_values(int *array, size_t sz) {
  function configure_aggregation (line 272) | int configure_aggregation(struct agg_conf *conf, struct cmdargs *args,
  function extract_keys (line 343) | static int extract_keys(char *target, const char *source, const char *de...
  function print_line (line 365) | static void print_line(FILE * out,
  function float_precision (line 386) | static int float_precision(char *n) {

FILE: src/buffer/buffer.c
  function buffer (line 42) | int buffer(struct cmdargs *args, int argc, char *argv[], int optind) {

FILE: src/convdate/convdate.c
  function convdate (line 28) | int convdate(struct cmdargs *args, int argc, char *argv[], int optind) {

FILE: src/cutfield/cutfield.c
  function cutfield (line 32) | int cutfield(struct cmdargs *args, int argc, char *argv[], int optind) {

FILE: src/deltaforce/deltaforce.c
  function deltaforce (line 48) | int deltaforce(struct cmdargs *args, int argc, char *argv[], int optind) {
  function merge_files (line 152) | int merge_files(dbfr_t *left_reader, dbfr_t *right_reader, FILE * out,
  function compare_keys (line 247) | int compare_keys(char *buffer_left, char *buffer_right) {

FILE: src/deltaforce/deltaforce.h
  type cmdargs (line 71) | struct cmdargs

FILE: src/fieldsplit/fieldsplit.c
  type crush_resubst_elem (line 30) | struct crush_resubst_elem
  type cmdargs (line 73) | struct cmdargs
  type fp_wrapper (line 87) | struct fp_wrapper {
  function fieldsplit (line 103) | int fieldsplit (struct cmdargs *args, int argc, char *argv[], int optind) {
  function close_files (line 205) | void close_files(void *data) {
  function strhash32 (line 250) | unsigned int strhash32(unsigned char *data) {
  function store_mapping (line 261) | void store_mapping(const struct cmdargs const *args,
  function init_xform_regex (line 305) | int init_xform_regex(char *subst_regex) {

FILE: src/filterkeys/filterkeys.c
  type fkeys_conf (line 33) | struct fkeys_conf
  function configure_filterkeys (line 36) | static int configure_filterkeys(struct fkeys_conf *conf,
  function load_filter (line 116) | static int load_filter(struct fkeys_conf *conf, dbfr_t *filter_reader) {
  function filterkeys (line 152) | int filterkeys(struct cmdargs *args, int argc, char *argv[], int optind) {

FILE: src/filterkeys/filterkeys.h
  type fkeys_conf (line 8) | struct fkeys_conf {

FILE: src/foreach_parallel/foreach_parallel.c
  type cmdargs (line 40) | struct cmdargs
  function foreach_parallel (line 54) | int foreach_parallel(struct cmdargs *args, int argc, char *argv[], int o...
  function read_code (line 106) | static ssize_t read_code(FILE * in, FILE * out) {
  function wait_for_child (line 124) | static int wait_for_child(int wait_flags) {
  function run_in_parallel (line 157) | static int run_in_parallel(char *script, struct cmdargs *args, int argc,
  function sig_handler (line 292) | static void sig_handler(int signo) {

FILE: src/funiq/funiq.c
  function funiq (line 34) | int funiq(struct cmdargs *args, int argc, char *argv[], int optind) {

FILE: src/grepfield/grepfield.c
  function grepfield (line 30) | int grepfield(struct cmdargs *args, int argc, char *argv[], int optind) {
  function re_perror (line 177) | void re_perror(int err_code, regex_t pattern) {

FILE: src/hashjoin/hashjoin.c
  type cmdargs (line 33) | struct cmdargs
  function hashjoin (line 46) | int hashjoin (struct cmdargs *args, int argc, char *argv[], int optind) {
  function extract_fields (line 199) | static void extract_fields(int *field_list, size_t n_fields,
  function decrement (line 225) | static void decrement(int *lst, size_t n) {
  function hash_dimension_file (line 241) | static size_t hash_dimension_file(struct cmdargs *args, hashtbl_t *ht) {

FILE: src/indexof/indexof.c
  function indexof (line 23) | int indexof(struct cmdargs *args, int argc, char *argv[], int optind) {

FILE: src/libcrush/GeneralHashFunctions.c
  function ht2_RSHash (line 26) | size_t ht2_RSHash(void *key, size_t len) {
  function ht2_JSHash (line 44) | size_t ht2_JSHash(void *key, size_t len) {
  function ht2_PJWHash (line 59) | size_t ht2_PJWHash(void *key, size_t len) {
  function ht2_ELFHash (line 83) | size_t ht2_ELFHash(void *key, size_t len) {
  function ht2_BKDRHash (line 103) | size_t ht2_BKDRHash(void *key, size_t len) {
  function ht2_SDBMHash (line 119) | size_t ht2_SDBMHash(void *key, size_t len) {
  function ht2_DJBHash (line 134) | size_t ht2_DJBHash(void *key, size_t len) {
  function ht2_DEKHash (line 149) | size_t ht2_DEKHash(void *key, size_t len) {
  function ht2_APHash (line 163) | size_t ht2_APHash(void *key, size_t len) {

FILE: src/libcrush/bstree.c
  function bst_init (line 71) | int bst_init(bstree_t * tree,
  function bst_destroy (line 84) | void bst_destroy(bstree_t * tree) {
  function bst_destroy_nodes (line 93) | void bst_destroy_nodes(bst_node_t * node) {
  function bst_node_t (line 104) | bst_node_t * bst_create_child(bstree_t * tree, bst_node_t * parent,
  function bst_node_t (line 171) | bst_node_t * bst_insert(bstree_t * tree, void *data) {
  function bst_delete (line 189) | void bst_delete(bstree_t * tree, void *data) {
  function bst_node_t (line 272) | bst_node_t * bst_find(bstree_t *tree, void *data) {
  function bst_rotate_right (line 287) | void bst_rotate_right(bstree_t * tree, bst_node_t * node) {
  function bst_rotate_left (line 344) | void bst_rotate_left(bstree_t * tree, bst_node_t * node) {
  function bst_call_for_each (line 405) | void bst_call_for_each(bstree_t * tree, void (*func) (void *),
  function bstn_call_for_each (line 411) | void bstn_call_for_each(bst_node_t * node, void (*func) (void *),
  function bstn_call_preorder (line 432) | void bstn_call_preorder(bst_node_t * node, void (*func) (void *)) {
  function bstn_call_inorder (line 441) | void bstn_call_inorder(bst_node_t * node, void (*func) (void *)) {
  function bstn_call_postorder (line 449) | void bstn_call_postorder(bst_node_t * node, void (*func) (void *)) {
  function bstn_call_breadthfirst (line 458) | void bstn_call_breadthfirst(bst_node_t * node, void (*func) (void *)) {
  function bst_call_for_each2 (line 477) | void bst_call_for_each2(bstree_t * tree, void (*func) (void *, void *),
  function bstn_call_for_each2 (line 483) | void bstn_call_for_each2(bst_node_t * node, void (*func) (void *, void *),
  function bstn_call_preorder2 (line 504) | void bstn_call_preorder2(bst_node_t * node, void (*func) (void *, void *),
  function bstn_call_inorder2 (line 514) | void bstn_call_inorder2(bst_node_t * node, void (*func) (void *, void *),
  function bstn_call_postorder2 (line 524) | void bstn_call_postorder2(bst_node_t * node, void (*func) (void *, void *),
  function bstn_call_breadthfirst2 (line 534) | void bstn_call_breadthfirst2(bst_node_t * node, void (*func) (void *, vo...

FILE: src/libcrush/crush/bstree.h
  type traversal_order_t (line 27) | typedef enum {
  type node_balance_t (line 39) | typedef enum { leftheavy, /**< indicates that the node needs rotated rig...
  type bst_node_t (line 45) | typedef struct _bst_node {
  type bstree_t (line 58) | typedef struct _bstree {

FILE: src/libcrush/crush/crushstr.h
  type crushstr_t (line 26) | typedef struct {

FILE: src/libcrush/crush/dbfr.h
  type dbfr_t (line 44) | typedef struct {

FILE: src/libcrush/crush/hashtbl.h
  type hashtbl_t (line 40) | typedef struct _hashtbl {
  type ht_elem_t (line 53) | typedef struct _ht_elem {

FILE: src/libcrush/crush/hashtbl2.h
  type hashtbl2_t (line 34) | typedef struct _hashtbl2 {
  type ht2_elem_t (line 45) | typedef struct _ht2_elem {

FILE: src/libcrush/crush/linklist.h
  type insert_point_t (line 31) | typedef enum { beginning, end, sorted } insert_point_t;
  type llist_node_t (line 34) | typedef struct _llist_node_t {
  type llist_t (line 42) | typedef struct _llist_t {

FILE: src/libcrush/crush/mempool.h
  type _mempool_page (line 34) | struct _mempool_page {
  type mempool_t (line 41) | typedef struct _mempool {

FILE: src/libcrush/crush/queue.h
  type llist_t (line 25) | typedef llist_t queue_t;

FILE: src/libcrush/crush/reutils.h
  type crush_resubst_elem (line 91) | struct crush_resubst_elem {
  type crush_resubst_elem (line 113) | struct crush_resubst_elem
  type crush_resubst_elem (line 144) | struct crush_resubst_elem

FILE: src/libcrush/crushstr.c
  function crushstr_init (line 30) | int crushstr_init(crushstr_t *str, size_t capacity) {
  function crushstr_destroy (line 40) | void crushstr_destroy(crushstr_t *str) {
  function crushstr_t (line 47) | crushstr_t* crushstr_resize(crushstr_t *str, size_t capacity) {
  function crushstr_t (line 61) | crushstr_t* crushstr_copy(crushstr_t *target, const char *source) {
  function crushstr_t (line 70) | crushstr_t* crushstr_append(crushstr_t *target, const char *source) {

FILE: src/libcrush/dbfr.c
  function dbfr_is_readable (line 59) | int dbfr_is_readable(FILE *fp) {
  function dbfr_is_readable (line 67) | int dbfr_is_readable(FILE *fp) {
  function dbfr_t (line 81) | dbfr_t * dbfr_open(const char *filename) {
  function dbfr_t (line 97) | dbfr_t * dbfr_init(FILE *fp) {
  function dbfr_getline (line 113) | ssize_t dbfr_getline(dbfr_t *reader) {
  function dbfr_close (line 146) | void dbfr_close(dbfr_t *reader) {

FILE: src/libcrush/ffutils.c
  function fields_in_line (line 31) | size_t fields_in_line(const char *l, const char *d) {
  function get_line_field (line 62) | int get_line_field(char *dest, const char *line, size_t n, int i,
  function copy_field (line 96) | int copy_field(const char const *line, char **dest, size_t *dest_sz,
  function mdyhms_datecmp (line 141) | int mdyhms_datecmp(const char *a, const char *b) {
  function dmyhms_datecmp (line 154) | int dmyhms_datecmp(const char *a, const char *b) {
  function chomp (line 169) | void chomp(char *s) {
  function trim (line 175) | void trim(char *str) {
  function FILE (line 183) | FILE *nextfile(int argc, char *argv[], int *optind, const char *mode) {
  function expand_chars (line 221) | void expand_chars(char *s) {
  function arr_resize (line 276) | static size_t arr_resize(void **array,
  function expand_nums (line 283) | ssize_t expand_nums(char *arg, int **array, size_t * array_size) {
  function expand_label_list (line 349) | ssize_t expand_label_list(const char *labels,
  function get_line_pos (line 429) | int get_line_pos(const char *line, int field_no, const char *d,
  function field_str (line 478) | ssize_t field_str(const char *value, const char *line, const char *delim) {
  function getline (line 538) | ssize_t getline(char **outbuf, size_t * outsize, FILE * fp) {

FILE: src/libcrush/hashfuncs.c
  function djb2 (line 11) | unsigned int djb2(unsigned char *str) {
  function sdbm (line 34) | unsigned int sdbm(unsigned char *str) {
  function RSHash (line 59) | unsigned int RSHash(unsigned char *str) {
  function JSHash (line 77) | unsigned int JSHash(unsigned char *str) {
  function PJWHash (line 93) | unsigned int PJWHash(unsigned char *str) {
  function ELFHash (line 118) | unsigned int ELFHash(unsigned char *str) {
  function BKDRHash (line 167) | unsigned int BKDRHash(char *str) {
  function SDBMHash (line 186) | unsigned int SDBMHash(unsigned char *str) {
  function APHash (line 211) | unsigned int APHash(unsigned char *str) {

FILE: src/libcrush/hashtbl.c
  function ht_key_cmp (line 22) | static int ht_key_cmp(const void *a, const void *b) {
  function ht_free_tree_data (line 27) | static void ht_free_tree_data(void (*free_fn) (void *), bst_node_t *node) {
  function ht_init (line 38) | int ht_init(hashtbl_t * tbl,
  function ht_destroy (line 74) | void ht_destroy(hashtbl_t * tbl) {
  function ht_put (line 95) | int ht_put(hashtbl_t * tbl, char *key, void *data) {
  function ht_delete (line 165) | void ht_delete(hashtbl_t * tbl, char *key) {
  type rehash_context (line 188) | struct rehash_context {
  function ht_rehash_elem (line 196) | static void ht_rehash_elem(ht_elem_t *elem,
  function ht_rehash_2x (line 213) | static int ht_rehash_2x(hashtbl_t *tbl) {
  function ht_keys_bst_traverse (line 245) | static void ht_keys_bst_traverse(bst_node_t *node,
  function ht_keys (line 257) | int ht_keys(hashtbl_t *tbl, char **array) {
  function ht_call_bst_traverse (line 267) | static void ht_call_bst_traverse(bst_node_t *node, void (*func) (void *)) {
  function ht_call_bst_traverse2 (line 276) | static void ht_call_bst_traverse2(bst_node_t *node,
  function ht_call_for_each (line 288) | void ht_call_for_each(hashtbl_t * tbl, void (*func) (void *)) {
  function ht_call_for_each2 (line 297) | void ht_call_for_each2(hashtbl_t * tbl, void (*func) (void *, void *),
  function ht_dump_stats (line 310) | void ht_dump_stats(hashtbl_t * tbl) {
  function ht_is_prime (line 326) | static int ht_is_prime(unsigned long n) {
  function ht_next_prime (line 343) | unsigned long ht_next_prime(unsigned long n) {

FILE: src/libcrush/hashtbl2.c
  function ht2_init (line 21) | int ht2_init(hashtbl2_t * tbl,
  function ht2_destroy (line 58) | void ht2_destroy(hashtbl2_t * tbl) {
  function ht2_put (line 84) | int ht2_put(hashtbl2_t * tbl, void *key, void *data) {
  function ht2_delete (line 151) | void ht2_delete(hashtbl2_t * tbl, void *key) {
  function ht2_call_for_each (line 179) | void ht2_call_for_each(hashtbl2_t * tbl, int (*func) (void *)) {
  function ht2_dump_stats (line 192) | void ht2_dump_stats(hashtbl2_t * tbl) {

FILE: src/libcrush/linklist.c
  function ll_list_init (line 23) | int ll_list_init(llist_t * list,
  function ll_init_node (line 35) | int ll_init_node(llist_node_t ** node, void *data) {
  function ll_destroy (line 43) | int ll_destroy(llist_t * list) {
  function ll_rm_elem (line 56) | int ll_rm_elem(llist_t * list, llist_node_t * node) {
  function ll_add_elem (line 95) | int ll_add_elem(llist_t * list, void *data, insert_point_t at) {
  function ll_to_array (line 181) | void ll_to_array(llist_t * list, llist_node_t ** array) {
  function ll_call_for_each (line 191) | int ll_call_for_each(llist_t * list, int (*func) (void *)) {

FILE: src/libcrush/mempool.c
  type _mempool_page (line 30) | struct _mempool_page
  type _mempool_page (line 33) | struct _mempool_page
  function mempool_t (line 44) | mempool_t *mempool_create(size_t page_size) {
  function mempool_destroy (line 102) | void mempool_destroy(mempool_t * pool) {

FILE: src/libcrush/qsort_helper.c
  function qsort_strcmp (line 19) | int qsort_strcmp(const char **a, const char **b) {
  function qsort_intcmp (line 23) | int qsort_intcmp(const int *a, const int *b) {
  function qsort_uintcmp (line 27) | int qsort_uintcmp(const unsigned int *a, const unsigned int *b) {

FILE: src/libcrush/queue.c
  function q_init (line 18) | void q_init(queue_t * q, void (*data_free) (void *)) {
  function q_destroy (line 22) | int q_destroy(queue_t * q) {
  function q_enqueue (line 26) | void q_enqueue(queue_t * q, void *data) {

FILE: src/libcrush/reutils.c
  function crush_re_make_flags (line 25) | int crush_re_make_flags(const char const *modifiers, int *global) {
  function crush_resubst_compile (line 40) | int crush_resubst_compile(const char *subst_pattern,
  type crush_resubst_elem (line 137) | struct crush_resubst_elem
  type crush_resubst_elem (line 185) | struct crush_resubst_elem

FILE: src/libcrush/test/bstree_test.c
  type test_balanced_t (line 6) | typedef enum {BALANCED, LEFT_HEAVY, RIGHT_HEAVY} test_balanced_t;
  function bstree_t (line 8) | bstree_t * make_tree(test_balanced_t kind, int do_init_asserts) {
  function test_bst (line 33) | void test_bst(test_balanced_t kind) {
  function main (line 71) | int main (int argc, char *argv[]) {

FILE: src/libcrush/test/crushstr_test.c
  function main (line 20) | int main (int argc, char *argv[]) {

FILE: src/libcrush/test/datecmp_test.c
  function main (line 20) | int main(int argc, char *argv[]) {

FILE: src/libcrush/test/dbfr_test.c
  function setup (line 17) | int setup() {
  function teardown (line 28) | void teardown() {
  function test_dbfr_open (line 35) | int test_dbfr_open() {
  function test_dbfr_init (line 55) | int test_dbfr_init() {
  function test_dbfr_getline_1 (line 69) | int test_dbfr_getline_1() {
  function test_dbfr_getline_2 (line 91) | int test_dbfr_getline_2() {
  function main (line 123) | int main (int argc, char *argv[]) {

FILE: src/libcrush/test/ffutils_test.c
  function test_fields_in_line (line 23) | int test_fields_in_line() {
  function test_get_line_field (line 58) | int test_get_line_field(void) {
  function test_copy_field (line 121) | int test_copy_field(void) {
  function test_get_line_pos (line 164) | int test_get_line_pos(void) {
  function test_field_start (line 232) | int test_field_start(void) {
  function test_mdyhms_datecmp (line 267) | int test_mdyhms_datecmp(void) {
  function test_chomp (line 297) | int test_chomp(void) {
  function test_nextfile (line 321) | int test_nextfile(void) {
  function test_expand_chars (line 327) | int test_expand_chars(void) {
  function test_expand_nums (line 349) | int test_expand_nums(void) {
  function test_expand_label_list (line 394) | int test_expand_label_list(void) {
  function test_field_str (line 435) | int test_field_str() {
  function main (line 523) | int main(int argc, char *argv[]) {

FILE: src/libcrush/test/hashtbl_test.c
  function call_for_each_test (line 26) | void call_for_each_test(void *data) {
  function call_for_each2_test (line 30) | void call_for_each2_test(void *node_data, int *aux_data) {
  function main (line 35) | int main(int argc, char *argv[]) {

FILE: src/libcrush/test/mempool_test.c
  function main (line 23) | int main(int argc, char *argv[]) {

FILE: src/libcrush/test/qsort_helper_test.c
  function test_qsort_strcmp (line 23) | void test_qsort_strcmp() {
  function test_qsort_intcmp (line 30) | void test_qsort_intcmp() {
  function test_qsort_uintcmp (line 37) | void test_qsort_uintcmp() {
  function main (line 44) | int main(int argc, char *argv[]) {

FILE: src/libcrush/test/reutils_test.c
  function test_make_flags (line 56) | void test_make_flags() {
  function test_resubst_compile (line 73) | void test_resubst_compile() {
  function test_basic_substitution (line 130) | void test_basic_substitution() {
  function test_global_substitution (line 140) | void test_global_substitution() {
  function test_good_variables (line 149) | void test_good_variables() {
  function test_multi_variables (line 160) | void test_multi_variables() {
  function test_bad_variables (line 169) | void test_bad_variables() {
  function main (line 179) | int main (int argc, char *argv[]) {
  function main (line 191) | int main (int argc, char *argv[]) {

FILE: src/mergekeys/mergekeys.c
  function mergekeys (line 52) | int mergekeys(struct cmdargs *args, int argc, char *argv[], int optind) {
  function merge_files (line 147) | int merge_files(dbfr_t *left, dbfr_t *right, enum join_type_t join_type,
  function extract_and_print_fields (line 339) | static void extract_and_print_fields(char *line, int *field_list,
  function join_lines (line 358) | void join_lines(char *left_line, char *right_line, char *merge_default,
  function decrement_each (line 402) | static void decrement_each(int *array, size_t n) {
  function set_key_lists (line 409) | int set_key_lists(struct cmdargs *args, const char *left_line,
  function set_field_types (line 451) | int set_field_types() {
  function classify_fields (line 484) | void classify_fields(char *left_header, char *right_header) {
  function compare_keys (line 529) | int compare_keys(char *buffer_left, char *buffer_right) {
  function peek_keys (line 564) | int peek_keys(char *peek_line, char *current_line, const int *keyfields) {

FILE: src/mergekeys/mergekeys.h
  type join_type_t (line 68) | enum join_type_t {
  type join_type_t (line 75) | enum join_type_t
  type cmdargs (line 76) | struct cmdargs
  type cmdargs (line 79) | struct cmdargs

FILE: src/pivot/pivot.c
  type pivot_conf (line 34) | struct pivot_conf {
  type pivot_conf (line 47) | struct pivot_conf
  type cmdargs (line 47) | struct cmdargs
  function free_hash (line 58) | void free_hash(void *t) {
  function pivot (line 72) | int pivot(struct cmdargs *args, int argc, char *argv[], int optind) {
  function configure_pivot (line 434) | int configure_pivot(struct pivot_conf *conf, struct cmdargs *args,
  function decrement_values (line 480) | void decrement_values(int *array, size_t sz) {
  function extract_fields_to_string (line 506) | void extract_fields_to_string(char *line, char *destbuf, size_t destbuf_sz,
  function key_strcmp (line 526) | int key_strcmp(char **a, char **b) {
  function float_str_precision (line 553) | int float_str_precision(char *d) {

FILE: src/range/range.c
  function main (line 24) | int main(int argc, char *argv[]) {
  function usage (line 43) | void usage(char *bin) {

FILE: src/reorder/reorder.c
  function reorder (line 25) | int reorder(struct cmdargs *args, int argc, char *argv[], int optind) {
  function doswap (line 160) | void doswap(llist_t *list, char *s, char *ct, const char *d) {
  function docut (line 270) | int docut(char **s, const char *ct, size_t * s_sz, const char *d,
  function pushswap (line 318) | int pushswap(char *s, int action_type) {
  function parse_swap_list (line 333) | int parse_swap_list(llist_t *args, llist_t *pairs,

FILE: src/reorder/reorder.h
  type swap_arg (line 39) | struct swap_arg {
  type swap_pair (line 43) | struct swap_pair {

FILE: src/subtotal/subtotal.c
  function subtotal (line 33) | int subtotal(struct cmdargs *args, int argc, char *argv[], int optind) {

FILE: src/tochar/tochar.c
  function main (line 40) | int main(int argc, char *argv[]) {
  function usage (line 51) | void usage(char *exe) {

FILE: src/truncfield/truncfield.c
  function truncfield (line 32) | int truncfield(struct cmdargs *args, int argc, char *argv[], int optind) {
Condensed preview — 592 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (3,749K chars).
[
  {
    "path": "AUTHORS",
    "chars": 109,
    "preview": "Google, Inc\n\nContributers:\n\nJeremy Hinds\nJason Gessner\nJim Renwick\nNorman Gocke\nRodofo Granata\nTobias Wolff\n\n"
  },
  {
    "path": "COPYING",
    "chars": 11358,
    "preview": "\n                                 Apache License\n                           Version 2.0, January 2004\n                  "
  },
  {
    "path": "ChangeLog",
    "chars": 3667,
    "preview": "Changes in the \"2010-01\" release (2009-01-13 thru 2010-01-10):\n\n* aggregate\n  * Add support for min/max output.\n\t* Bug f"
  },
  {
    "path": "HACKING",
    "chars": 1667,
    "preview": "-- Compilation --\n\nTo build CRUSH from a repository checkout...\n\n1) install cgener (http://code.google.com/p/cgener/) at"
  },
  {
    "path": "INSTALL",
    "chars": 9512,
    "preview": "Installation Instructions\n*************************\n\nCopyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,"
  },
  {
    "path": "Makefile.am",
    "chars": 551,
    "preview": "\nAUX_DIST = $(ac_aux_dir)/config.guess \\\n\t\t\t\t\t $(ac_aux_dir)/config.sub \\\n\t\t\t\t\t $(ac_aux_dir)/depcomp \\\n\t\t\t\t\t $(ac_aux_d"
  },
  {
    "path": "README",
    "chars": 405,
    "preview": "CRUSH is a free, open-source collection of Custom Reporting Utilities for SHell.\n\nHome page: http://code.google.com/p/cr"
  },
  {
    "path": "TODO",
    "chars": 660,
    "preview": "$LastChangedDate$\n$Author$\n\n./bootstrap:\n\n  Only certain versions of libtoolize require adding file content to aclocal.m"
  },
  {
    "path": "acinclude.m4",
    "chars": 768,
    "preview": "\n# check to see if a Perl module is installed, and fail if it is not\nAC_DEFUN([CRUSH_REQUIRE_PERL_MODULE],[dnl\n  AC_MSG_"
  },
  {
    "path": "bootstrap",
    "chars": 423,
    "preview": "#!/bin/sh\n\nOS=`uname`\n\nset -x\naclocal\nLIBTOOL=\"libtoolize\"\n\nif [[ ${OS} = 'Darwin' ]]; then\n  LIBTOOL=\"glibtoolize\"\nfi\n$"
  },
  {
    "path": "build/config.guess",
    "chars": 44593,
    "preview": "#! /bin/sh\n# Attempt to guess a canonical system name.\n#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,"
  },
  {
    "path": "build/config.sub",
    "chars": 32724,
    "preview": "#! /bin/sh\n# Configuration validation subroutine script.\n#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 199"
  },
  {
    "path": "build/depcomp",
    "chars": 17867,
    "preview": "#! /bin/sh\n# depcomp - compile a program generating dependencies as side-effects\n\nscriptversion=2007-03-29.01\n\n# Copyrig"
  },
  {
    "path": "build/install-sh",
    "chars": 13620,
    "preview": "#!/bin/sh\n# install - install a program, script, or datafile\n\nscriptversion=2006-12-25.00\n\n# This originates from X11R5 "
  },
  {
    "path": "build/ltmain.sh",
    "chars": 283680,
    "preview": "\n# libtool (GNU libtool) 2.4.2\n# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996\n\n# Copyright (C) 1996, 1997, 1"
  },
  {
    "path": "build/missing",
    "chars": 11135,
    "preview": "#! /bin/sh\n# Common stub for a few missing GNU programs while installing.\n\nscriptversion=2006-05-10.23\n\n# Copyright (C) "
  },
  {
    "path": "cgener",
    "chars": 15496,
    "preview": "#!/usr/bin/perl -w\n#-*-perl-*-\n\n# copyright 2004 - 2008, Jeremy Hinds <jeremy.hinds AT gmail DOT com>\n#\n# This program i"
  },
  {
    "path": "configure.ac",
    "chars": 3947,
    "preview": "AC_INIT([crush-tools],\n        [trunk],\n        [http://code.google.com/p/crush-tools/])\nAC_CONFIG_HEADERS(src/libcrush/"
  },
  {
    "path": "contrib/Makefile.am",
    "chars": 48,
    "preview": "EXTRA_DIST = csv2d crushlib.sh crushlib-test.sh\n"
  },
  {
    "path": "contrib/crushlib-test.sh",
    "chars": 736,
    "preview": "#!/bin/bash\n\n. crushlib.sh || { echo \"failed to source crushlib.sh\" >&2; exit 1; }\n\nwarn \"this is only\\na test\"\nassert_s"
  },
  {
    "path": "contrib/crushlib.sh",
    "chars": 1829,
    "preview": "WORKING_DIR=`dirname $0`\nexport WORKING_DIR\n\n# print a message to stderr, preceded by the script name\nfunction warn {\n  "
  },
  {
    "path": "contrib/csv2d",
    "chars": 1388,
    "preview": "#!/usr/bin/perl -w\n\n#  Copyright 2008 Google Inc.\n#\n#  Licensed under the Apache License, Version 2.0 (the \"License\");\n#"
  },
  {
    "path": "dev_tools/argstab2wiki.pl",
    "chars": 996,
    "preview": "#!/usr/bin/perl -w\n\nuse strict;\n\nmy $args_tab = $ARGV[0];\n\nour (%global, @args);\n\nrequire $args_tab || die \"$!\";\n$global"
  },
  {
    "path": "dev_tools/datagen",
    "chars": 5566,
    "preview": "#!/usr/bin/env python\n\n#  Copyright 2008 Google Inc.\n#\n#  Licensed under the Apache License, Version 2.0 (the \"License\")"
  },
  {
    "path": "dev_tools/rebuild_userdocs.sh",
    "chars": 898,
    "preview": "#!/bin/bash\n\nif [ ! -d \"../wiki\" ] || [ ! -d \"./src\" ]; then\n  echo \"$0: must be run from trunk/ or tags/ in a full repo"
  },
  {
    "path": "src/Makefile.am",
    "chars": 523,
    "preview": "if COND_PERL_DBI_PRESENT\nWITH_DBI = $(NEEDS_PERL_DBI)\nendif\n\nif COND_PERL_DATE_CALC_PRESENT\nWITH_DATE_CALC = $(NEEDS_PER"
  },
  {
    "path": "src/add_field/Makefile.am",
    "chars": 601,
    "preview": "bin_SCRIPTS = add_field\nCLEANFILES = $(bin_SCRIPTS)\nEXTRA_DIST = args.tab add_field.in test.conf \\\n\t\t\t\t\t\t\ttests/test.in "
  },
  {
    "path": "src/add_field/add_field.in",
    "chars": 4743,
    "preview": "#!CRUSH_PERL_PATH -w\n\n#  Copyright 2008 Google Inc.\n#\n#  Licensed under the Apache License, Version 2.0 (the \"License\");"
  },
  {
    "path": "src/add_field/args.tab",
    "chars": 2946,
    "preview": "# this is a dummy file used only for generating documentation.\n\n# data relevant to the application as a whole\n%global = "
  },
  {
    "path": "src/add_field/test.conf",
    "chars": 189,
    "preview": "#!/bin/bash\n# not executable - the shebang is for the benefit of text-editors.\n\napplication=add_field\nbin=./$application"
  },
  {
    "path": "src/add_field/tests/test.first.expect",
    "chars": 49,
    "preview": "NEW\tf1\tf2\tf3\n00\t01\t02\t03\n00\t11\t12\t13\n00\t21\t22\t23\n"
  },
  {
    "path": "src/add_field/tests/test.in",
    "chars": 36,
    "preview": "f1\tf2\tf3\n01\t02\t03\n11\t12\t13\n21\t22\t23\n"
  },
  {
    "path": "src/add_field/tests/test.last.expect",
    "chars": 49,
    "preview": "f1\tf2\tf3\tNEW\n01\t02\t03\t00\n11\t12\t13\t00\n21\t22\t23\t00\n"
  },
  {
    "path": "src/add_field/tests/test.second.expect",
    "chars": 49,
    "preview": "f1\tNEW\tf2\tf3\n01\t00\t02\t03\n11\t00\t12\t13\n21\t00\t22\t23\n"
  },
  {
    "path": "src/add_field/tests/test.third.expect",
    "chars": 49,
    "preview": "f1\tf2\tNEW\tf3\n01\t02\t00\t03\n11\t12\t00\t13\n21\t22\t00\t23\n"
  },
  {
    "path": "src/add_field/tests/test_00.sh",
    "chars": 959,
    "preview": "test_number=00\ndescription=\"insert using indexes, new label specified\"\n\nsubtests=('' '-f 0' '-f 1' '-f 2' '-f 4' '-f -1'"
  },
  {
    "path": "src/add_field/tests/test_01.sh",
    "chars": 802,
    "preview": "test_number=01\ndescription=\"insert before label-specified location\"\n\nsubtests=('-B f1' '-B f2' '-B f3')\nsubtest_expect=("
  },
  {
    "path": "src/add_field/tests/test_02.sh",
    "chars": 797,
    "preview": "test_number=02\ndescription=\"insert after label-specified location\"\n\nsubtests=('-A f1' '-A f2' '-A f3')\nsubtest_expect=('"
  },
  {
    "path": "src/add_field/tests/test_03.0.expect",
    "chars": 48,
    "preview": "f1\tf2\tf3\tf3\n01\t02\t03\t03\n11\t12\t13\t13\n21\t22\t23\t23\n"
  },
  {
    "path": "src/add_field/tests/test_03.1.expect",
    "chars": 48,
    "preview": "f1\tf2\tf3\tf3\n01\t02\t03\t03\n11\t12\t13\t13\n21\t22\t23\t23\n"
  },
  {
    "path": "src/add_field/tests/test_03.2.expect",
    "chars": 49,
    "preview": "f1\tf2\tf3\tNEW\n01\t02\t03\t03\n11\t12\t13\t13\n21\t22\t23\t23\n"
  },
  {
    "path": "src/add_field/tests/test_03.sh",
    "chars": 915,
    "preview": "test_number=03\ndescription=\"copy from existing field\"\n\nsubtests=('-c 3 -f -1'\n          '-C f3 -f -1'\n          '-c 3 -f"
  },
  {
    "path": "src/aggregate/Makefile.am",
    "chars": 1281,
    "preview": "main.c usage.c aggregate_main.h : args.tab\n\t\"$(CGENER)\" -a ./args.tab\n\nBUILT_SOURCES = main.c usage.c aggregate_main.h\n\n"
  },
  {
    "path": "src/aggregate/aggregate.c",
    "chars": 18689,
    "preview": "/********************************\n   Copyright 2008, 2009 Google Inc.\n\n   Licensed under the Apache License, Version 2.0"
  },
  {
    "path": "src/aggregate/aggregate.h",
    "chars": 2866,
    "preview": "/*****************************************\n   Copyright 2008, 2009 Google Inc.\n\n   Licensed under the Apache License, Ve"
  },
  {
    "path": "src/aggregate/args.tab",
    "chars": 4847,
    "preview": "# data relevant to the application as a whole\n%global = (\n\tname => \"aggregate\",\n\tcategory => \"General file manipulation\""
  },
  {
    "path": "src/aggregate/bak/aggregate",
    "chars": 4224,
    "preview": "#!/usr/bin/perl -w -I/usr/local/devprac/lib/pm\n\nuse strict;\n\nuse Getopt::Long;\nuse util::args;\n\nmy(@keys,@sums,@cnts);\nm"
  },
  {
    "path": "src/aggregate/bak/aggregate.alt",
    "chars": 3374,
    "preview": "#!/usr/bin/perl -w\n\nuse strict;\nuse Getopt::Long;\nuse util::args;\n\nmy $tmpdir = '/tmp';\n\nmy ($k, $s, $c, $d, $p, $h);\nmy"
  },
  {
    "path": "src/aggregate/example.html",
    "chars": 383,
    "preview": "\n# assume that columns 4 and 8 are advertiser-id and ad-id, respectively, and\n# column 2 is user-id, columns 14 and 15 a"
  },
  {
    "path": "src/aggregate/test/test.in",
    "chars": 199,
    "preview": "Text-1\tText-2\tNumeric-1\tNumeric-2\nfirst text value\ta\t1\t8\nfirst text value\ta\t1\t5\nfirst text value\tb\t1\t3\nsecond text value"
  },
  {
    "path": "src/aggregate/test/test.in2",
    "chars": 199,
    "preview": "Text-2\tText-1\tNumeric-2\tNumeric-1\na\tfirst text value\t8\t1\na\tfirst text value\t5\t1\nb\tfirst text value\t3\t1\nb\tsecond text val"
  },
  {
    "path": "src/aggregate/test/test.in3",
    "chars": 193,
    "preview": "Text-1\tText-2\tNumeric-1\tNumeric-2\nfirst text value\ta\t1\t8\nfirst text value\ta\t1\t5\nfirst text value\tb\t1\t3\nsecond text value"
  },
  {
    "path": "src/aggregate/test/test_00.expected",
    "chars": 56,
    "preview": "Text-1\tNumeric-1\nfirst text value\t3\nsecond text value\t8\n"
  },
  {
    "path": "src/aggregate/test/test_00.sh",
    "chars": 397,
    "preview": "test_number=00\ndescription=\"one key, one sum (header preserved)\"\n\noutfile=\"$test_dir/test_$test_number.actual\"\nexpected="
  },
  {
    "path": "src/aggregate/test/test_01.expected",
    "chars": 153,
    "preview": "Text-1\tText-2\tNumeric-1\tNumeric-2\nfirst text value\ta\t2\t13\nfirst text value\tb\t1\t3\nsecond text value\tb\t2\t2\nsecond text val"
  },
  {
    "path": "src/aggregate/test/test_01.sh",
    "chars": 405,
    "preview": "test_number=01\ndescription=\"multi-key, multi-sum (header preserved)\"\n\noutfile=\"$test_dir/test_$test_number.actual\"\nexpec"
  },
  {
    "path": "src/aggregate/test/test_02.expected",
    "chars": 112,
    "preview": "Text-1\tNumeric-1\tNumeric-2\tNumeric-1\tNumeric-2\nfirst text value\t3\t16\t1.00\t5.33\nsecond text value\t8\t13\t2.00\t3.25\n"
  },
  {
    "path": "src/aggregate/test/test_02.sh",
    "chars": 412,
    "preview": "test_number=02\ndescription=\"one key, multi-average (header preserved)\"\n\noutfile=\"$test_dir/test_$test_number.actual\"\nexp"
  },
  {
    "path": "src/aggregate/test/test_03.expected",
    "chars": 56,
    "preview": "Text-1\tSum-Field\nfirst text value\t3\nsecond text value\t8\n"
  },
  {
    "path": "src/aggregate/test/test_03.sh",
    "chars": 406,
    "preview": "test_number=03\ndescription=\"user-specified agg-field labels\"\n\noutfile=\"$test_dir/test_$test_number.actual\"\nexpected=\"$te"
  },
  {
    "path": "src/aggregate/test/test_04.expected",
    "chars": 105,
    "preview": "Text-1\tNumeric-1-Sum\tText-1-Count\tNumeric-2-Average\nfirst text value\t3\t3\t5.33\nsecond text value\t8\t4\t3.25\n"
  },
  {
    "path": "src/aggregate/test/test_04.sh",
    "chars": 402,
    "preview": "test_number=04\ndescription=\"auto-label aggregated field\"\n\noutfile=\"$test_dir/test_$test_number.actual\"\nexpected=\"$test_d"
  },
  {
    "path": "src/aggregate/test/test_05.0.C.expected",
    "chars": 263,
    "preview": "Text-1\tText-2\tNumeric-1\tNumeric-2\tNumeric-1\tNumeric-2\tNumeric-1\tNumeric-2\nfirst text value\ta\t2\t13\t2\t2\t1.00\t6.50\nfirst te"
  },
  {
    "path": "src/aggregate/test/test_05.0.en_US.utf8.expected",
    "chars": 263,
    "preview": "Text-1\tText-2\tNumeric-1\tNumeric-2\tNumeric-1\tNumeric-2\tNumeric-1\tNumeric-2\nfirst text value\ta\t2\t13\t2\t2\t1.00\t6.50\nfirst te"
  },
  {
    "path": "src/aggregate/test/test_05.0.es_AR.utf8.expected",
    "chars": 263,
    "preview": "Text-1\tText-2\tNumeric-1\tNumeric-2\tNumeric-1\tNumeric-2\tNumeric-1\tNumeric-2\nfirst text value\ta\t2\t13\t2\t2\t1,00\t6,50\nfirst te"
  },
  {
    "path": "src/aggregate/test/test_05.1.C.expected",
    "chars": 299,
    "preview": "Text-1\tText-2\tNumeric-1-Sum\tNumeric-2-Sum\tNumeric-1-Count\tNumeric-2-Count\tNumeric-1-Average\tNumeric-2-Average\nfirst text"
  },
  {
    "path": "src/aggregate/test/test_05.1.en_US.utf8.expected",
    "chars": 299,
    "preview": "Text-1\tText-2\tNumeric-1-Sum\tNumeric-2-Sum\tNumeric-1-Count\tNumeric-2-Count\tNumeric-1-Average\tNumeric-2-Average\nfirst text"
  },
  {
    "path": "src/aggregate/test/test_05.1.es_AR.utf8.expected",
    "chars": 299,
    "preview": "Text-1\tText-2\tNumeric-1-Sum\tNumeric-2-Sum\tNumeric-1-Count\tNumeric-2-Count\tNumeric-1-Average\tNumeric-2-Average\nfirst text"
  },
  {
    "path": "src/aggregate/test/test_05.2.C.expected",
    "chars": 251,
    "preview": "Text-1\tText-2\tSum-1\tSum-2\tCount-1\tCount-2\tAverage-1\tAverage-2\nfirst text value\ta\t2\t13\t2\t2\t1.00\t6.50\nfirst text value\tb\t1"
  },
  {
    "path": "src/aggregate/test/test_05.2.en_US.utf8.expected",
    "chars": 251,
    "preview": "Text-1\tText-2\tSum-1\tSum-2\tCount-1\tCount-2\tAverage-1\tAverage-2\nfirst text value\ta\t2\t13\t2\t2\t1.00\t6.50\nfirst text value\tb\t1"
  },
  {
    "path": "src/aggregate/test/test_05.2.es_AR.utf8.expected",
    "chars": 251,
    "preview": "Text-1\tText-2\tSum-1\tSum-2\tCount-1\tCount-2\tAverage-1\tAverage-2\nfirst text value\ta\t2\t13\t2\t2\t1,00\t6,50\nfirst text value\tb\t1"
  },
  {
    "path": "src/aggregate/test/test_05.sh",
    "chars": 1197,
    "preview": "test_number=05\ndescription=\"labels as field specifiers\"\n\nsubtest_desc=(\"default labels\" \"auto-labels\" \"user labels\")\nsub"
  },
  {
    "path": "src/aggregate/test/test_06.0.expected",
    "chars": 264,
    "preview": "Text-1\tText-2\tNumeric-1\tNumeric-2\tNumeric-1\tNumeric-2\tNumeric-1\tNumeric-2\nfirst text value\ta\t4\t26\t4\t4\t1.00\t6.50\nfirst te"
  },
  {
    "path": "src/aggregate/test/test_06.1.expected",
    "chars": 300,
    "preview": "Text-1\tText-2\tNumeric-1-Sum\tNumeric-2-Sum\tNumeric-1-Count\tNumeric-2-Count\tNumeric-1-Average\tNumeric-2-Average\nfirst text"
  },
  {
    "path": "src/aggregate/test/test_06.2.expected",
    "chars": 252,
    "preview": "Text-1\tText-2\tSum-1\tSum-2\tCount-1\tCount-2\tAverage-1\tAverage-2\nfirst text value\ta\t4\t26\t4\t4\t1.00\t6.50\nfirst text value\tb\t2"
  },
  {
    "path": "src/aggregate/test/test_06.sh",
    "chars": 919,
    "preview": "test_number=06\ndescription=\"labels as field specifiers with 2 input files\"\n\nsubtest_desc=(\"default labels\" \"auto-labels\""
  },
  {
    "path": "src/aggregate/test/test_07.expected",
    "chars": 70,
    "preview": "Text-1\tNumeric-1\tNumeric-2\nfirst text value\t1\t3\nsecond text value\t2\t1\n"
  },
  {
    "path": "src/aggregate/test/test_07.sh",
    "chars": 725,
    "preview": "test_number=07\ndescription=\"numeric min\"\n\nexpected=\"$test_dir/test_$test_number.expected\"\n\noutfile=\"$test_dir/test_$test"
  },
  {
    "path": "src/aggregate/test/test_08.expected",
    "chars": 70,
    "preview": "Text-1\tNumeric-1\tNumeric-2\nfirst text value\t1\t8\nsecond text value\t2\t7\n"
  },
  {
    "path": "src/aggregate/test/test_08.sh",
    "chars": 723,
    "preview": "test_number=08\ndescription=\"numeric max\"\n\nexpected=\"$test_dir/test_$test_number.expected\"\n\noutfile=\"$test_dir/test_$test"
  },
  {
    "path": "src/aggregate/test/test_09.sh",
    "chars": 737,
    "preview": "test_number=09\ndescription=\"bad field labels\"\n\nsubtests=(\"-K Nonesuch -c 1\"\n          \"-K Text-1 -C Nonesuch\"\n          "
  },
  {
    "path": "src/aggregate/test/test_10.sh",
    "chars": 680,
    "preview": "test_number=10\ndescription=\"missing record fields\"\n\nsubtests=(\"-K Text-1,Text-2 -S Numeric-1\"\n          \"-K Text-1,Text-"
  },
  {
    "path": "src/aggregate/test/test_11.expected",
    "chars": 118,
    "preview": "Numeric-1-Sum\tNumeric-2-Sum\tNumeric-1-Count\tNumeric-2-Count\tNumeric-1-Average\tNumeric-2-Average\n22\t58\t14\t14\t1.57\t4.14\n"
  },
  {
    "path": "src/aggregate/test/test_11.sh",
    "chars": 513,
    "preview": "test_number=11\ndescription=\"whole file aggregation, no keys\"\n\n\nexpected=\"$test_dir/test_$test_number.expected\"\noutfile=\""
  },
  {
    "path": "src/aggregate/test.conf",
    "chars": 188,
    "preview": "#!/bin/bash\n# not executable - the shebang is for the benefit of text-editors.\n\napplication=aggregate\nbin=./$application"
  },
  {
    "path": "src/aggregate2/Makefile.am",
    "chars": 889,
    "preview": "main.c usage.c aggregate2_main.h : args.tab\n\t\"$(CGENER)\" -a ./args.tab\n\nBUILT_SOURCES = main.c usage.c aggregate2_main.h"
  },
  {
    "path": "src/aggregate2/aggregate2.c",
    "chars": 11967,
    "preview": "/********************************\n   Copyright 2008 Google Inc.\n\n   Licensed under the Apache License, Version 2.0 (the "
  },
  {
    "path": "src/aggregate2/args.tab",
    "chars": 3917,
    "preview": "# data relevant to the application as a whole\n%global = (\n\tname => \"aggregate2\",\n\tdescription => \"aggregates data which "
  },
  {
    "path": "src/aggregate2/test/test.in",
    "chars": 236,
    "preview": "Text-1\tText-2\tNumeric-1\tNumeric-2\tNumeric-3\nfirst text value\ta\t1\t8\t3.14\nfirst text value\ta\t1\t5\t4.0\nfirst text value\tb\t1\t"
  },
  {
    "path": "src/aggregate2/test/test.in2",
    "chars": 125,
    "preview": "Text-1\tText-2\tNumeric-1\tNumeric-2\tNumeric-3\nthird text value\td\t3\t8\t11.2\nthird text value\te\t3\t5\t4.0\nthird text value\te\t3\t"
  },
  {
    "path": "src/aggregate2/test/test_00.expected",
    "chars": 56,
    "preview": "Text-1\tNumeric-1\nfirst text value\t3\nsecond text value\t8\n"
  },
  {
    "path": "src/aggregate2/test/test_00.sh",
    "chars": 700,
    "preview": "test_number=00\ndescription=\"one key, one sum\"\n\ninfile=$test_dir/test.in\noutfile=$test_dir/test_$test_number.out\nexpected"
  },
  {
    "path": "src/aggregate2/test/test_01.expected",
    "chars": 153,
    "preview": "Text-1\tText-2\tNumeric-1\tNumeric-2\nfirst text value\ta\t2\t13\nfirst text value\tb\t1\t3\nsecond text value\tb\t2\t2\nsecond text val"
  },
  {
    "path": "src/aggregate2/test/test_01.sh",
    "chars": 725,
    "preview": "test_number=01\ndescription=\"multi-key, multi-sum\"\n\ninfile=$test_dir/test.in\noutfile=$test_dir/test_$test_number.out\nexpe"
  },
  {
    "path": "src/aggregate2/test/test_02.expected",
    "chars": 65,
    "preview": "Text-1\tNumeric-3\nfirst text value\t17.14\nsecond text value\t29.233\n"
  },
  {
    "path": "src/aggregate2/test/test_02.sh",
    "chars": 702,
    "preview": "test_number=02\ndescription=\"one key, float sum\"\n\ninfile=$test_dir/test.in\noutfile=$test_dir/test_$test_number.out\nexpect"
  },
  {
    "path": "src/aggregate2/test/test_03.expected",
    "chars": 153,
    "preview": "Text-1\tText-2\tNumeric-3\nfirst text value\ta\t7.14\nfirst text value\tb\t10.00\nsecond text value\tb\t13.333\nsecond text value\tc\t"
  },
  {
    "path": "src/aggregate2/test/test_03.sh",
    "chars": 713,
    "preview": "test_number=03\ndescription=\"multi-key, float sum\"\n\ninfile=$test_dir/test.in\noutfile=$test_dir/test_$test_number.out\nexpe"
  },
  {
    "path": "src/aggregate2/test/test_04.sh",
    "chars": 920,
    "preview": "test_number=04\ndescription=\"handle blank key fields correctly\"\n\ninfile=$test_dir/test_$test_number.in\noutfile=$test_dir/"
  },
  {
    "path": "src/aggregate2/test/test_05.expected",
    "chars": 56,
    "preview": "Text-1\tSum-Field\nfirst text value\t3\nsecond text value\t8\n"
  },
  {
    "path": "src/aggregate2/test/test_05.sh",
    "chars": 735,
    "preview": "test_number=05\ndescription=\"user-specified agg-field labels\"\n\noutfile=\"$test_dir/test_$test_number.actual\"\nexpected=\"$te"
  },
  {
    "path": "src/aggregate2/test/test_06.expected",
    "chars": 77,
    "preview": "Text-1\tNumeric-1-Sum\tText-2-Count\nfirst text value\t3\t3\nsecond text value\t8\t4\n"
  },
  {
    "path": "src/aggregate2/test/test_06.sh",
    "chars": 724,
    "preview": "test_number=06\ndescription=\"auto-labels\"\n\noutfile=\"$test_dir/test_$test_number.actual\"\nexpected=\"$test_dir/test_$test_nu"
  },
  {
    "path": "src/aggregate2/test/test_07.expected",
    "chars": 75,
    "preview": "Text-1\tNumeric-1\nfirst text value\t3\nsecond text value\t8\nthird text value\t9\n"
  },
  {
    "path": "src/aggregate2/test/test_07.sh",
    "chars": 734,
    "preview": "test_number=07\ndescription=\"multiple trailing input files\"\n\ninfile=\"$test_dir/test.in $test_dir/test.in2\"\noutfile=$test_"
  },
  {
    "path": "src/aggregate2/test.conf",
    "chars": 187,
    "preview": "#!/bin/bash\n# not executable - the shebang is for the benefit of text-editors.\n\napplication=aggregate2\nbin=./aggregate2\n"
  },
  {
    "path": "src/bin/Makefile.am",
    "chars": 38,
    "preview": "EXTRA_DIST = testharness.sh genman.pl\n"
  },
  {
    "path": "src/bin/genman.pl",
    "chars": 2350,
    "preview": "#!/usr/bin/perl -w\n\nuse strict;\n\ndie \"usage: $0 <args.tab>\\n\" unless (@ARGV && -f $ARGV[0]);\n\nmy (%global, @args);\n# thi"
  },
  {
    "path": "src/bin/testharness.sh",
    "chars": 1145,
    "preview": "#!/bin/bash\n\nif [ ! \"$1\" ] || [ \"$1\" = \"-h\" ]; then\n  echo \"usage: $0 <config-file>\" >&2\n  exit 1\nfi\n\nif [ ! -e \"$1\" ]; "
  },
  {
    "path": "src/buffer/Makefile.am",
    "chars": 372,
    "preview": "main.c usage.c buffer_main.h : args.tab $(CGENER)\n\t\"$(CGENER)\" -a ./args.tab\n\nBUILT_SOURCES = main.c usage.c buffer_main"
  },
  {
    "path": "src/buffer/args.tab",
    "chars": 2242,
    "preview": "# this is a dummy file used only for generating documentation.\n\n# data relevant to the application as a whole\n%global = "
  },
  {
    "path": "src/buffer/buffer.c",
    "chars": 3106,
    "preview": "/********************************\n   Copyright 2008 Google Inc.\n\n   Licensed under the Apache License, Version 2.0 (the "
  },
  {
    "path": "src/calcfield/Makefile.am",
    "chars": 831,
    "preview": "bin_SCRIPTS = calcfield\nCLEANFILES = $(bin_SCRIPTS)\n\ncalcfield: calcfield.in Makefile\n\t$(M4) -D\"CRUSH_PERL_PATH=$(PERL)\""
  },
  {
    "path": "src/calcfield/args.tab",
    "chars": 3830,
    "preview": "# this is a dummy file used only for generating documentation.\n\n# data relevant to the application as a whole\n%global = "
  },
  {
    "path": "src/calcfield/calcfield.in",
    "chars": 6076,
    "preview": "#!CRUSH_PERL_PATH\n\n#  Copyright 2008 Google Inc.\n#\n#  Licensed under the Apache License, Version 2.0 (the \"License\");\n# "
  },
  {
    "path": "src/calcfield/test/imps_clks.log",
    "chars": 90,
    "preview": "IDMetric-0Metric-1\n100000161\n1000012\n1000021\n1000032471\n100004215214988\n1000053\n100006131\n"
  },
  {
    "path": "src/calcfield/test/test.txt",
    "chars": 78,
    "preview": "Text1;Metric-0;Metric-1;Text2\nhello;1;3;world\ntobias;7;1;wolff\nbla;400;0;test\n"
  },
  {
    "path": "src/calcfield/test/test_00.expected",
    "chars": 104,
    "preview": "Text1;Metric-0;Metric-1;Text2;0.0\nhello;1;3;world;3\ntobias;7;1;wolff;0.142857142857143\nbla;400;0;test;0\n"
  },
  {
    "path": "src/calcfield/test/test_00.sh",
    "chars": 417,
    "preview": "test_number=00\ndescription=\"formula using indexes\"\n\ninfile=\"$test_dir/test.txt\"\noutfile=\"$test_dir/test_$test_number.act"
  },
  {
    "path": "src/calcfield/test/test_01.expected",
    "chars": 119,
    "preview": "Text1;Metric-0;Metric-1;Text2;Calculated-Field\nhello;1;3;world;0.333333333333333\ntobias;7;1;wolff;7\nbla;400;0;test;0.0\n"
  },
  {
    "path": "src/calcfield/test/test_01.sh",
    "chars": 433,
    "preview": "test_number=01\ndescription=\"formula using labels\"\n\ninfile=\"$test_dir/test.txt\"\noutfile=\"$test_dir/test_$test_number.actu"
  },
  {
    "path": "src/calcfield/test/test_02.expected",
    "chars": 148,
    "preview": "IDMetric-0Metric-1Calculated-Field\n1000001610.000\n10000120.000\n1000021N/A\n100003247124700.000\n10000421521498821782.794\n1"
  },
  {
    "path": "src/calcfield/test/test_02.sh",
    "chars": 456,
    "preview": "test_number=02\ndescription=\"expression using indexes\"\n\ninfile=\"$test_dir/imps_clks.log\"\noutfile=\"$test_dir/test_$test_nu"
  },
  {
    "path": "src/calcfield/test/test_03.expected",
    "chars": 148,
    "preview": "IDMetric-0Metric-1Calculated-Field\n1000001610.000\n10000120.000\n1000021N/A\n100003247124700.000\n10000421521498821782.794\n1"
  },
  {
    "path": "src/calcfield/test/test_03.sh",
    "chars": 469,
    "preview": "test_number=03\ndescription=\"expression using labels\"\n\ninfile=\"$test_dir/imps_clks.log\"\noutfile=\"$test_dir/test_$test_num"
  },
  {
    "path": "src/calcfield/test/test_04.0.expected",
    "chars": 117,
    "preview": "Calculated-Field;Text1;Metric-0;Metric-1;Text2\n3;hello;1;3;world\n0.142857142857143;tobias;7;1;wolff\n0;bla;400;0;test\n"
  },
  {
    "path": "src/calcfield/test/test_04.1.expected",
    "chars": 94,
    "preview": "Calculated-Field;Metric-0;Metric-1;Text2\n3;1;3;world\n0.142857142857143;7;1;wolff\n0;400;0;test\n"
  },
  {
    "path": "src/calcfield/test/test_04.2.expected",
    "chars": 117,
    "preview": "Text1;Metric-0;Metric-1;Calculated-Field;Text2\nhello;1;3;3;world\ntobias;7;1;0.142857142857143;wolff\nbla;400;0;0;test\n"
  },
  {
    "path": "src/calcfield/test/test_04.3.expected",
    "chars": 117,
    "preview": "Text1;Metric-0;Metric-1;Calculated-Field;Text2\nhello;1;3;3;world\ntobias;7;1;0.142857142857143;wolff\nbla;400;0;0;test\n"
  },
  {
    "path": "src/calcfield/test/test_04.sh",
    "chars": 697,
    "preview": "test_number=04\ndescription=\"placement of calculated field\"\n\ninfile=\"$test_dir/test.txt\"\n\nsubtests=('-p -i 1' '-p -r 1' '"
  },
  {
    "path": "src/calcfield/test/test_05.expected",
    "chars": 105,
    "preview": "Text1;A;B;Text2;Calculated-Field\nhello;1;3;world;0.333333333333333\ntobias;7;1;wolff;7\nbla;400;0;test;0.0\n"
  },
  {
    "path": "src/calcfield/test/test_05.sh",
    "chars": 470,
    "preview": "test_number=05\ndescription=\"single-character labels\"\n\ninfile=\"$test_dir/test.txt\"\noutfile=\"$test_dir/test_$test_number.a"
  },
  {
    "path": "src/calcfield/test.conf",
    "chars": 163,
    "preview": "#!/bin/bash\n# not executable - the shebang is for the benefit of text-editors.\n\napplication=calcfield\nbin=./calcfield\nte"
  },
  {
    "path": "src/convdate/Makefile.am",
    "chars": 534,
    "preview": "BUILT_SOURCES = main.c usage.c convdate_main.h\n\n$(BUILT_SOURCES) : args.tab\n\t\"$(CGENER)\" -a ./args.tab\n\nbin_PROGRAMS = c"
  },
  {
    "path": "src/convdate/args.tab",
    "chars": 2872,
    "preview": "# data relevant to the application as a whole\n%global = (\n\tname => \"convdate\",\n\tcategory => \"General file manipulation\","
  },
  {
    "path": "src/convdate/convdate.c",
    "chars": 3797,
    "preview": "/********************************\n   Copyright 2008 Google Inc.\n\n   Licensed under the Apache License, Version 2.0 (the "
  },
  {
    "path": "src/convdate/convdate.h",
    "chars": 944,
    "preview": "/*****************************************\n   Copyright 2008 Google Inc.\n\n   Licensed under the Apache License, Version "
  },
  {
    "path": "src/convdate/example.html",
    "chars": 1347,
    "preview": "\n# assume a standard dt file as the input with the time in the first\n# field with the default time format MM-DD-YYYY-HH:"
  },
  {
    "path": "src/convdate/test/test_01.sh",
    "chars": 569,
    "preview": "test_number=01\ndescription=\"defaults\"\n\nexpected=$test_dir/test_$test_number.expected\noutput=$test_dir/test_$test_number."
  },
  {
    "path": "src/convdate/test/test_02.sh",
    "chars": 617,
    "preview": "test_number=02\ndescription=\"input and output format specified\"\n\nexpected=$test_dir/test_$test_number.expected\noutput=$te"
  },
  {
    "path": "src/convdate/test/test_03.sh",
    "chars": 586,
    "preview": "test_number=03\ndescription=\"user-specified field\"\n\nexpected=$test_dir/test_$test_number.expected\noutput=$test_dir/test_$"
  },
  {
    "path": "src/convdate/test/test_04.sh",
    "chars": 595,
    "preview": "test_number=04\ndescription=\"user-specified field label\"\n\nexpected=$test_dir/test_$test_number.expected\noutput=$test_dir/"
  },
  {
    "path": "src/convdate/test.conf",
    "chars": 183,
    "preview": "#!/bin/bash\n# not executable - the shebang is for the benefit of text-editors.\n\napplication=convdate\nbin=./convdate\ntest"
  },
  {
    "path": "src/csvformat/Makefile.am",
    "chars": 589,
    "preview": "bin_SCRIPTS = csvformat\nCLEANFILES = $(bin_SCRIPTS)\nEXTRA_DIST = args.tab csvformat.in test.conf \\\n             tests/te"
  },
  {
    "path": "src/csvformat/args.tab",
    "chars": 2423,
    "preview": "# this is a dummy file used only for generating documentation.\n\n# data relevant to the application as a whole\n%global = "
  },
  {
    "path": "src/csvformat/csvformat.in",
    "chars": 4066,
    "preview": "#!CRUSH_PERL_PATH -w\n#-*-perl-*-\n\n#  Copyright 2008-2013 Google Inc.\n#\n#  Licensed under the Apache License, Version 2.0"
  },
  {
    "path": "src/csvformat/test.conf",
    "chars": 185,
    "preview": "#!/bin/bash\n# not executable - the shebang is for the benefit of text-editors.\n\napplication=csvformat\nbin=./csvformat\nte"
  },
  {
    "path": "src/csvformat/tests/test_00.expected",
    "chars": 41,
    "preview": "\"hello\",\"\"\n\"hello\",\"world\"\r\n\"bye\",\"now\"\r\n"
  },
  {
    "path": "src/csvformat/tests/test_00.sh",
    "chars": 412,
    "preview": "test=00\nsub_test=0\ndescription=\"preservation of linebreak style\"\n\necho -ne \"hello${DELIMITER}\\nhello${DELIMITER}world\\r\\"
  },
  {
    "path": "src/csvformat/tests/test_01.sh",
    "chars": 268,
    "preview": "test=01\nsub_test=0\ndescription=\"no linebreak at end of file.\"\noutput=`echo -n \"hello${DELIMITER}world\" | $bin 2>&1`\nif ["
  },
  {
    "path": "src/csvformat/tests/test_02.sh",
    "chars": 548,
    "preview": "test=02\ndescription=\"quote-escaping\"\n\nsub_test=0\noutput=`echo \"say \\\"hello\\\"${DELIMITER}world\" | $bin 2>&1`\nif [ \"$outpu"
  },
  {
    "path": "src/csvformat/tests/test_03.expected",
    "chars": 16,
    "preview": "\"hello\",\"world\"\n"
  },
  {
    "path": "src/csvformat/tests/test_03.in",
    "chars": 12,
    "preview": "hello|world\n"
  },
  {
    "path": "src/csvformat/tests/test_03.sh",
    "chars": 1024,
    "preview": "test=03\ndescription=\"input/output options\"\n\nsub_test=0\necho \"hello${DELIMITER}world\" |\n  $bin -o $test_dir/test_$test.$s"
  },
  {
    "path": "src/csvformat/tests/test_04.sh",
    "chars": 1395,
    "preview": "test=04\n\nsub_test=0\ndescription=\"quote all\"\noutput=`echo \"hello${DELIMITER}world\" | $bin -q all 2>&1`\nif [ \"$output\" != "
  },
  {
    "path": "src/cutfield/Makefile.am",
    "chars": 552,
    "preview": "BUILT_SOURCES = main.c usage.c cutfield_main.h\n\n$(BUILT_SOURCES) : args.tab\n\t\"$(CGENER)\" -a ./args.tab\n\nbin_PROGRAMS = c"
  },
  {
    "path": "src/cutfield/args.tab",
    "chars": 2788,
    "preview": "# data relevant to the application as a whole\n%global = (\n\tname => \"cutfield\",\n\tdescription => \"removes specified fields"
  },
  {
    "path": "src/cutfield/cutfield.c",
    "chars": 4346,
    "preview": "/********************************\n   Copyright 2008 Google Inc.\n\n   Licensed under the Apache License, Version 2.0 (the "
  },
  {
    "path": "src/cutfield/test/test_01.sh",
    "chars": 914,
    "preview": "test_number=01\ndescription=\"first field\"\n\nexpected=$test_dir/test_$test_number.expected\ninput=$test_dir/test_$test_numbe"
  },
  {
    "path": "src/cutfield/test/test_02.sh",
    "chars": 934,
    "preview": "test_number=02\ndescription=\"middle field\"\n\nexpected=$test_dir/test_$test_number.expected\ninput=$test_dir/test_$test_numb"
  },
  {
    "path": "src/cutfield/test/test_03.sh",
    "chars": 932,
    "preview": "test_number=03\ndescription=\"last field\"\n\nexpected=$test_dir/test_$test_number.expected\ninput=$test_dir/test_$test_number"
  },
  {
    "path": "src/cutfield/test/test_04.sh",
    "chars": 959,
    "preview": "test_number=04\ndescription=\"correctly handle empty fields\"\n\nexpected=$test_dir/test_$test_number.expected\ninput=$test_di"
  },
  {
    "path": "src/cutfield/test/test_05.sh",
    "chars": 710,
    "preview": "test_number=05\ndescription=\"correctly err on missing field without segmentation fault\"\n\nexpected=$test_dir/test_$test_nu"
  },
  {
    "path": "src/cutfield/test.conf",
    "chars": 183,
    "preview": "#!/bin/bash\n# not executable - the shebang is for the benefit of text-editors.\n\napplication=cutfield\nbin=./cutfield\ntest"
  },
  {
    "path": "src/dates_in_range/Makefile.am",
    "chars": 360,
    "preview": "bin_SCRIPTS = dates_in_range\nCLEANFILES = $(bin_SCRIPTS)\nEXTRA_DIST = args.tab dates_in_range.in\ndates_in_range: dates_i"
  },
  {
    "path": "src/dates_in_range/args.tab",
    "chars": 2026,
    "preview": "# this is a dummy file used only for generating documentation.\n\n# data relevant to the application as a whole\n%global = "
  },
  {
    "path": "src/dates_in_range/dates_in_range.in",
    "chars": 2019,
    "preview": "#!CRUSH_PERL_PATH -w\n\n#  Copyright 2008 Google Inc.\n#\n#  Licensed under the Apache License, Version 2.0 (the \"License\");"
  },
  {
    "path": "src/dbstream/Makefile.am",
    "chars": 519,
    "preview": "bin_SCRIPTS = dbstream\nCLEANFILES = $(bin_SCRIPTS)\nEXTRA_DIST = args.tab dbstream.in test.conf tests/setup.pl \\\n        "
  },
  {
    "path": "src/dbstream/args.tab",
    "chars": 2770,
    "preview": "# this is a dummy file used only for generating documentation.\n\n# data relevant to the application as a whole\n%global = "
  },
  {
    "path": "src/dbstream/dbstream.in",
    "chars": 5052,
    "preview": "#!CRUSH_PERL_PATH -w\n#-*-perl-*-\n\n#  Copyright 2008 Google Inc.\n#\n#  Licensed under the Apache License, Version 2.0 (the"
  },
  {
    "path": "src/dbstream/test.conf",
    "chars": 394,
    "preview": "#!/bin/bash\n# not executable - the shebang is for the benefit of text-editors.\n\napplication=dbstream\nbin=./$application\n"
  },
  {
    "path": "src/dbstream/tests/setup.pl",
    "chars": 590,
    "preview": "#!/usr/bin/perl -w\n\nuse strict;\nuse DBI;\n\n# DBM supports only 2 columns unless the MLDBM package is installed.\n# We'll j"
  },
  {
    "path": "src/dbstream/tests/test_00.sh",
    "chars": 406,
    "preview": "test_number=00\ndescription=\"select, no header\"\n\n$test_dir/setup.pl || {\n  test_status $test_number 1 \"$description (setu"
  },
  {
    "path": "src/dbstream/tests/test_01.sh",
    "chars": 462,
    "preview": "test_number=01\ndescription=\"select with header\"\n\n$test_dir/setup.pl || {\n  test_status $test_number 1 \"$description (set"
  },
  {
    "path": "src/dbstream/tests/test_02.sh",
    "chars": 585,
    "preview": "test_number=02\ndescription=\"update with placeholders\"\n\n$test_dir/setup.pl || {\n  test_status $test_number 1 \"$descriptio"
  },
  {
    "path": "src/dbstream/tests/test_03.sh",
    "chars": 593,
    "preview": "test_number=03\ndescription=\"insert with placeholders\"\n\n$test_dir/setup.pl || {\n  test_status $test_number 1 \"$descriptio"
  },
  {
    "path": "src/dbstream/tests/test_04.sh",
    "chars": 566,
    "preview": "test_number=04\ndescription=\"select with placeholders\"\n\n$test_dir/setup.pl || {\n  test_status $test_number 1 \"$descriptio"
  },
  {
    "path": "src/dbstream/tests/test_05.sh",
    "chars": 479,
    "preview": "test_number=05\ndescription=\"update without placeholders\"\n\n$test_dir/setup.pl || {\n  test_status $test_number 1 \"$descrip"
  },
  {
    "path": "src/dbstream/tests/test_06.sh",
    "chars": 489,
    "preview": "test_number=06\ndescription=\"insert without placeholders\"\n\n$test_dir/setup.pl || {\n  test_status $test_number 1 \"$descrip"
  },
  {
    "path": "src/dbstream/tests/test_07.sh",
    "chars": 552,
    "preview": "test_number=07\ndescription=\"delete without placeholders\"\n\n$test_dir/setup.pl || {\n  test_status $test_number 1 \"$descrip"
  },
  {
    "path": "src/dbstream/tests/test_08.sh",
    "chars": 558,
    "preview": "test_number=08\ndescription=\"delete with placeholders\"\n\n$test_dir/setup.pl || {\n  test_status $test_number 1 \"$descriptio"
  },
  {
    "path": "src/deltadays/Makefile.am",
    "chars": 330,
    "preview": "bin_SCRIPTS = deltadays\nCLEANFILES = $(bin_SCRIPTS)\nEXTRA_DIST = args.tab deltadays.in\ndeltadays: deltadays.in Makefile\n"
  },
  {
    "path": "src/deltadays/args.tab",
    "chars": 1747,
    "preview": "# this is a dummy file used only for generating documentation.\n\n# data relevant to the application as a whole\n%global = "
  },
  {
    "path": "src/deltadays/deltadays.in",
    "chars": 1711,
    "preview": "#!CRUSH_PERL_PATH -w\n# -*-perl-*-\n\n#  Copyright 2008 Google Inc.\n#\n#  Licensed under the Apache License, Version 2.0 (th"
  },
  {
    "path": "src/deltaforce/Makefile.am",
    "chars": 1027,
    "preview": "main.c usage.c deltaforce_main.h : args.tab\n\t\"$(CGENER)\" -a ./args.tab\n\nBUILT_SOURCES = main.c usage.c deltaforce_main.h"
  },
  {
    "path": "src/deltaforce/args.tab",
    "chars": 2529,
    "preview": "# data relevant to the application as a whole\n%global = (\n\tcategory => 'General file manipulation',\n\tname => \"deltaforce"
  },
  {
    "path": "src/deltaforce/deltaforce.c",
    "chars": 8064,
    "preview": "/********************************\n   Copyright 2008 Google Inc.\n\n   Licensed under the Apache License, Version 2.0 (the "
  },
  {
    "path": "src/deltaforce/deltaforce.h",
    "chars": 1836,
    "preview": "/*****************************************\n   Copyright 2008 Google Inc.\n\n   Licensed under the Apache License, Version "
  },
  {
    "path": "src/deltaforce/test.conf",
    "chars": 251,
    "preview": "#!/bin/bash\n# not executable - the shebang is for the benefit of text-editors.\n\napplication=deltaforce\nbin=./$applicatio"
  },
  {
    "path": "src/deltaforce/tests/test_00-delta.txt",
    "chars": 116,
    "preview": "ID-0\tID-1\tID-2\tID-3\tText-0\n43002\t21001\t21002\t71001\ttext two, improved! \n43009\t21009\t21010\t71010\ttext nine, suckers!\n"
  },
  {
    "path": "src/deltaforce/tests/test_00-full.txt",
    "chars": 129,
    "preview": "ID-0\tID-1\tID-2\tID-3\tText-0\n43001\t21001\t21002\t71001\ttext one\n43002\t21001\t21002\t71001\ttext two \n43003\t21001\t21002\t71001\tte"
  },
  {
    "path": "src/deltaforce/tests/test_00.expected",
    "chars": 184,
    "preview": "ID-0\tID-1\tID-2\tID-3\tText-0\n43001\t21001\t21002\t71001\ttext one\n43002\t21001\t21002\t71001\ttext two, improved! \n43003\t21001\t210"
  },
  {
    "path": "src/deltaforce/tests/test_00.sh",
    "chars": 1052,
    "preview": "test_number=00\ndescription=\"defaults\"\n\nleft=$test_dir/test_$test_number-full.txt\nright=$test_dir/test_$test_number-delta"
  },
  {
    "path": "src/deltaforce/tests/test_01-delta.txt",
    "chars": 78,
    "preview": "ID\tTime\r\n2\t11-10-2007-19:55:28\r\n5\t11-10-2007-12:29:18\r\n7\t11-10-2007-12:40:31\r\n"
  },
  {
    "path": "src/deltaforce/tests/test_01-full.txt",
    "chars": 147,
    "preview": "ID\tTime\r\n1\t10-29-2007-11:39:17\r\n2\t11-02-2007-19:55:28\r\n3\t10-26-2007-15:39:56\r\n4\t10-30-2007-16:53:36\r\n5\t11-09-2007-12:29:"
  },
  {
    "path": "src/deltaforce/tests/test_01.expected",
    "chars": 170,
    "preview": "ID\tTime\r\n1\t10-29-2007-11:39:17\r\n2\t11-10-2007-19:55:28\r\n3\t10-26-2007-15:39:56\r\n4\t10-30-2007-16:53:36\r\n5\t11-10-2007-12:29:"
  },
  {
    "path": "src/deltaforce/tests/test_01.sh",
    "chars": 1052,
    "preview": "test_number=01\ndescription=\"defaults\"\n\nleft=$test_dir/test_$test_number-full.txt\nright=$test_dir/test_$test_number-delta"
  },
  {
    "path": "src/deltaforce/tests/test_02-delta.txt",
    "chars": 74,
    "preview": "Time\tID\n11-10-2007-19:55:28\t2\n11-10-2007-12:29:18\t5\n11-10-2007-12:40:31\t7\n"
  },
  {
    "path": "src/deltaforce/tests/test_02-full.txt",
    "chars": 140,
    "preview": "Time\tID\n10-29-2007-11:39:17\t1\n11-02-2007-19:55:28\t2\n10-26-2007-15:39:56\t3\n10-30-2007-16:53:36\t4\n11-09-2007-12:29:18\t5\n11"
  },
  {
    "path": "src/deltaforce/tests/test_02.expected",
    "chars": 162,
    "preview": "Time\tID\n10-29-2007-11:39:17\t1\n11-10-2007-19:55:28\t2\n10-26-2007-15:39:56\t3\n10-30-2007-16:53:36\t4\n11-10-2007-12:29:18\t5\n11"
  }
]

// ... and 392 more files (download for full content)

About this extraction

This page contains the full source code of the google/crush-tools GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 592 files (3.4 MB), approximately 921.8k tokens, and a symbol index with 275 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!